Hello, I'm struggling to fully understand warmup of indicators for consolidator resolutions.
Does OnDataConsolidated not get updated during warmup phase? I have subscribed and registered standard indicators with consolidator and was expecting they they would get updated during the warmup phase but this does not seem to be happening.
simple backtest attached to demonstrate with log at end of warmup, or first datapoint on graph where the sma is same as close.
Can someone point me in the right direction?
Many thanks in advance.
Michael Manus
why not just use the self.Log comand to check that, like the lines above?
(add self.Log in OnDataConsolidated function too)
it should work as you described.
if you want to update it manually:
https://www.quantconnect.com/forum/discussion/3622/adx-ibasedatabar-forex/p1
Gkiwi
Thanks Michael,
Yes I could have checked differently.
I've tried putting a log statement inside the OnDataConsolidated and nothing is logged during warmup phase suggesting that this function is not triggered by self.SetWarmUp. Unless there is another 'thing' that I'm missing. This suprises me from my understanding reading documentation etc.
So I gues my only other option is to do via a self.History() request rather than rely on self.SetWarmUp.
Thanks.
Michael Manus
you are sure that you did:
def OnDataConsolidated(self,sender,bar):
self.Log("adsfadsf")
if not self.IsWarmingUp: self.consolidated5min = True
self.qprice.appendleft(bar.Close)
....
.......
because it says it is warming up and than finished BUT:
logs starting at 3.1.2019 00:05:
2018-12-29 00:01:00 Algorithm warming up...
2019-03-01 00:00:00 Algorithm finished warming up.
2019-03-01 00:05:00 adsfadsf
2019-03-01 00:10:00 adsfadsf
2019-03-01 00:15:00 adsfadsf
so it is called during warming up?
Link Liang
Hi Gkiwi,
In fact, use SetWarmUp(int32) instead of SetWarmUp(Timespan) would allows OnDataConsolidated() to be triggered during warmup phase.
In the backtest, I tried to use self.SetWarmUp(self.slowperiod+2) instead of self.SetWarmUp(timedelta(self.slowperiod+2)). Here is the log showing that data consolidator is triggered during warmup phase.
2019-03-01 00:00:00 Launching analysis for 32b43f0d40232f71a21a60d76832ddcd with LEAN Engine v2.4.0.0.5598 2019-02-28 22:59:00 Algorithm warming up... 2019-02-28 23:03:00 DataConsolidated 2019-02-28 23:08:00 DataConsolidated 2019-02-28 23:13:00 DataConsolidated 2019-02-28 23:18:00 DataConsolidated 2019-02-28 23:23:00 DataConsolidated 2019-02-28 23:28:00 DataConsolidated 2019-02-28 23:33:00 DataConsolidated 2019-02-28 23:38:00 DataConsolidated 2019-02-28 23:43:00 DataConsolidated 2019-02-28 23:48:00 DataConsolidated 2019-02-28 23:53:00 DataConsolidated 2019-02-28 23:58:00 DataConsolidated 2019-03-01 00:00:00 Algorithm finished warming up.
Notice that the warming up phase is 62 data entries BEFORE data consolidated, and since we are using minute level resolution, the warmup phase is expected to be 61 minutes.
Hope it helps!
Gkiwi
Thanks Link Liang,
Yes that worked and also explains why I was getting sometimes working, sometimes not. I had been moved to timedelta after seeing some posts in community search.
And also thanks to Michael Manus, his posts helped me work through parts of my issue..
Gkiwi
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
To unlock posting to the community forums please complete at least 30% of Boot Camp.
You can continue your Boot Camp training progress from the terminal. We hope to see you in the community soon!