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 tkaboris, Today, 05:13 PM
    0 responses
    2 views
    0 likes
    Last Post tkaboris  
    Started by GussJ, 03-04-2020, 03:11 PM
    16 responses
    3,281 views
    0 likes
    Last Post Leafcutter  
    Started by WHICKED, Today, 12:45 PM
    2 responses
    19 views
    0 likes
    Last Post WHICKED
    by WHICKED
     
    Started by Tim-c, Today, 02:10 PM
    1 response
    10 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by Taddypole, Today, 02:47 PM
    0 responses
    5 views
    0 likes
    Last Post Taddypole  
    Working...
    X