Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
Partner 728x90
Collapse
NinjaTrader
Move ATM Strategy stop order with indicator/price bars
Collapse
X
-
Move ATM Strategy stop order with indicator/price bars
If I have a strategy that is using an ATM strategy for order placement/management, can I add code to the strategy that will move the ATM stop order based on the movement of an indicator or follow a previous bars high/low? I realize that you can add an indicator to the DOM but that is very cumbersome, plus I'd like to have the stop follow the previous bars high/low in some instances. ThanksTags: None
-
Originally posted by NinjaTrader_ChelseaB View Post
AtmStrategyCreate(OrderAction.Buy, OrderType.Market, 0, 0, TimeInForce.Day, orderId, AtmStrategy, atmStrategyId, (atmCallbackErrorCode, atmCallBackId) => {
AtmStrategyChangeStopTarget(0, SMA(10)[0], "Stop1", "AtmIdValue");
Comment
-
Hello mlarocco,
You will want to ensure the price you are selecting is a valid price first. If the stop is a sell stop, this must be 1 tick below the bid, if the stop is a buy stop it must be 1 tick above the ask.
You will need to supply the actual atmStrategyId used in AtmStrategyCreate(). The string "AtmIdValue" is not correct. The example in the help guide is showing this as a placeholder of where whatever string you used for the atm Id would be used here.
"Stop1" would be correct.Chelsea B.NinjaTrader Customer Service
Comment
-
Originally posted by NinjaTrader_ChelseaB View PostHello mlarocco,
You will want to ensure the price you are selecting is a valid price first. If the stop is a sell stop, this must be 1 tick below the bid, if the stop is a buy stop it must be 1 tick above the ask.
You will need to supply the actual atmStrategyId used in AtmStrategyCreate(). The string "AtmIdValue" is not correct. The example in the help guide is showing this as a placeholder of where whatever string you used for the atm Id would be used here.
"Stop1" would be correct.
Comment
-
Originally posted by NinjaTrader_ChelseaB View Post
Comment
-
Hello mlarocco,
The documented and supported way is to create an enum drop-down of pre-defined indicators (that have plots).
Below is a link to the help guide reference sample.
https://ninjatrader.com/support/help...ned_parame.htm
The unsupported way would be to use reflection which our Engineering Support staff is not able to assist with. But this thread will remain open for any community members that would like to provide guidance.Chelsea B.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by geddyisodin, 04-25-2024, 05:20 AM
|
8 responses
61 views
0 likes
|
Last Post Yesterday, 10:45 AM | ||
Started by jxs_xrj, 01-12-2020, 09:49 AM
|
4 responses
3,288 views
1 like
|
Last Post
by jgualdronc
Today, 10:02 AM
|
||
Can someone turn this thinkscript into a ninjascript. 5PM CST OHL and Previous Day
by Option Whisperer
Started by Option Whisperer, Today, 09:55 AM
|
0 responses
5 views
0 likes
|
Last Post Today, 09:55 AM | ||
Started by halgo_boulder, 04-20-2024, 08:44 AM
|
2 responses
22 views
0 likes
|
Last Post Today, 09:41 AM | ||
Started by mishhh, 05-25-2010, 08:54 AM
|
19 responses
6,189 views
0 likes
|
Last Post
by rene69851
Today, 09:29 AM
|
Comment