Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to use Iorder to cancel existing stop/tgt order

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

    How to use Iorder to cancel existing stop/tgt order

    I have a strategy with moving stops. While mkt position is long if a new short entry condition is met, then strategy runs into error and shuts down. I have read elsewhere in the forum that I need to cancel the existing stop orders, exit current position first and enter new position; in order to avoid this error. I tried CancelAllOrders but it was not working. Then on further exploring, I understand I need to use Iorder to be able to cancel the existing stop/tgt orders.

    Is my understanding of where I am standing is correct ?

    If yes, please point me to any reference how I can use Iorder method to cancel the existing stop/tgt orders.

    Regards

    #2
    Hello,

    This will depend on a couple of other factors in your script such as order types that your placing to enter/exit trades.

    Are you currently using SetStopLoss() for your exits or exit long?

    For an example of using IOrders to manage positions: http://www.ninjatrader.com/support/f...ead.php?t=7499

    Depending on the features required in your order handling you may also be able to to use ExitLong() or ExitShort() to first exit your long/short position before submitting you short entry.
    LanceNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CaptainJack, 05-29-2026, 05:09 AM
    0 responses
    366 views
    0 likes
    Last Post CaptainJack  
    Started by CaptainJack, 05-29-2026, 12:02 AM
    0 responses
    237 views
    0 likes
    Last Post CaptainJack  
    Started by charlesugo_1, 05-26-2026, 05:03 PM
    0 responses
    205 views
    1 like
    Last Post charlesugo_1  
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    290 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    250 views
    0 likes
    Last Post CarlTrading  
    Working...
    X