Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to cancel buy limit if target fills

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

    How to cancel buy limit if target fills

    Often I find myself wanting to leave a buy limit order to add to a position but then I would also like that limit order (adding to position) to cancel if my original target fills. Is there a way I can do this?

    Thanks for your time.
    Attached Files

    #2
    Hello, thanks for writing in. The best way to do this would be through the use of Exit orders for your stop and target rather than using SetStopLoss/SetProfitTarget. The Exit methods can be canceled where the Set methods can not be directly canceled unless ExitLong()/ExitShort() is called. While using Exit orders, you will be able to keep track of each order using OnExecutionUpdate/OnOrderUpdate and cancel the pending entry order if the stop or target of the original position closes. See the related example here:

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    174 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Started by CaptainJack, 04-24-2026, 11:07 PM
    0 responses
    330 views
    0 likes
    Last Post CaptainJack  
    Started by Mindset, 04-21-2026, 06:46 AM
    0 responses
    252 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    356 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    183 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Working...
    X