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 r68cervera, Today, 05:29 AM
    0 responses
    2 views
    0 likes
    Last Post r68cervera  
    Started by geddyisodin, Today, 05:20 AM
    0 responses
    3 views
    0 likes
    Last Post geddyisodin  
    Started by JonesJoker, 04-22-2024, 12:23 PM
    6 responses
    35 views
    0 likes
    Last Post JonesJoker  
    Started by GussJ, 03-04-2020, 03:11 PM
    12 responses
    3,239 views
    0 likes
    Last Post Leafcutter  
    Started by AveryFlynn, Today, 04:57 AM
    0 responses
    6 views
    0 likes
    Last Post AveryFlynn  
    Working...
    X