IPosition
Previous Topic  Next Topic 

Definition
Represents a read only interface that exposes information regarding a position and is passed as a parameter in the OnPositionUpdate() method.


Methods and Properties

AvgPrice

A double value representing the average price of a position

Instrument

An Instrument value representing the instrument of a position

MarketPosition

Possible values are:


MarketPosition.Flat

MarketPosition.Long

MarketPosition.Short

Quantity

An int value representing quantity of a position

ToString()

A string representation of a position


Examples

protected override void OnPositionUpdate(IPosition position)
{
    if (position.MarketPosition == MarketPosition.Flat)
    {
        // Do something like reset some variables here
    }
}