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 argusthome, 03-08-2026, 10:06 AM
    0 responses
    80 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    46 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    29 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    32 views
    0 likes
    Last Post TheRealMorford  
    Started by Mindset, 02-28-2026, 06:16 AM
    0 responses
    66 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Working...
    X