Instrument

<< Click to Display Table of Contents >>

Navigation:  NinjaScript > Language Reference > Strategy > Position >

Instrument

Previous page Return to chapter overview Next page

Definition

Gets the instrument of a strategy position.

 

Property Value

An Instrument representing the position's instrument.

 

Syntax

Position.Instrument

 

 

Examples

ns


protected override void OnPositionUpdate(Position position, double averagePrice, int quantity, MarketPosition marketPosition)
{
    // If the position is an AAPL position
    if (position.Instrument.MasterInstrument.Name == "AAPL")
  {
        //do something  
  }
}