Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

SetStopLoss repeat processing

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

    SetStopLoss repeat processing

    The short question is: If I use "SetStopLoss("MyTradingAlgo",[...]" and have a condition that, when triggered, sends a new SetStopLoss with the same fromEntrySignal, does it cancel/move the prior entry signal, does it make 2 stop losses, or does it do nothing because a stop loss with that fromEntrySignal already exists?

    Longer story:
    I have my trading algorithm
    If Logic = true
    EnterTrade
    SetAStopLoss
    SetAProfitTarget


    If PriceAction does Xyz
    (essentially I want it to move the Stop Loss)

    I would love to cancel the first stop loss that's at whatever my risk is for loss and move it to a position closer to my entry. Is that possible? Can I do that with simply declaring a new stop loss with the same fromEntrySignal?

    Heck is there syntax to move an order to a new defined level?

    Is there syntax to cancel a stop loss/profit target and set a new one within the same fromEntrySignal? I like the "fromEntrySignal" setup because it makes everything an OCO and I don't get zombie orders that make things go rogue.
    Last edited by alphatango; 10-26-2023, 01:11 PM.

    #2
    Hello alphatango,

    Calling SetStopLoss() with the same fromEntrySignal will update the stop loss with the new parameters (and will not send an additional order).

    See the ProfitChaseStopTrailSetMethodsExample here:


    "I would love to cancel the first stop loss that's at whatever my risk is for loss and move it to a position closer to my entry."

    Calling SetStopLoss() or an order method with the same signal name would change the orders price and would not cancel the order.

    To cancel the order and place a new order, instead of updating the price of the existing order, you would need to use exit orders instead of set methods, assign the orders to variables in OnOrderUpdate(), and then use CancelOrder() and supply the variable.
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Mindset, 04-21-2026, 06:46 AM
    0 responses
    88 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    134 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    68 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by cmoran13, 04-16-2026, 01:02 PM
    0 responses
    119 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    69 views
    0 likes
    Last Post PaulMohn  
    Working...
    X