Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

cancelling a limit order.

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

    cancelling a limit order.

    You write a script that places a limit or stop order when certain conditions occur. Then the market does not reach your limit/stop price. But you don't want that limit/stop order sitting there forever. You want it cancelled How do you do that.

    For example: my strategy is going to place a buy stop when price breaks the upper bollinger. (with some other stuff) We are placing our order 4 ticks above the high of the breakout. candle. If price does not move those 4 ticks, I don't want the order just sitting there. How do I make sure they either disappear.? or how do I limit the time the strategy will be activated once my conditions are first met. Like 8 candles after bollinger break if order not triggered then cancel.

    Thanks for your help

    #2
    Hello mcteague,
    Thanks for your note.

    You can use the CancelOrder method to cancel an order. Please refer to this sample code which further demonstrates how to cancel an order
    When using NinjaTrader's Enter() and Exit() methods, the default behavior is to automatically expire them at the end of a bar unless they are resubmitted to keep them alive. Sometimes you may want more flexibility in this behavior and wish to submit orders as live-until-cancelled. When orders are submitted as live-until
    JoydeepNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    67 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    36 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    60 views
    1 like
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    62 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    53 views
    0 likes
    Last Post CarlTrading  
    Working...
    X