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
No announcement yet.
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
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
576 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
334 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
553 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
551 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment