Hi, my algorithm relies on an external source to deliver a list of securities for a certain day. The data is first vailable at around 9:15am on the trading day. When I have that data, I need all the premarket data from that day to warm up the indicators.
The problem is that the value of the indicator (say at 9:30am) is always different from the "correct" values that I'd get if I subscribed to the security at 12am that day.

Question:
Is this the correct way to warm up the indicator? If so, what am I doing wrong.

 

Thx!

 

AddEquity(symbol, resolution, Market.USA, true, 0M, true); var consolidator = Consolidate(symbol, consolidateTo, x => OnConsolidatedData(x)); History(new List<Symbol> { symbol }, triggerDay.Date, Time, resolution, false, true) .PushThroughConsolidators(c => consolidator); if (!_vwap.ContainsKey(symbol)) { var vwapPeriod = 240; var vwapIndicator = new VolumeWeightedAveragePriceIndicator($"VWAP({symbol})", vwapPeriod); RegisterIndicator(symbol, vwapIndicator, consolidator); _vwap.Add(symbol, vwapIndicator); // Warmup indicator var h = History<TradeBar>(symbol, Convert.ToInt32((Time-Time.Date).TotalSeconds), resolution); foreach (var item in h) vwapIndicator.Update(item); //WarmUpIndicator(symbol, vwapIndicator, resolution); }

 

Author