I have automated strategy , how or code for include trail stop with strategy builder? example , stoploss 50ticks , when the profit reaches 50ticks, trail stop it takes 30ticks profit and it changes stoploss to 20ticks , thanks
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 include trail stop for automated strategy N8?
Collapse
X
-
how include trail stop for automated strategy N8?
Hi
I have automated strategy , how or code for include trail stop with strategy builder? example , stoploss 50ticks , when the profit reaches 50ticks, trail stop it takes 30ticks profit and it changes stoploss to 20ticks , thanksTags: None
-
Hello voltlon,
Thanks for your post and welcome to the NinjaTrader forums!
You've posted in the indicator section so we will move this to the strategy forum.
The strategy builder provides a trail stop function however it is limited to a static trail value only and cannot be changed. For example, if you set the trail amount to be 20 ticks, then the stop would be initially placed 20 ticks away from the entry and for each tick of profit that the order moves, the trail stop would correspondingly move towards profit but would never move backward. Note, in both the strategy builder and ninjascript strategies (that use the managed approach) you cannot use both a fixed stop and a trailing stop on the same order if so the trailing stop would be ignored.
The simplest approach for you would be to just use the trailing stop that is built into the strategy builder understanding that it is a simple trailing stop that cannot be changed.
You can create your own trailing stop however it will require more "sets" (code) in the strategy builder. To do this you would need sets to account for both long and short positions separately. You would need to create sets that monitor for a market position long or short, place an initial stop at the entry price - 50 ticks and then monitor the current price compared to the entry price to see when you reach the defined targets to move your stop to a new price level. While this may sound simple it is not and would require you to think through all of the processes so that once you move the stop that it does not move backward.
My colleague Chelsea has provided an example of creating your own strategy builder trailing stop in this thread: https://ninjatrader.com/support/foru...rategy-builder
Paul H.NinjaTrader Customer Service
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by DJ888, 04-16-2024, 06:09 PM
|
6 responses
18 views
0 likes
|
Last Post
by DJ888
Today, 05:12 PM
|
||
Started by Jon17, Today, 04:33 PM
|
0 responses
1 view
0 likes
|
Last Post
by Jon17
Today, 04:33 PM
|
||
Started by Javierw.ok, Today, 04:12 PM
|
0 responses
6 views
0 likes
|
Last Post
by Javierw.ok
Today, 04:12 PM
|
||
Started by timmbbo, Today, 08:59 AM
|
2 responses
10 views
0 likes
|
Last Post
by bltdavid
Today, 04:10 PM
|
||
Started by alifarahani, Today, 09:40 AM
|
6 responses
41 views
0 likes
|
Last Post
by alifarahani
Today, 03:18 PM
|
Comment