NinjaScript > Language Reference > Strategy > ATM Strategy Methods >

GetAtmStrategyPositionQuantity()

Print this Topic Previous pageReturn to chapter overviewNext page

Definition
Gets the current position quantity 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

An int value representing the quantity.

 

Syntax

GetAtmStrategyPositionQuantity(string AtmStrategyId)

 

Parameters

AtmStrategyId

The unique identifier for the ATM strategy

 

 

Examples

protected override void OnBarUpdate()
{
    // Check if flat
    if (GetAtmStrategyMarketPosition("idValue") != MarketPosition.Flat)
         Print("Position size is " + GetAtmStrategyPositionQuantity("id").ToString());
}