• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Orders not cancelling

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

    Orders not cancelling

    Hi,
    I've not seen this before but right now I have an NT8 (v19) strategy which can produce an order that is not cancellable. Literally calling CancelOrder(order) doesn't do anything. I've built a lot of printout to the Output Window to monitor it. You can see multiple attempts over multiple bars are not cancelling the order named "LE".


    31/10/2019 1:30:00 AM GoLong()
    31/10/2019 1:30:00 AM Long limit order at entry price 3032.25
    31/10/2019 1:30:00 AM Strategy 'tzMomentumStrategy/180132578': Entered internal SubmitOrderManaged() method at 31/10/2019 1:30:00 AM: BarsInProgress=0 Action=Buy OrderType=Limit Quantity=1 LimitPrice=3032.25 StopPrice=0 SignalName='LElmt' FromEntrySignal=''
    +ActiveOrders LE,LS,LT: True Working,False Filled,False Cancelled,+ SE,SS,ST: False Filled,False Filled,False Cancelled
    31/10/2019 2:00:00 AM OnBarUpdate() closeDirection 1 tradeDirection 1 momValue 6 momValid = True; doExit=False, doTrade=True allOrdersInactive=False
    31/10/2019 2:00:00 AM OnBarUpdate() doing trade 1
    31/10/2019 2:00:00 AM MyCancelAllOrders(True,True)
    Cancelling LE
    +ActiveOrders LE,LS,LT: True Working,False Filled,False Cancelled,+ SE,SS,ST: False Filled,False Filled,False Cancelled
    31/10/2019 2:30:00 AM OnBarUpdate() closeDirection -1 tradeDirection -1 momValue -9 momValid = True; doExit=False, doTrade=True allOrdersInactive=False
    31/10/2019 2:30:00 AM OnBarUpdate() doing trade -1
    31/10/2019 2:30:00 AM MyCancelAllOrders(True,True)
    Cancelling LE
    +ActiveOrders LE,LS,LT: True Working,False Filled,False Cancelled,+ SE,SS,ST: False Filled,False Filled,False Cancelled
    31/10/2019 3:00:00 AM OnBarUpdate() closeDirection -1 tradeDirection -1 momValue -2 momValid = True; doExit=False, doTrade=True allOrdersInactive=False
    31/10/2019 3:00:00 AM OnBarUpdate() doing trade -1
    31/10/2019 3:00:00 AM MyCancelAllOrders(True,True)
    Cancelling LE
    +ActiveOrders LE,LS,LT: True Working,False Filled,False Cancelled,+ SE,SS,ST: False Filled,False Filled,False Cancelled


    This brings the trading to a stop because the strategy is permanently waiting for all orders to be cancelled before doing its next step.

    FYI when the log says "Cancelling LE" the immediate next piece of code is
    CancelOrder(LE.order)
    LE is a class which contains various bits of information, including theOrder object.

    Assistance requested.
    Thanks,

    saltminer

    #2
    Hello saltminer,

    Thanks for your post.

    Without an example of the code that you are using, we couldn't comment on how you are hitting an issue. We have a sample demonstrating how CancelOrder should be used and this is working without issue on the latest version of NinjaTrader.

    The sample can be found here - https://ninjatrader.com/support/help...thod_to_ca.htm

    Please ensure your logic for using CancelOrder models after the example we provide. If you have a specific question, please provide a small example showing what you are doing so we can provide our insight.

    EDIT: Thanks for reaching out with an example over email. NinjaTrader_ChelseaB and I will review and follow up with our findings.

    I look forward to being of further assistance.
    Last edited by NinjaTrader_ChelseaB; 11-14-2019, 02:33 PM.
    JimNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by rontronimous, Today, 05:55 PM
    0 responses
    5 views
    0 likes
    Last Post rontronimous  
    Started by bcgeek, Today, 03:43 PM
    2 responses
    6 views
    0 likes
    Last Post bcgeek
    by bcgeek
     
    Started by Mberg, Today, 04:05 PM
    0 responses
    7 views
    0 likes
    Last Post Mberg
    by Mberg
     
    Started by dkbyond, Today, 03:52 PM
    0 responses
    4 views
    0 likes
    Last Post dkbyond
    by dkbyond
     
    Started by Newtrader101, Today, 03:09 PM
    2 responses
    5 views
    0 likes
    Last Post Newtrader101  
    Working...
    X