• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

how include trail stop for automated strategy N8?

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    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 , thanks

    #2
    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

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by cocopod, Today, 04:47 PM
    1 response
    5 views
    0 likes
    Last Post NinjaTrader_JoshG  
    Started by digibob, Today, 02:47 AM
    2 responses
    14 views
    0 likes
    Last Post NinjaTrader_Kate  
    Started by mntemel, Today, 03:31 PM
    4 responses
    21 views
    0 likes
    Last Post mntemel
    by mntemel
     
    Started by mrlucky1x, Today, 03:14 PM
    1 response
    6 views
    0 likes
    Last Post NinjaTrader_ChrisL  
    Started by ninjo, Today, 02:42 PM
    4 responses
    9 views
    0 likes
    Last Post ninjo
    by ninjo
     
    Working...
    X