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
How to set a fixed target and stop based on an indicator like say Moving Averages
Collapse
X
-
How to set a fixed target and stop based on an indicator like say Moving Averages
I would like to set my targets and stops based on the price level of indicators on my chart, using the strategy builder, all at the time of entry. However, I would like these to be fixed and not move to different prices with the passage of time. So if I enter a trade at time 0, set my target to the price of an indicator at time 0, set my stop to the price of another indicator at time 0 and keep them fixed (i.e. not change to a new price as time goes by). How can I do that?Tags: None
-
Hi kal1212, thanks for your question.
You will not be able to use the Stop and Target section of the builder if your stop or target are going to be the value of an indicator. After the strategy submits an entry order submit an exit order and the price can be set to an indicator value. I have attached a semi-relevant example (it shows how to submit a stop loss order). The example implements a break even action.
Please let me know if I can assist any further.Attached FilesChris L.NinjaTrader Customer Service
-
Thanks a lot. This really helps. I am also trying to set the strategy to take profits at different price targets as a trade moves in my favor. So say 1/3 of position at target 1, another 1/3 at target 2 and the remaining third to exit when the condition to take the trade in the first place is no longer true. Can you kindly provide a video on how this can be accomplished using the strategy builder?
Thanks
Comment
-
Hi kal1212, thanks for your reply.
I know of this example from our colleague Chelsea that implements a scale out:
How do I set up Strategy builder to scale out of a 3 contract order? Say close 1 @ 5 ticks, close 1 @ 15 ticks and trail 1 at 25 ticks? Do you have a video
Please let me know if you have any questions on this material.Chris L.NinjaTrader Customer Service
Comment
-
Hello,
it appears that this sample strategy does not apply the BE and the SL respectively when the high of the entry bar does not reach the BE trigger level and when the close of the entry bar ends below the SL.
Another issue is that the strategy does not apply on the entry bar the Low[0]<Low[1] exit condition that I added in order to avoid this. This is also shown on the attached image, where point 1 is causing points 2 and 3.
Please can you show if there a way to fix this? thx
[ATTACH]n1100799[/ATTACH]
Comment
-
Hi guidoisot, thanks for posting.
Please print out the price of your MIT order and make sure its at a valid price level. There might also be errors in the log tab of your control center on the error. The strategy comes "as is " so I would not be able to debug any modifications.
Please let me know if I can assist any further.Chris L.NinjaTrader Customer Service
Comment
-
I accorded above breakevenstrategy sample to try. I found there is a bug! The bug is when entry bar triggered the stop loss, NT8 do not fire the exit order!
It only work for 2nd bar or later bar to trigger stop loss!
Can Customer Service checks the provided Sample what happens?!
Comment
-
Hello guidoisot,
This would be a limitation of the Strategy Builder strategy example which uses OnBarUpdate to trigger the logic for the stop loss handling.
With the unlocked strategy, I would suggest using OnExecutionUpdate to trigger your stop loss, and I would also suggest submitting the order to a single to tick data series to have the order filled with intrabar geanularity.
SampleOnOrderUpdate can demonstrate using OnExecutionUpdate to submit orders for target and stop with OnExectuionUpdate and SampleIntrabarBacktest can demonstrate submitting orders to a single tick data series so they are filled with intrabar granularity instead of using the OHLC of the next bar.
SampleOnOrderUpdate - https://ninjatrader.com/support/help...and_onexec.htm
SampleIntrabarBacktest - https://ninjatrader.com/support/help...ipt_strate.htm
We look forward to assisting.JimNinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by cmtjoancolmenero, Today, 02:31 PM
|
1 response
4 views
0 likes
|
Last Post Today, 02:42 PM | ||
Started by tradebot, Today, 01:25 PM
|
2 responses
8 views
0 likes
|
Last Post
by tradebot
Today, 02:36 PM
|
||
Started by merc410, Today, 03:41 AM
|
4 responses
27 views
0 likes
|
Last Post
by merc410
Today, 02:27 PM
|
||
Started by Graci117, Yesterday, 11:40 PM
|
2 responses
18 views
0 likes
|
Last Post
by Graci117
Today, 02:26 PM
|
||
Started by Taddypole, Today, 02:25 PM
|
0 responses
1 view
0 likes
|
Last Post
by Taddypole
Today, 02:25 PM
|
Comment