GetAtmStrategyMarketPosition()

View as Markdown

Definition

Gets the current market position of the specified ATM Strategy.

Notes:

  1. Changes to positions will not be reflected till at least the next OnBarUpdate() event after an order fill.
  2. If the ATM Strategy does not exist then MarketPosition.Flat returns.
  3. Please note this provides access to the current ATM strategy position, which should not be confused with the NinjaScript strategy position or account position. For more information please see the Using ATM Strategies section.

Method Return Value

  • MarketPosition.Flat
  • MarketPosition.Long
  • MarketPosition.Short

Syntax

GetAtmStrategyMarketPosition(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("ATM Strategy position is currently flat");
6}