This commit is contained in:
Cryptoval Trading Technologies 2024-04-22 00:47:41 +01:00
parent 4724505fdf
commit f9308ab9fb
8 changed files with 381 additions and 128 deletions

82
data/apps/algo_trade.cfg Normal file
View File

@ -0,0 +1,82 @@
@var CONFIG_SVC_HOST=cloud16.cvtt.vpn
@var ResultPath=/tmp
{
"refdata": @inc=http://${CONFIG_SVC_HOST}:6789/refdata/refdata
, "redis": @inc=http://${CONFIG_SVC_HOST}:6789/apps/redis
, "algos": @inc=http://${CONFIG_SVC_HOST}:6789/apps/algos
# , "cvttcomm": {
# "type": "redis"
# , "redis_settings": "cvtt-prod-02"
# }
, "session_type": "CALENDAR"
, "calendar_session": {
"trading_hours_url": [
"GET"
, "http://cloud16.cvtt.vpn:8000/api/v1/markets/hours?mic=XNYS&start={start}&end={end}"
]
}
, "exchanges_settings": {
"COINBASE_AT-MDPORTAL": {
"order_entry": {
"enabled": true
, "streaming": true
},
"mkt_data": {
"enabled": true
, "streaming": true
},
"accounting": {
"enabled": false
, "streaming": false
}
, "credentials_key": {
"read_only": "COINBASE_ADV_RO"
, "trade": "COINBASE_ADV_TRD"
}
}
}
}
# , "books": {
# "ALPACA_BK02": {}
# , "ALPACA_BK_ILYA_01": {}
# }
# # --------------------------------------------------------------------
# , "trader": {
# "app_channel": "TRDR" active_exchanges_: str
# , "is_short_allowed": false
# , "exchanges_settings": {
# "*": {
# "mkt_data": {
# "enabled": true
# , "streaming": true
# },
# }
# }
# , "trading_pos_diff_pct_trigger": 10.0
# , "trading_depth": {
# "USD": 1000.0,
# }
# }
# , "quant": {
# "app_channel": "QUANT"
# , "strategies": @inc=http://${CONFIG_SVC_HOST}:6789/apps/strategies
# , "exchanges_settings": {
# "*": {
# "mkt_data": {
# "enabled": true
# , "streaming": true
# },
# }
# # , "COINBASE_AT": {
# # "mkt_data": {
# # "enabled": true
# # , "streaming": true
# # },
# # }
# }
# }
# }

View File

