OnMarketData()

<< Click to Display Table of Contents >>

Navigation:  NinjaScript > Language Reference > SuperDOM Column >

OnMarketData()

Previous page Return to chapter overview Next page

Definition

Called and guaranteed to be in the correct sequence for every change in level one market data for the underlying instrument. The OnMarketData() method updates can include but is not limited to the bid, ask, last price and volume.

 

Method Return Value

This method does not return a value.

 

Syntax

protected override void OnMarketData(MarketDataEventArgs marketDataUpdate)
{
 
}

 

Parameters

marketDataUpdate

A MarketDataEventArgs representing the change in market data

 

 

Examples

ns


protected override void OnMarketData(MarketDataEventArgs marketDataUpdate)
{
  if (marketDataUpdate.MarketDataType == Data.MarketDataType.Last)
  {
    // Do something
  }
}