Can anybody tell me why my script showing OnMarketData volume twice ?
protected override void Initialize() { Overlay = false; Add(PeriodType.Tick, 1); } protected override void OnBarUpdate() { if (BarsInProgress == 0) return; } protected override void OnMarketData(MarketDataEventArgs e) { if (Historical) return; if (e.MarketDataType == MarketDataType.Last){ Print(this.BarsInProgress +"---- HIT LAST---"+FormatPriceMarker(e.Price)+" -> " + e.Volume); } }
in output window it show like this:
0---- HIT LAST---128.11 -> 5
0---- HIT LAST---128.11 -> 5
0---- HIT LAST---128.11 -> 1
0---- HIT LAST---128.11 -> 1
0---- HIT LAST---128.11 -> 6
0---- HIT LAST---128.11 -> 6
you see it flash twice same last price volume.
is there a bug when you using Add(PeriodType.Tick, 1); ?
i know variable BarsInProgress but its always 0.
Comment