Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Targets and stops based on ATR
Collapse
X
-
Targets and stops based on ATR
Looking for any info on how to create within my strategy targets and stops based on the current a ATR. Any help would be great. Example: current ATR is 1, Target 1, 1.5X ATR T2, 2.5X current ATR, Initial stop 2.5X current ATR. ThxTags: None
- Likes 2
-
Hi JTizz,
I learned a lot from example code in the link, doing something similar to what you describe. The example code sets initial stops and targets, and adjust the stop to break even once a certain profit is hit.
Maybe adjust some of the code as follows:
stopOrder = ExitLongStopMarket(0, true, execution.Order.Filled, (Instrument.MasterInstrument.RoundToTickSize(Close[0 ] - 2.5 * ATR[0])), "MyStop", "MyEntry");
targetOrder = ExitLongLimit(0, true, execution.Order.Filled, (Instrument.MasterInstrument.RoundToTickSize(Close[0] + 1.5 * ATR[0])), "MyTarget", "MyEntry");
-
Hello JTizz, thanks for your question.
There is this ATRTrailing indicator:
https://ninjatraderecosystem.com/user-app-share-download/atrtrailing/
medge's suggestion is also agreeable. The order entry methods have a Price parameter that you would target with the ATR value.
Please let me know if I can assist any further.
Comment
-
Hello JTizz, thanks for your post.
If you want to set a stop loss on a value and leave it there, call SetStopLoss once with the desired ATR value, or call one of the Exit methods once with the desired ATR value.
Here is related documentation and an example:
https://ninjatrader.com/support/help...and_onexec.htm
https://ninjatrader.com/support/help...etstoploss.htm
Please let me know if I can assist any further.
Comment
-
How do you build this on Strategy Builder?
stopOrder = ExitLongStopMarket(0, true, execution.Order.Filled, (Instrument.MasterInstrument.RoundToTickSize(Close[0 ] - 2.5 * ATR[0])), "MyStop", "MyEntry");
targetOrder = ExitLongLimit(0, true, execution.Order.Filled, (Instrument.MasterInstrument.RoundToTickSize(Close[0] + 1.5 * ATR[0])), "MyTarget", "MyEntry");
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Mindset, 04-21-2026, 06:46 AM
|
0 responses
87 views
0 likes
|
Last Post
by Mindset
04-21-2026, 06:46 AM
|
||
|
Started by M4ndoo, 04-20-2026, 05:21 PM
|
0 responses
132 views
0 likes
|
Last Post
by M4ndoo
04-20-2026, 05:21 PM
|
||
|
Started by M4ndoo, 04-19-2026, 05:54 PM
|
0 responses
68 views
0 likes
|
Last Post
by M4ndoo
04-19-2026, 05:54 PM
|
||
|
Started by cmoran13, 04-16-2026, 01:02 PM
|
0 responses
118 views
0 likes
|
Last Post
by cmoran13
04-16-2026, 01:02 PM
|
||
|
Started by PaulMohn, 04-10-2026, 11:11 AM
|
0 responses
67 views
0 likes
|
Last Post
by PaulMohn
04-10-2026, 11:11 AM
|

Comment