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
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
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,
-ChrisLChris L.NinjaTrader Customer Service
-
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 FilesChris L.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by ETFVoyageur, Yesterday, 07:05 PM
|
4 responses
30 views
0 likes
|
Last Post
by ETFVoyageur
Today, 06:16 PM
|
||
Started by JGriff5646, Yesterday, 10:02 PM
|
2 responses
21 views
0 likes
|
Last Post
by JGriff5646
Today, 06:15 PM
|
||
Started by DawnTreader, Today, 05:58 PM
|
0 responses
5 views
0 likes
|
Last Post
by DawnTreader
Today, 05:58 PM
|
||
Started by ntram, Today, 05:39 PM
|
0 responses
5 views
0 likes
|
Last Post
by ntram
Today, 05:39 PM
|
||
Started by giulyko00, Today, 11:49 AM
|
2 responses
12 views
0 likes
|
Last Post
by giulyko00
Today, 04:43 PM
|
Comment