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 NullPointStrategies, Today, 05:17 AM
    0 responses
    31 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    124 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    64 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    41 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    46 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X