protected override void OnBarUpdate()
{
Print(Time[0] + " OnBarUpdate Print: " + OMDPrice);
}
protected override void OnMarketData(MarketDataEventArgs marketDataUpdate)
{
OMDPrice = marketDataUpdate.Price;
if (marketDataUpdate.MarketDataType == MarketDataType.Last)
Print(marketDataUpdate.Time + " OMD Last = " + OMDPrice + " @ " + marketDataUpdate.Volume);
else if (marketDataUpdate.MarketDataType == MarketDataType.Ask)
Print(marketDataUpdate.Time + " Ask = " + marketDataUpdate.Price + " @ " + marketDataUpdate.Volume);
else if (marketDataUpdate.MarketDataType == MarketDataType.Bid)
Print(marketDataUpdate.Time + " Bid = " + marketDataUpdate.Price + " @ " + marketDataUpdate.Volume);
}
11/18/2019 11:02:19 PM Bid = 3124 @ 25
11/18/2019 11:02:19 PM Bid = 3124 @ 24
11/18/2019 11:03:00 PM OnBarUpdate Print: 3124
11/18/2019 11:03:00 PM OnBarUpdate Print: 3124
11/18/2019 11:02:19 PM OMD Last = 3124 @ 1
11/18/2019 11:03:00 PM OnBarUpdate Print: 0
11/18/2019 11:03:00 PM OnBarUpdate Print: 0
11/18/2019 11:02:19 PM OMD Last = 3124 @ 1
11/18/2019 11:02:19 PM Bid = 3124 @ 22
11/18/2019 11:02:19 PM Bid = 3124 @ 21

Comment