AtmStrategyCreate()
<< Click to Display Table of Contents >> AtmStrategyCreate() |
Submits an entry order that will execute a specified ATM Strategy.
Notes:
•Please review the section on using ATM Strategies •This method is NOT backtestable and will NOT execute on historical data •See the AtmStrategyCancelEntryOrder() to cancel an entry order •See the AtmStrategyChangeEntryOrder() to change the price of the entry order •The ATM Strategy will be created asyncronous on the hosting NinjaScripts UI Thread, a callback is provided solely to check when the ATM Strategy is started on that thread - accessing for example price data in that outside OnBarUpdate() context is not possible. •Please see the SampleATMStrategy build into NinjaTrader for example usage. |
This method does not return a value
AtmStrategyCreate(OrderAction action, OrderType orderType, double limitPrice, double stopPrice, TimeInForce timeInForce, string orderId, string strategyTemplateName, string atmStrategyId, Action<Cbi.ErrorCode, string> callback)
action |
Sets if the entry order is a buy or sell order
Possible values are:
•OrderAction.Buy •OrderAction.Sell |
orderType |
Sets the order type of the entry order
Possible values are:
•OrderType.Limit •OrderType.Market •OrderType.MIT •OrderType.StopMarket •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 |
callback |
The callback action is used to check that the ATM Strategy is successfully started |
Tip: Unlike NinjaScript Strategy orders (both managed and unmanaged), ATM strategies generated by the AtmStrategyCreate() method can then be managed manually by any order entry window such as the SuperDOM or within your NinjaScript strategy. |
private string atmStrategyId; |