Position

Object that reveals information about a current open position of the strategy.

Properties

Name

Type

Description

InPosition

bool

Returns true if the strategy is in position, false otherwise.

PositionType

StrategyPositionType?

If the strategy is in position, it returns StrategyPositionType enum which can be Long or Short. If it is not in position, the PositionType is null.

ExecutedPrice

double?

Returns the price of the asset at which the position was opened. If the strategy is not in an open position, it returns null.

ExecutedTime

datetime?

Time when the position was opened. If the strategy is not in an open position, it returns null.

// If strategy is in position then log position details
if (Position.InPosition)
{
    Log("Open position: " + Position.PositionType + ", " + Position.ExecutedTime + ", " + Position.ExecutedPrice);
}

Last updated