Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Cannot Cancel Order via ATI

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

    Cannot Cancel Order via ATI

    I am having an issue trying to cancel an order via the ATI. The following is the sequence:

    - place order via NTCommand() with unique orderID and stratID
    - wait for order status to be accepted by calling NTOrderStatus(orderID)
    - on a subsequent bar, call NTCommand to cancel the order using the orderID and startID

    When the above is done, the order is successfully placed and shows up in the DOM and the LOG. The cancel command is submitted ok, but it shows up in the log failed with a message saying "invalid order ID/Name".

    The orderID being called out is the same one that was used to create the order (as per the log). The strange thing is that when the order is accepted in the log, but the order name is renamed and does not use the ID that was passed in the NTCommand call!

    So,

    1. why is the orderID being renamed?
    2. How can I get the orderID that was used by NT?
    3. How do I cancel an order?

    The following is from the log:

    1/16/2008 13:26 ATI OIF 'Cancel;Sim101;@ER2;;0;;0;0;;;A685FB0CE8B847869FE9 EA609514D09E;;LongA685FB0CE8B847869FE9EA609514D09E ' invalid order ID/Name 'A685FB0CE8B847869FE9EA609514D09E'

    1/16/2008 13:26 ATI AT 'Cancel;Sim101;@ER2;;0;;0;0;;;A685FB0CE8B847869FE9 EA609514D09E;;LongA685FB0CE8B847869FE9EA609514D09E ' processing

    1/16/2008 13:26 Order Order='232c011f57ef46a5a5fd4644edb5496d/Sim101' Name='Entry' New State=Accepted Instrument='ER2 03-08' Action=Buy Limit price=707.2 Stop price=707.2 Quantity=2 Type=StopLimit Filled=0 Fill price=0 Error=NoError Native error=''

    1/16/2008 13:26 Order Order='232c011f57ef46a5a5fd4644edb5496d/Sim101' Name='Entry' New State=PendingSubmit Instrument='ER2 03-08' Action=Buy Limit price=707.2 Stop price=707.2 Quantity=2 Type=StopLimit Filled=0 Fill price=0 Error=NoError Native error=''

    1/16/2008 13:26 Order Submitting order with strategy

    1/16/2008 13:26 ATI AT 'Place;Sim101;@ER2;Buy;2;STOPLIMIT;707.2;707.2;DAY ;;A685FB0CE8B847869FE9EA609514D09E;ER2 - IDEAL;LongA685FB0CE8B847869FE9EA609514D09E' processing

    #2
    FYI, this is the same in 6.0 and 6.5

    Comment


      #3
      Ok, I have figured this out by experimentation.

      The problem was that I was using NTCommand to cancel the order and was passing in the strategyId in addition to the orderId. Not sure why this would cause problems, but it does. What I was doing should work according to the doc, but I guess it is out of date.

      I figured this out by looking at and using the NTCancel function instead, which only takes the orderId parameter and then calls the NTCommand function with mostly null/zero parameters.

      Comment


        #4
        Glad you got it to work for you.
        Josh P.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by BarzTrading, Today, 07:25 AM
        2 responses
        15 views
        1 like
        Last Post BarzTrading  
        Started by devatechnologies, 04-14-2024, 02:58 PM
        3 responses
        20 views
        0 likes
        Last Post NinjaTrader_BrandonH  
        Started by tkaboris, Today, 08:01 AM
        0 responses
        4 views
        0 likes
        Last Post tkaboris  
        Started by EB Worx, 04-04-2023, 02:34 AM
        7 responses
        162 views
        0 likes
        Last Post VFI26
        by VFI26
         
        Started by Mizzouman1, Today, 07:35 AM
        1 response
        10 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Working...
        X