AtmStrategyCreate()
Previous Topic  Next Topic 

Definition
Submits an entry order that will execute the specified ATM Strategy that can then be managed manually by any order entry window such as the SuperDOM or within your NinjaScript strategy.



Method Return Value

Returns true if the specified ATM strategy was created and no errors were generated.


Syntax

AtmStrategyCreate(Action action, OrderType orderType, double limitPrice, double  stopPrice, TimeInForce timeInForce, string orderId, string strategyTemplateName, string AtmStrategyId)

Parameters

action

Sets if the entry order is a buy or sell order. Possible values are:

Action.Buy

Action.Sell

orderType

Sets the order type of the entry order. Possible values are:

OrderType.Limit
OrderType.Market
OrderType.Stop
OrderType.StopLimit

limitPrice

The limit price of the order

stopPrice

The stop price of the order

timeInForce

Sets the time in force of the entry order. Possible values are:

TimeInForce.Day

TimeInForce.Gtc

orderId

The unique identifier for the entry order

strategyTemplateName

Specifies which strategy template will be used

AtmStrategyId

The unique identifier for the ATM strategy


Examples

protected override void OnBarUpdate()
{
    if (Historical)
        return;
   
    // Check for valid condition and create an ATM Strategy
    if (Close[0] > SMA(20)[0])
        AtmStrategyCreate(Action.Buy, OrderType.Market, 0, 0,
          TimeInForce.Day, GetAtmStrategyUniqueId(), "MyTemplate",
          GetAtmStrategyUniqueId());
}