This commit is contained in:
Cryptoval Trading Technologies 2024-05-10 03:05:20 +01:00
parent 7a173c54fb
commit 5b7680f25a
6 changed files with 46 additions and 90 deletions

View File

@ -1,6 +1,6 @@
@var CONFIG_SVC_HOST=cloud16.cvtt.vpn @var CONFIG_SVC_HOST=cloud16.cvtt.vpn
@var ResultPath=/tmp @var ResultPath=/tmp
@var SourcePath=/home/oleg/develop/cvtt2/tmp
{ {
"refdata": @inc=http://${CONFIG_SVC_HOST}:6789/refdata/refdata "refdata": @inc=http://${CONFIG_SVC_HOST}:6789/refdata/refdata
, "redis": @inc=http://${CONFIG_SVC_HOST}:6789/apps/common/redis , "redis": @inc=http://${CONFIG_SVC_HOST}:6789/apps/common/redis
@ -14,38 +14,15 @@
] ]
} }
, "backtest": { , "backtest": {
"exchanges_settings": { "source": {
"*": { "loader_class": "cvttpy.research.time_series.loaders.sqlite_loader.SqliteMdLoader"
"mkt_data": { , "file_name": "${SourcePath}/20240424.ALPACA.QAT.db"
"enabled": true # , "from_time": "09:29"
, "streaming": true
}
,"order_entry": {
"enabled": true
, "streaming": true
}
,"accounting": {
"enabled": true
, "streaming": false
}
}
} }
, "source": { , "result": {
"database": { # "repository": "${ResultPath}/backtest_results.json"
"class": "cvttpy.tools.db.sqlite.sqlite_client.SqliteClient" "db_file": "${ResultPath}/%D.backtest.db"
, "file_name": "aaa"
}
, "from_time": {
"BUY": "09:29"
"SELL": "15:30"
}
} }
# , "initial_positions": {
# "COINBASE": {
# "BTC": 0
# , "USD": 1000.0
# }
# }
, "simulation": { , "simulation": {
"speed_factor": 0.0 "speed_factor": 0.0
} }
@ -54,13 +31,9 @@
,"min_order_age_sec": 0.1 ,"min_order_age_sec": 0.1
, "pricing_method": "BY_MKT_TRD_PRICE_BY_ORDER" , "pricing_method": "BY_MKT_TRD_PRICE_BY_ORDER"
} }
, "result": {
"repository": "${ResultPath}/backtest_results.json"
, "db_file": "${ResultPath}/%T.backtest.db"
}
} }
, "exchanges_settings": { , "exchanges_settings": {
"ALPACA_SNDBX-MDPORTAL": { "*": {
"order_entry": { "order_entry": {
"enabled": true "enabled": true
, "streaming": true , "streaming": true
@ -73,46 +46,6 @@
"enabled": false "enabled": false
, "streaming": false , "streaming": false
} }
, "credentials_key": {
"read_only": "ALPACA_SANDBOX"
, "trade": "ALPACA_SANDBOX"
}
}
, "ALPACA_SNDBX-MDP-03": {
"order_entry": {
"enabled": true
, "streaming": true
},
"mkt_data": {
"enabled": true
, "streaming": true
},
"accounting": {
"enabled": false
, "streaming": false
}
, "credentials_key": {
"read_only": "ALPACA_SANDBOX"
, "trade": "ALPACA_SANDBOX"
}
}
, "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"
}
} }
} }
} }

View File

