How to correctly subscribe/request and cache the aggregation bars? #2458
Unanswered
chungichien0923
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Backtesting
In backtesting, I follow the example_03 to subscribe bars
When I use
self.cache.bars(self.config.bar_type_1m)
, it works.But when I use
self.cache.bars(self.config.bar_type_1d)
, it get nothing, until I add .standard() to bar_type_1dself.cache.bars(self.config.bar_type_1d.standard())
Sandbox
In sandbox, I request and subscribe bars(through IB) using code like the following:
Use
self.cache.bars(self.config.bar_type_1d)
, the 1d bars returned are not aggregating from 1m bars(which is what I want), but simply daily bars in IB(which is not what I want), seems like the aggregation doesn't work at all.But use
self.cache.bars(self.config.bar_type_1d.standard())
getting nothing.(Besides, if I run more than 1 day, 1d bars cache won't get updated, though I expect it would.)
Also, it usually pops messege like "2025-03-18T18:30:51.188015000Z [WARN] SANDBOX-001.DataEngine: Bar QQQ.ISLAND-1-MINUTE-LAST-EXTERNAL,474.72,475.13,474.72,475.13,3210,1742322600000000000 was prior to last bar
ts_init
1742322660000000000" when the requested bars loading, does it normal?Beta Was this translation helpful? Give feedback.
All reactions