Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Need help automating trailing stop strategy

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

    Need help automating trailing stop strategy

    I have had success using the trailing stop system in the DOM, where you can set an initial stop loss value, and then set a trailing stop to "kick in" when a certain profit target is reached (allowing you to tighten and then trail your stop).

    I can't seem to figure out how to duplicate this in NinjaScript. The SetTrailStop() command only allows me to set a trailing value, not a target at which this will kick in.

    How can I create, for example, the following:

    Trading ES
    Initial stop loss: 8 ticks
    After profit target of 5 ticks achieved, tighten and trail stop by 3 ticks

    Any help would be appreciated. Thanks!

    #2
    The SetTrailStop() method does not allow for this.

    You would have to program your own logic to do this by monitoring the PnL and once you have hit 5 ticks in profit, modify the price of your stop loss order.

    You would need to use the method ExitLongStop() or ExitShortStop().
    RayNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Mindset, 04-21-2026, 06:46 AM
    0 responses
    110 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    156 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    74 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by cmoran13, 04-16-2026, 01:02 PM
    0 responses
    125 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    79 views
    0 likes
    Last Post PaulMohn  
    Working...
    X