GetAtmStrategyPositionAveragePrice()

View as Markdown

Definition

Gets the current position’s average price of the specified ATM Strategy.

Changes to positions will not be reflected till at least the next OnBarUpdate() event after an order fill.

Method Return Value

A double value representing the average price.

Syntax

GetAtmStrategyPositionAveragePrice(string atmStrategyId)

Parameters

ParameterDescription
atmStrategyIdThe unique identifier for the ATM strategy

Examples

1protected override void OnBarUpdate()
2{
3 // Check if flat
4 if (GetAtmStrategyMarketPosition("id") != MarketPosition.Flat)
5 Print("Average price is " + GetAtmStrategyPositionAveragePrice("id").ToString());
6}