-
Hi, 1583020803145000: trade#1 & open_interest#1 TRADES.csv
OPEN_INTEREST.csv
I tried clock.set_time_alert() but it run on real-time, therefore only allow alert_time > utc_now(). Thanks in advance! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Hey @OnlyC - it's actually much simpler than that - nautilus has first class support for "custom data". Simply create a
Then in your backtest code - add a parsing function that creates these objects from your raw csv data:
Then, you can simply add this data to your backtest engine as "generic_data", giving the
Then in your trading strategy - you simply subscribe to this data via the
The great thing about this approach is that if your live adapter emits this data in the same way (wrapped up as Let me know if you have any troubles or other questions |
Beta Was this translation helpful? Give feedback.
-
Base on @limx0 answer, I finally managed to done it. But, with a modification in next() function of BacktestDataProducer. I don't know if it's the error in the code or not. If I keep the original code, engine will push all on_data events at first, then all trade_ticks follow after, throw error because the clock already run to the end of Open Interest list. Original:
Modified: (added 1 line)
|
Beta Was this translation helpful? Give feedback.
Hey @OnlyC - it's actually much simpler than that - nautilus has first class support for "custom data".
Simply create a
Data
subclass to represent your data in your project:Then in your backtest code - add a parsing function that creates these objects from your raw csv data:
Then, you can simply add this data to …