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:

    Chris L.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by pibrew, Today, 06:37 AM
    0 responses
    1 view
    0 likes
    Last Post pibrew
    by pibrew
     
    Started by rbeckmann05, Yesterday, 06:48 PM
    1 response
    14 views
    0 likes
    Last Post bltdavid  
    Started by llanqui, Today, 03:53 AM
    0 responses
    6 views
    0 likes
    Last Post llanqui
    by llanqui
     
    Started by burtoninlondon, Today, 12:38 AM
    0 responses
    11 views
    0 likes
    Last Post burtoninlondon  
    Started by AaronKoRn, Yesterday, 09:49 PM
    0 responses
    16 views
    0 likes
    Last Post AaronKoRn  
    Working...
    X