252 lines
8.3 KiB
INI
252 lines
8.3 KiB
INI
@var ResultPath=/tmp
|
|
|
|
{
|
|
"refdata": @inc=http://@env{CONFIG_SERVICE}/refdata/refdata
|
|
, "comm": @inc=http://@env{CONFIG_SERVICE}/apps/common/comm
|
|
, "comm_settings": "/comm/pubsub/redis/cloud17"
|
|
# , "cvttcomm": {
|
|
# "type": "redis"
|
|
# # , "comm_settings": "/comm/pubsub/redis/localhost"
|
|
# , "comm_settings": "/comm/pubsub/redis/cloud17"
|
|
# }
|
|
, "session_type": "PERMANENT"
|
|
, "books": {
|
|
"CVTT_BK01": {}
|
|
}
|
|
###### N E W S E C T I O N (example)
|
|
, "simulation": {
|
|
"speed_factor": 0.0,
|
|
"time_events_interval_ms": 100
|
|
}
|
|
, "market_simulator" : {
|
|
"market_data": {
|
|
"sources": [
|
|
{
|
|
"loader_class": "cvttpy.research.time_series.loaders.tsdb_loader.TimescaleTSLoader"
|
|
, "credentials_key": "TSDB_MD_CVTTDATA_RO"
|
|
# , "interval": "4 hours"
|
|
, "interval": "2 hours"
|
|
, "from_time": "2024-04-15 09:00:00"
|
|
}
|
|
# , {
|
|
# "loader_class": "cvttpy.research.time_series.loaders.sqlite_loader.SqliteMdLoader",
|
|
# "file_name": "${SourcePath}/20240424.ALPACA.QAT.db"
|
|
# }
|
|
]
|
|
}
|
|
, "accounting": {
|
|
"initial_positions": {
|
|
"COINBASE": {
|
|
"BTC": 0
|
|
, "USD": 1000.0
|
|
}
|
|
}
|
|
}
|
|
, "order_entry": {
|
|
"execution": {
|
|
"top_only": true
|
|
,"min_order_age_sec": 0.1
|
|
, "pricing_method": "BY_MKT_TRD_PRICE_BY_ORDER"
|
|
# , "presubscribe_md_types": ["BOOK_TOP", "TRADES"]
|
|
}
|
|
}
|
|
}
|
|
###### N E W S E C T I O N - end
|
|
, "backtest": {
|
|
"exchanges_settings": {
|
|
"*": {
|
|
"mkt_data": {
|
|
"enabled": true
|
|
, "streaming": true
|
|
}
|
|
,"order_entry": {
|
|
"enabled": true
|
|
, "streaming": true
|
|
}
|
|
,"accounting": {
|
|
"enabled": true
|
|
, "streaming": false
|
|
}
|
|
}
|
|
}
|
|
, "source": {
|
|
"database": {
|
|
"class": "cvttpy.tools.db.timescale.tsdb_client.TimescaleDbClient"
|
|
, "credentials_key": "TSDB_MD_CVTTDATA_RO"
|
|
}
|
|
# , "interval": "4 hours"
|
|
, "interval": "6 hours"
|
|
, "from_time": "2024-04-01 09:00:00"
|
|
}
|
|
, "initial_positions": {
|
|
"COINBASE": {
|
|
"BTC": 0
|
|
, "USD": 1000.0
|
|
}
|
|
}
|
|
, "simulation": {
|
|
"speed_factor": 0.0
|
|
}
|
|
, "execution": {
|
|
"top_only": true
|
|
,"min_order_age_sec": 0.1
|
|
, "pricing_method": "BY_MKT_TRD_PRICE_BY_ORDER"
|
|
# , "presubscribe_md_types": ["BOOK_TOP", "TRADES"]
|
|
}
|
|
, "result": {
|
|
"repository": "${ResultPath}/backtest_results.json"
|
|
, "db_file": "${ResultPath}/%T.backtest.db"
|
|
}
|
|
}
|
|
# --------------------------------------------------------------------
|
|
, "trader": {
|
|
"app_channel": "TRDR" active_exchanges_: str
|
|
|
|
, "is_short_allowed": false
|
|
, "exchanges_settings": {
|
|
"COINBASE_AT": {
|
|
"mkt_data": {
|
|
"enabled": true
|
|
, "streaming": true
|
|
},
|
|
}
|
|
}
|
|
, "algos": {
|
|
"TRDALGO_001": {
|
|
"class": "cvttpy.trading.algos.simple.SimpleTradingAlgo"
|
|
, "params": {}
|
|
}
|
|
, "TRDALGO_MOOMOC_01": {
|
|
"class": "cvttpy.trading.algos.moo_moc.MooMocTradingAlgo"
|
|
, "params": {
|
|
},
|
|
}
|
|
, "TRDALGO_TWAP01": {
|
|
"class": "cvttpy.trading.algos.twap.BasicTwapAlgo"
|
|
, "params": {
|
|
"num_slices": 5
|
|
, "duration_sec": 1500 # 25 min
|
|
, "max_order_usd": 100
|
|
, "passive_stage_t1": 0.4 # join BBO, the rest is aggressive
|
|
, "aggressive_stage_t2": 0.4
|
|
, "aggressivity_scale": [0.5, 1.0] # 0.5 = mid, 1.0= BBO-1 tick
|
|
, "marketable_stage_added_ticks": 0
|
|
},
|
|
}
|
|
, "TRDALGO_ICEBERG01": {
|
|
"class": "cvttpy.trading.algos.twap.BasicTwapAlgo"
|
|
, "params": {
|
|
"num_slices": 5
|
|
, "duration_sec": 1500 # 25 min
|
|
, "max_order_usd": 100
|
|
, "passive_stage_t1": 0
|
|
, "aggressive_stage_t2": 0
|
|
, "aggressivity_scale": [0.5, 1.0] # 0.5 = mid, 1.0= BBO-1 tick
|
|
, "marketable_stage_added_ticks": 0
|
|
},
|
|
}
|
|
}
|
|
, "trading_pos_diff_pct_trigger": 10.0
|
|
, "trading_depth": {
|
|
"BTC": 0.001
|
|
# "BTC": 0.1
|
|
}
|
|
}
|
|
# --------------------------------------------------------------------
|
|
"executor": {
|
|
"app_channel": "EXEC"
|
|
, "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"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
# --------------------------------------------------------------------
|
|
, "quant": {
|
|
"app_channel": "QUANT"
|
|
, "strategies": @inc=http://@env{CONFIG_SERVICE}/apps/common/strategies
|
|
, "exchanges_settings": {
|
|
"COINBASE_AT": {
|
|
"mkt_data": {
|
|
"enabled": true
|
|
, "streaming": true
|
|
},
|
|
}
|
|
}
|
|
}
|
|
# --------------------------------------------------------------------
|
|
, "risk_manager": {
|
|
"app_channel": "RMGR"
|
|
, "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": {
|
|
"COINBASE_AT": {
|
|
"mkt_data": {
|
|
"enabled": true
|
|
, "streaming": true
|
|
},
|
|
"accounting": {
|
|
"enabled": true
|
|
, "streaming": false
|
|
}
|
|
, "credentials_key": {
|
|
"trade": "COINBASE_ADV"
|
|
, "read_only": "COINBASE_ADV_RO"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
, "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/cvtt_backtest.db"
|
|
}
|
|
}
|
|
}
|
|
|