NinjaScript > Language Reference > Strategy > ATM Strategy Methods >

GetAtmStrategyMarketPosition()

Print this Topic Previous pageReturn to chapter overviewNext page

Definition
Gets the current market position of the specified ATM Strategy.

 

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

 

Method Return Value

MarketPosition.Flat

MarketPosition.Long

MarketPosition.Short

 

Syntax

GetAtmStrategyMarketPosition(string AtmStrategyId)

 

Parameters

AtmStrategyId

The unique identifier for the ATM strategy

 

 

Examples

protected override void OnBarUpdate()
{

    // Check if flat
    if (GetAtmStrategyMarketPosition("id") == MarketPosition.Flat)

         Print("ATM Strategy position is currently flat");
}