@ -9,7 +9,7 @@
},
}
, "TRDALGO_TWAP01": {
"class": "cvttpy.trading.algos.twap.BasicTwapAlgo"
"class": "cvttpy.trading.algos.twap.TwapAlgo"
, "params": {
"num_slices": 5
, "duration_sec": 1500 # 25 min
@ -21,7 +21,7 @@
},
}
, "TRDALGO_ICEBERG01": {
"class": "cvttpy.trading.algos.twap.BasicTwapAlgo"
"class": "cvttpy.trading.algos.twap.TwapAlgo"
, "params": {
"num_slices": 5
, "duration_sec": 1500 # 25 min

View File

@ -18,6 +18,7 @@
}
, "books": {
"ALPACA_BK02": {}
, "ALPACA_BK_ILYA_01": {}
}
# --------------------------------------------------------------------
, "trader": {
@ -120,9 +121,9 @@
# --------------------------------------------------------------------
, "risk_manager": {
"app_channel": "RMGR"
, "books": {
"CVTT_BK01": {}
}
# , "books": {
# "CVTT_BK01": {}
# }
, "db": {
"positions_table": "prod.cvtt_positions"
, "cred_key": {

View File

@ -0,0 +1,180 @@
@var CONFIG_SVC_HOST=cloud16.cvtt.vpn
@var ResultPath=/tmp
{
"refdata": @inc=http://${CONFIG_SVC_HOST}:6789/refdata/refdata
, "redis": @inc=http://${CONFIG_SVC_HOST}:6789/apps/redis
, "active_instruments": @inc=http://${CONFIG_SVC_HOST}:6789/apps/active_instruments
, "cvttcomm": {
"type": "redis"
, "redis_settings": "cvtt-prod-02"
}
, "session_type": "CALENDAR"
, "calendar_session": {
"trading_hours_url": [
"GET"
, "http://cloud16.cvtt.vpn:8000/api/v1/markets/hours?mic=XNYS&start={start}&end={end}"
]
}
, "books": {
"ALPACA_BK02": {}
, "ALPACA_BK_ILYA_01": {}
}
# --------------------------------------------------------------------
, "trader": {
"app_channel": "TRDR_03" active_exchanges_: str
, "is_short_allowed": false
, "exchanges_settings": {
"*": {
"mkt_data": {
"enabled": true
, "streaming": true
},
}
}
, "algos": @inc=http://${CONFIG_SVC_HOST}:6789/apps/algos
, "trading_pos_diff_pct_trigger": 10.0
, "trading_depth": {
"USD": 1000.0,
}
}
# --------------------------------------------------------------------
"executor": {
"app_channel": "EXEC_03"
, "exchanges_settings": {
"COINBASE_AT": {
"order_entry": {
"enabled": true
, "streaming": true
},
"mkt_data": {
"enabled": false
, "streaming": false
},
"accounting": {
"enabled": false
, "streaming": false
}
, "credentials_key": {
"read_only": "COINBASE_ADV_RO"
, "trade": "COINBASE_ADV_TRD"
}
}
, "ALPACA_SNDBX": {
"order_entry": {
"enabled": true
, "streaming": true
},
"mkt_data": {
"enabled": false
, "streaming": false
},
"accounting": {
"enabled": false
, "streaming": false
}
, "credentials_key": {
"read_only": "ALPACA_SANDBOX"
, "trade": "ALPACA_SANDBOX"
}
}
, "ALPACA_SNDBX-MDPORTAL": {
"order_entry": {
"enabled": true
, "streaming": true
},
"mkt_data": {
"enabled": false
, "streaming": false
},
"accounting": {
"enabled": false
, "streaming": false
}
, "credentials_key": {
"read_only": "ALPACA_SANDBOX"
, "trade": "ALPACA_SANDBOX"
}
}
}
}
# --------------------------------------------------------------------
, "quant": {
"app_channel": "QUANT_03"
, "strategies": @inc=http://${CONFIG_SVC_HOST}:6789/apps/strategies
, "exchanges_settings": {
"*": {
"mkt_data": {
"enabled": true
, "streaming": true
},
}
# , "COINBASE_AT": {
# "mkt_data": {
# "enabled": true
# , "streaming": true
# },
# }
}
}
# --------------------------------------------------------------------
, "risk_manager": {
"app_channel": "RMGR_03"
# , "books": {
# "CVTT_BK01": {}
# }
, "db": {
"positions_table": "prod.cvtt_positions"
, "cred_key": {
"write": "TSDB_TRD_CVTTDATA"
, "read_only": "TSDB_TRD_CVTTDATA"
}
}
, "positions": {
"load_interval_sec": 10.0
, "to_store_zero_positions": false
, "to_save_unchanged_positions": false
}
, "publish_value_interval": 10.0
, "exchanges_settings": {
"*": {
"mkt_data": {
"enabled": true
, "streaming": true
},
"accounting": {
"enabled": true
, "streaming": false
}
, "credentials_key": {
"trade": "ALPACA_SANDBOX"
, "read_only": "ALPACA_SANDBOX"
}
}
}
}
, "trading_recorder": {
# "format": "CSV"
# "format": "TSDB"
"format": "SQLite"
, "csv_settings": {
"order_events_file_path": "%T.order_events.csv"
"position_events_file_path": "%T.position_events.csv"
}
, "tsdb_settings": {
"db": {
"class": "cvttpy.tools.db.timescale.tsdb_client.TimescaleDbClient"
, "cred_key": "TSDB_TRD_CVTTDATA_DB_TEST"
}
, "order_events_table": "backtest.trading_orders"
, "trade_events_table": "backtest.trading_trades"
, "trading_md_summary_table": "backtest.trading_md"
}
, "sqlite_settings": {
# "file_name": "/tmp/%T.cvtt_backtest.db"
"file_name": "/tmp/%T.cvtt_alpaca_sandbox.db"
}
}
}

View File

@ -4,66 +4,4 @@
# ----------------------------------
"refdata": @inc=http://${CONFIG_SVC_HOST}:6789/refdata/refdata
, "redis": @inc=http://${CONFIG_SVC_HOST}:6789/apps/redis
, "md_portal": {
"app_channel": "MD_PORTAL"
, "exchanges_settings": {
"ALPACA_SNDBX": {
"order_entry": {
"enabled": false
, "streaming": false
},
"mkt_data": {
"enabled": true
, "streaming": true
},
"accounting": {
"enabled": false
, "streaming": false
}
}
, "BNBSPOT": {
"order_entry": {
"enabled": false
, "streaming": false
},
"mkt_data": {
"enabled": true
, "streaming": true
},
"accounting": {
"enabled": false
, "streaming": false
}
}
, "BNBFUT": {
"order_entry": {
"enabled": false
, "streaming": false
},
"mkt_data": {
"enabled": true
, "streaming": true
},
"accounting": {
"enabled": false
, "streaming": false
}
}
"COINBASE_AT": {
"order_entry": {
"enabled": false
, "streaming": false
},
"mkt_data": {
"enabled": true
, "streaming": true
},
"accounting": {
"enabled": false
, "streaming": false
}
}
}
}
}

View File

@ -0,0 +1,69 @@
@var CONFIG_SVC_HOST=cloud16.cvtt.vpn
{
# ----------------------------------
"refdata": @inc=http://${CONFIG_SVC_HOST}:6789/refdata/refdata
, "redis": @inc=http://${CONFIG_SVC_HOST}:6789/apps/redis
, "md_portal": {
"app_channel": "MD_PORTAL_03"
, "exchanges_settings": {
"ALPACA_SNDBX": {
"order_entry": {
"enabled": false
, "streaming": false
},
"mkt_data": {
"enabled": true
, "streaming": true
},
"accounting": {
"enabled": false
, "streaming": false
}
}
, "BNBSPOT": {
"order_entry": {
"enabled": false
, "streaming": false
},
"mkt_data": {
"enabled": true
, "streaming": true
},
"accounting": {
"enabled": false
, "streaming": false
}
}
, "BNBFUT": {
"order_entry": {
"enabled": false
, "streaming": false
},
"mkt_data": {
"enabled": true
, "streaming": true
},
"accounting": {
"enabled": false
, "streaming": false
}
}
"COINBASE_AT": {
"order_entry": {
"enabled": false
, "streaming": false
},
"mkt_data": {
"enabled": true
, "streaming": true
},
"accounting": {
"enabled": false
, "streaming": false
}
}
}
}
}

View File

@ -17,12 +17,9 @@
},
}
}
, "cvttcomm": {
"type": "redis"
, "redis_settings": "localhost"
}
, "md_portal": {
"app_channel": "MD_PORTAL"
}
# , "cvttcomm": {
# "type": "redis"
# , "redis_settings": "localhost"
# }
}

