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 charlesugo_1, 05-26-2026, 05:03 PM
    0 responses
    56 views
    0 likes
    Last Post charlesugo_1  
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    143 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    160 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 05-10-2026, 08:12 PM
    0 responses
    96 views
    0 likes
    Last Post CarlTrading  
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    276 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Working...
    X