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 NullPointStrategies, Yesterday, 05:17 AM
    0 responses
    71 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    143 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    76 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    47 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    51 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X