View File

@ -67,6 +67,7 @@
}
, "mktdata" : {
"class": "cvttpy.exchanges.proxies.md_portal_clnt.mkt_data.MktDataPortalFeed"
, "portal_name": "MD_PORTAL_ALPACA_02"
# allow direct REST requests
, "REST": {
@ -106,6 +107,22 @@
}
}
# ---------------------- B
, "BITSTAMP": {
"exchange_id": "BITSTAMP"
, "name": "Bitstamp"
, "type": "SPOT"
, "module" : "cvttpy.oms.exchange"
, "connector_class" : "MdOnlyExchangeConnector"
, "mktdata" : {
"class": "cvttpy.exchanges.bitstamp.mkt_data.BitstampMdFeed"
, "reconnect_secs": 2
, "ws_url": ["WSS", "wss://ws.bitstamp.net"]
}
}
, "BNBSPOT": {
"exchange_id": "BNBSPOT"
, "name": "Binance Spot"
@ -291,63 +308,10 @@
, "mktdata" : {
"class": "cvttpy.exchanges.proxies.md_portal_clnt.mkt_data.MktDataPortalFeed"
, "portal_name": "MD_PORTAL_COINBS_02"
}
}
, "BACKTEST_001": {
"exchange_id": "COINBASE"
, "name": "Coinbase Backtest"
, "type": "BACKTEST"
# , "order_entry": {
# "class": "cvttpy.exchanges.coinbase.spot.connector.CoinbaseSpotRestExchConnector"
# , "REST": {
# "open_orders_url": ["GET", "https://api.coinbase.com/api/v3/brokerage/orders/historical/batch"]
# , "submit_order_url": ["POST", "https://api.coinbase.com/api/v3/brokerage/orders"]
# , "cancel_order_url": ["POST", "https://api.coinbase.com/api/v3/brokerage/orders/batch_cancel"]
# },
# "ws_url": ["WSS", "wss://advanced-trade-ws.coinbase.com"]
# }
# , "accounting": {
# "class": "cvttpy.exchanges.coinbase.spot.account.CoinbaseSpotAccounting"
# , "REST": {
# "balances_url": ["GET", "https://api.coinbase.com/api/v3/brokerage/accounts"]
# , "get_trades_url": ["GET", "https://api.coinbase.com/api/v3/brokerage/orders/historical/fills"]
# , "get_transactions_url": ["GET", "https://api.coinbase.com/api/v3/brokerage/transaction_summary"]
# }
# }
, "mktdata" : {
"class": "cvttpy.research.backtest.mkt_data.BacktestSimFeed"
, "db": {
"module": "cvttpy.tools.db.timescale.tsdb_client"
, "class": "TimescaleDbClient"
, "connect": {
"host": ${DatabaseHost}
, "port": 5432
, "database": "coinbase"
}
}
, "readers": [
{
"class": "cvttpy.research.time_series.ts_df_reader"
, "table": "md_trades"
, "interval": "12 hours"
, "from_time": null
}
, {
"class": "cvttpy.research.time_series.ts_df_reader"
, "table": "md_booktops"
, "interval": "12 hours"
, "from_time": null
}
]
}
}
, "MD_PORTAL": {
"exchange_id": "MD_PORTAL"
, "name": "MD Portal (proxy)"
@ -357,5 +321,27 @@
"class": "cvttpy.exchanges.proxies.md_portal_clnt.mkt_data.MktDataPortalFeed"
}
}
, "MD_PORTAL_ALPACA_02": {
"exchange_id": "MD_PORTAL"
, "name": "MD Portal (proxy)"
, "type": "PROXY"
, "mktdata" : {
"class": "cvttpy.exchanges.proxies.md_portal_clnt.mkt_data.MktDataPortalFeed"
, "redis_settings": "cvtt-prod-02"
, "channel_prefix": "MD_ALPACA_02"
}
}
, "MD_PORTAL_COINBS_02": {
"exchange_id": "MD_PORTAL"
, "name": "MD Portal (proxy)"
, "type": "PROXY"
, "mktdata" : {
"class": "cvttpy.exchanges.proxies.md_portal_clnt.mkt_data.MktDataPortalFeed"
, "redis_settings": "cvtt-prod-02"
, "channel_prefix": "MD_COINBS_02"
}
}
}