Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

SetStopLoss() and SetProfitTarget() are not following my strategy logic

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

    SetStopLoss() and SetProfitTarget() are not following my strategy logic

    Hello NT Team,

    for each position I open, I automatically a TP and SL orders using SetStopLoss() and SetProfitTarget() BUT, if for reason the TP and SL are canceled, the strategy can NOT re-put them back.

    This is the code I use

    Code:
    if(PositionAccount.Quantity > 0)
    {
    SetStopLoss() // I set it properly here don't worry :)
    SetProfitTarget() // here as well :)
    }
    the above code snippet is inside OnBarUpdate() but if I manually cancel TP or SL, the strategy doesn't re-put them even the position is still open and the if(PositionAccount.Quantity > 0) is still valid, can you tell me why plz ? and how to fix this ?

    Thank you

    #2
    Hello MohammedAmine,

    Thank you for your reply.

    If you manually cancel the profit target or stop loss I would expect the strategy to not recognize that these have been cancelled - strategies are self contained and manually trading or modifying strategy orders would not affect what the strategy has calculated for its orders/position. You should not be trading manually or manually modifying strategy orders on the same instrument a strategy is running on.

    Please let us know if we may be of further assistance to you.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Mindset, 04-21-2026, 06:46 AM
    0 responses
    90 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    137 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
    120 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