GetAtmStrategyPositionQuantity()

<< Click to Display Table of Contents >>

Navigation:  NinjaScript > Language Reference > Strategy > ATM Strategy Methods >

GetAtmStrategyPositionQuantity()

Previous page Return to chapter overview Next 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

ns


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