Instrument

View as Markdown

Definition

Gets the instrument of a strategy position.

Property Value

An Instrument representing the position’s instrument.

Syntax

Position.Instrument

Examples

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