MarketDataEventArgs
Previous Topic  Next Topic 

Definition
Represents a change in level one market data and is passed as a parameter in the OnMarketData() method.

Methods and Properties

MarketDataType

Possible values are:


MarketDataType.Ask

MarketDataType.Bid

MarketDataType.DailyHigh

MarketDataType.DailyLow

MarketDataType.DailyVolume

MarketDataType.Last

MarketDataType.LastClose (prior session close)

Price

A double value representing the price

Time

A DateTime structure representing the time

ToString()

A string representation of the MarketDataEventArgs object

Volume

An int value representing volume


Examples

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);
}


Tips
1. Not all connectivity providers support all MarketDataTypes.