@ -24,12 +24,13 @@
"class": "cvttpy.trading.algos.twap.TwapAlgo" "class": "cvttpy.trading.algos.twap.TwapAlgo"
, "params": { , "params": {
"num_slices": 5 "num_slices": 5
, "duration_sec": 1500 # 25 min , "duration_sec": 1500 # 25 min #overloaded by --duration
, "max_order_usd": 100. , "max_order_usd": 100.
, "passive_stage_t1": 0 , "passive_stage_t1": 0
, "aggressive_stage_t2": 0 , "aggressive_stage_t2": 0
, "aggressivity_scale": [0.5, 1.0] # 0.5 = mid, 1.0= BBO-1 tick # , "aggressivity_scale": [0.5, 1.0] # 0.5 = mid, 1.0= BBO-1 tick
, "marketable_stage_added_ticks": 0 , "marketable_stage_added_ticks": 0
, "advance_on_slice_full_fill": true # default true
}, },
} }
, "TRDALGO_ICEBERG01_ALPACA": { , "TRDALGO_ICEBERG01_ALPACA": {

View File

@ -10,9 +10,10 @@
, "params": { , "params": {
"vwap_interval": "1 hour" "vwap_interval": "1 hour"
, "hist_md_source": { , "hist_md_source": {
"class": "cvttpy.tools.db.timescale.tsdb_client.TimescaleDbClient" "loader_class": "cvttpy.research.time_series.loaders.tsdb_loader.TsMdLoader"
, "cred_key": "TSDB_MD_CVTTDATA_RO" , "credentials_key": "TSDB_MD_CVTTDATA_RO"
, "data_type": "OHLCV" , "interval": "2 hours"
#, "from_time" is calculated
} }
} }
} }

View File

@ -31,10 +31,8 @@
} }
} }
, "source": { , "source": {
"database": { "loader_class": "cvttpy.research.time_series.loaders.tsdb_loader.TimescaleTSLoader"
"class": "cvttpy.tools.db.timescale.tsdb_client.TimescaleDbClient" , "credentials_key": "TSDB_MD_CVTTDATA_RO"
, "credentials_key": "TSDB_MD_CVTTDATA_RO"
}
# , "interval": "4 hours" # , "interval": "4 hours"
, "interval": "2 hours" , "interval": "2 hours"
, "from_time": "2024-04-15 09:00:00" , "from_time": "2024-04-15 09:00:00"

View File

@ -22,13 +22,13 @@
"tables": ["bnbfut.md_booktops"] "tables": ["bnbfut.md_booktops"]
, "exchange_id": "BNBFUT" , "exchange_id": "BNBFUT"
, "instruments": ["PERP-BTC-USDT"] , "instruments": ["PERP-BTC-USDT"]
, "threshold_sec": 15.0 , "threshold_sec": 30.0
} }
, "BNBFUT-2": { , "BNBFUT-2": {
"tables": ["bnbfut.md_trades"] "tables": ["bnbfut.md_trades"]
, "exchange_id": "BNBFUT" , "exchange_id": "BNBFUT"
, "instruments": ["PERP-BTC-USDT"] , "instruments": ["PERP-BTC-USDT"]
, "threshold_sec": 15.0 , "threshold_sec": 30.0
} }
, "BNBSPOT-1": { , "BNBSPOT-1": {
"tables": ["bnbspot.md_booktops"] "tables": ["bnbspot.md_booktops"]
@ -46,13 +46,13 @@
"tables": ["coinbase.md_booktops"] "tables": ["coinbase.md_booktops"]
, "exchange_id": "COINBASE" , "exchange_id": "COINBASE"
, "instruments": ["PAIR-BTC-USD"] , "instruments": ["PAIR-BTC-USD"]
, "threshold_sec": 15.0 , "threshold_sec": 30.0
} }
, "COINBASE-2": { , "COINBASE-2": {
"tables": ["coinbase.md_trades"] "tables": ["coinbase.md_trades"]
, "exchange_id": "COINBASE" , "exchange_id": "COINBASE"
, "instruments": ["PAIR-BTC-USD"] , "instruments": ["PAIR-BTC-USD"]
, "threshold_sec": 15.0 , "threshold_sec": 30.0
} }
} }
} }

View File

@ -0,0 +1,23 @@
@var CONFIG_SVC_HOST=cloud16.cvtt.vpn
{
"refdata": @inc=http://${CONFIG_SVC_HOST}:6789/refdata/refdata
, "calendar_session": {
"trading_hours_url": [
"GET"
, "http://cloud16.cvtt.vpn:8000/api/v1/markets/hours?mic=XNYS&start={start}&end={end}"
]
}
, "exchanges_settings": {
"*": {
"mkt_data": {
"enabled": true
, "streaming": true
},
}
}
, "cvttcomm": {
"type": "redis"
, "redis_settings": "localhost"
}
}