something is not working here... OnBarUpdate prints correctly to the output window for the primary series and BarIndex 1 (MarketDataType.Last), but not for the BarIndex 2 (MarketDataType.Bid) and 3 (MarketDataType.Ask).
Any idea why? I have a feeling that the bid/ask series might be empty, if so why? I use IQFeed as a data provider.
Thx, Chris
protected override void Initialize() { CalculateOnBarClose = false; Overlay = true; Add(Instrument.FullName, PeriodType.Tick, 1, MarketDataType.Last); Add(Instrument.FullName, PeriodType.Tick, 1, MarketDataType.Bid); Add(Instrument.FullName, PeriodType.Tick, 1, MarketDataType.Ask); ClearOutputWindow(); } protected override void OnBarUpdate() { if(BarsInProgress == 0) { } else if(BarsInProgress == 1) { Print("Last: " + Close[0]); } else if(BarsInProgress == 2) { Print("Bid: " + Close[0]); } else if(BarsInProgress == 3) { Print("Ask: " + Close[0]); } }
Comment