Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Modify ExitLongStop Order

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

    Modify ExitLongStop Order

    Upon entering a long position, I set an ExitLongStop order through the OnExecution method. Once a certain profit level is reached, I am trying to modify that ExitLongStop order (basically my own trailing stop logic).

    When I reach that profit level I send another ExitLongStop command with a new Entry Signal, i.e.

    Original Stop Order (placed in OnExecution):
    StopOrder1 = ExitLongStop(1, true, execution.Order.Filled, Position.AvgPrice - StopTarget1, "Original Stop Loss", "Buy");

    After profit level reached, modify stop order (placed through OnBarUpdate):
    StopOrder1 = ExitLongStop(1,true,StopOrder1.Quantity, Position.AvgPrice, "Breakeven", "Buy");

    I'm using a new 'string signalName' for the same 'StopOrder1'. This is creating an additional ExitLongStop order leaving the "Original Stop Loss" order still in tact (and then 2 stop loss orders outstanding for the same position). I would think since I said 'StopOrder1' again, it would have just modified the stop order, not create a new one (Like SetStopLoss works).

    Do I have to manually cancel the 1st ExitLongStop order when I send the second ExitLongStop order statement, or is there a way to modify the 1st order while changing the signalName so I can visually see the stop was adjusted? Thanks,

    kc
    Last edited by kcsystemtrader; 03-15-2009, 01:12 PM.

    #2
    Hi kc, this should be possible by simply using the same signal names as in your first stop order, then you would modify the already placed one.

    Comment


      #3
      Originally posted by NinjaTrader_Bertrand View Post
      Hi kc, this should be possible by simply using the same signal names as in your first stop order, then you would modify the already placed one.
      Yeah, I thought that would work, but I wanted it to be setup so that the Exit signal name provided some information about the exit (so needed different signal names). I was able to get it to do what I wanted, but I did have to create new (uniquely named) stop orders and manually cancel the old stop orders in order to get it to work right. Thanks,

      kc

      Comment


        #4
        Glad you got this resolved.
        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
        647 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        368 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        108 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        571 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        573 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X