I have been experimenting today with the OnMarketData code below. The code prints to the output window with no problems but I'm not sure how to save the most recent Last, Ask and Bid data as a variable, which is what I want to try doing.
protected override void OnMarketData(MarketDataEventArgs e) { // Print some data to the Output window if (e.MarketDataType == MarketDataType.Last) Print("Last = " + e.Price + " " + e.Volume); else if (e.MarketDataType == MarketDataType.Ask) Print("Ask = " + e.Price + " " + e.Volume); else if (e.MarketDataType == MarketDataType.Bid) Print("Bid = " + e.Price + " " + e.Volume); }
A small explanation would be very much appreciated.
Regards,
suprsnipes
Comment