Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Trailing Profits - How to Reverse a Trailing Stop?

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

    Trailing Profits - How to Reverse a Trailing Stop?

    Hello,

    I have system using a trailing stop as follows:

    protected override void Initialize()
    {
    SetTrailStop("", CalculationMode.Ticks, 60, true);

    CalculateOnBarClose = true;
    }

    protected override void OnBarUpdate()
    {
    if ()
    {
    EnterShort(DefaultQuantity, "");
    }

    }

    I'd like to reverse the trailing stop, so that I would go long instead of short and when the trailing "stop" was hit, it would be a take profit. I can't think how I could do this, low-intermediate coding skills so thanks for your patience,

    Jeremy

    #2
    jeremymgp,

    If you did EnterShort() and had a short position and you called EnterLong() it will reverse you into a long position, cancel the original trailing stop, and finally place you in a new trailing stop that is in the appropriate direction.
    Josh P.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    558 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    324 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    101 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    545 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    547 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X