Example would be I enter a trade and I want my stop loss set at 1x ATR away from my entry and my profit target set 2x ATR away.
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Using indicator value to create stop loss/profit target upon order entry
Collapse
X
-
Using indicator value to create stop loss/profit target upon order entry
Is there a way to build a strategy (either ATM or Ninjascript) that would take into account an indicator value (say, the ATR) and use that for stop loss/profit targets?
Example would be I enter a trade and I want my stop loss set at 1x ATR away from my entry and my profit target set 2x ATR away.Tags: None
-
Hi jpietkewicz, thanks for posting and welcome to the NinjaTrader forums.
A fully automated strategy will need to be made to use the ATR value. You can use the strategy builder to add a parabolic stop, which is similar to an ATR stop, or you can make an unlocked script that uses indicator data explicitly e.g.
if(<Entry Condition>)
{
SetStopLoss(CalculationMode.Price, Low[0] - ATR(20)[0])
EnterLong(1);
}
Best regards,
-ChrisL
-
Thank you ChrisL that makes sense. Is there a way to do this where I put in my order entry from Chart Trader or SuperDOM? Like <Entry Condition> being OnClick() in a GUI application kind of thing if that makes sense?
Comment
-
Hi jpietkewicz, thanks for your reply.
You can add buttons to your chart through the strategy and submit orders on the button click event. Make sure to use TriggerCustomEvent when inside the click event.
Alternatively, you can go with an Addon style Account object. I attached an example to this post for reference. To test it out, place the .cs file within Documents\NinjaTrader 8\bin\Custom\Indicators and compile.
Best regards,
-ChrisL
Attached Files
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
580 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
335 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
101 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
554 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
552 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment