Instrument

<< Click to Display Table of Contents >>

Navigation:  NinjaScript > Language Reference > Strategy > PositionAccount >

Instrument

Previous page Return to chapter overview Next page

Definition

Gets the instrument of an account position.

 

Property Value

An Instrument representing the account's instrument position

 

Syntax

PositionAccount.Instrument

 

 

Examples

ns

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