@var CONFIG_SERVICE=cloud23.cvtt.vpn:6789 @var DATA_DIR=/home/coder/project/data @var MD_WS_PORT=10180 @var OE_WS_PORT=10181 @var OE_REST_PORT=10182 @var ACCT_REST_PORT=10083 @var DATE=20241114 @var FROM_TIME=13:30 @var TO_TIME=20:00 { "refdata": @inc=http://${CONFIG_SERVICE}/refdata/refdata , "comm": @inc=http://${CONFIG_SERVICE}/apps/common/comm , "comm": @inc=http://${CONFIG_SERVICE}/apps/common/comm , "comm_settings": "/comm/pubsub/redis/localhost" , "simulation": { "speed_factor": 0.0, # "speed_factor": 1000.0, "time_events_interval_ms": 0 } , "market_simulator" : { "initial_positions": { "exchange": "ALPACA", "assets": { "BTC": 0.5 , "ETH": 0.0 , "USD": 10_000.0 } } , "market_data": { "sources": [ { "loader_class": "cvttpy.trading.mkt_data.time_series.loaders.sqlite_loader.SqliteMdLoader" , "file_name": "${DATA_DIR}/eqt/${DATE}.alpaca_sim_md.db" , "exchange_id": "ALPACA" , "instruments": ["STOCK-COIN", "STOCK-CAN"] , "md_types": { "TRADES": { "table_name": "md_trades" , "columns": [ "tstamp" , "tstamp_ns as tm" # required column , "tstamp_ns as exchange_ts_ns" , "tstamp_ns as local_time_ns" , "exchange_id" , "instrument_id" , "exch as exchange_code" , "px as price" , "qty as quantity" , "'' as taker_side" # get from condition (?) , "trade_id" , "condition" , "tape" ] , "time_column": "tstamp" , "from_time": "${FROM_TIME}" , "to_time": "${TO_TIME}" } , "BOOK_TOP": { "table_name": "md_quotes" , "columns": [ "tstamp" , "tstamp_ns as tm" # required column , "tstamp_ns as local_time_ns" , "exchange_id" , "instrument_id" , "bid_exch as bid_exchange_code" , "ask_exch as ask_exchange_code" , "bid_px as bid_price" , "bid_qty as bid_quantity" , "ask_px as ask_price" , "ask_qty as ask_quantity" ] , "time_column": "tstamp" , "from_time": "${FROM_TIME}" , "to_time": "${TO_TIME}" } # , "HIST_BAR": { # "table_name": "md_1min_bars" # , "columns": [ # "tstamp" # , "tstamp_ns as tm" # must have tm for DataFrame # , "tstamp_ns as local_time_ns" # must have for simrunner # , "exchange_id" # , "instrument_id" # , "open" # , "high" # , "low" # , "close" # , "volume" # , "vwap" # , "num_trades" # ] # , "time_column": "tstamp" # } } } ] , "api": { "web_socket": { "url": "ws://localhost:${MD_WS_PORT}/ws" } } } , "order_entry": { "execution": { "execute_on": ["BOOK_TOP", "TRADES"] "top_only": true ,"min_order_age_sec": 0.1 , "pricing_method": "BY_MKT_TRD_PRICE_BY_TRADE" , "short_sale_allowed": false , "fee_schedule": { # ALPACA - "taker_fee_rate": 0.0 "maker_fee_rate": 0.0 } # , "presubscribe_md_types": ["BOOK_TOP", "TRADES"] } , "api": { "web_socket": { "url": "ws://localhost:${OE_WS_PORT}/ws" } , "REST": { "port": ${OE_REST_PORT} "new_order_url": ["POST", "http://localhost:${OE_REST_PORT}/order"] , "cancel_order_url": ["POST", "http://localhost:${OE_REST_PORT}/cancel"] , "cancel_all_url": ["POST", "http://localhost:${OE_REST_PORT}/cancel_all"] , "open_orders_url": ["GET", "http://localhost:${OE_REST_PORT}/open_orders"] , "order_status_url": ["GET", "http://localhost:${OE_REST_PORT}/order_status"] } } } , "accounting": { "api": { "REST": { "port": ${ACCT_REST_PORT} , "positions_url": ["GET", "http://localhost:${ACCT_REST_PORT}/positions"] , "trades_url": ["GET", "http://localhost:${ACCT_REST_PORT}/trades"] } } } } }