Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Issue with Cancel Order in Un managed approach

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

    Issue with Cancel Order in Un managed approach

    Hi,
    I am seeing unexpected orders getting generated in my strategy with live data. May be I may wrong in my understanding. Can you please explain why I am seeing new internal order immediately getting submitted after I cancel the order?
    Case:
    Strategy will be trading between 1:00 Am to 6:24Am and 6:31AM to 1:40PM
    So I have a flag to check these times and based on the flag I am cancelling any open orders and closing the open poison.

    can you please check the attached Log, Output and the code that is getting executed and let me know if there is any thing that i need to handle.

    thanks,
    gsreddy
    Attached Files

    #2
    gsreddy, you mean this submit that you do not expect, correct?

    9/24/2012 12:06:23 AM Entered internal SubmitOrder() method at 9/24/2012 12:06:23 AM: Action=Buy OrderType=Limit Quantity=1 LimitPrice=1448.00 StopPrice=0 OcoId='' Name='EL'

    Comment


      #3
      Hi,

      Sorry for the confusion, i have submitorder in onmarketdata, that might be issuing the new order after setting entryorder to null.

      i will test this again and will get back to you if i still has any issues.

      i have one question related to SendMail(), it will be great if you can clarify.

      in my code i am using SendMail() to send email alert if my program detects any abnormal cases to
      alert me and continue execute next steps in the strategy with out waiting for any response. if mail server is down or some thing wrong with it, will my program hangs with SendMail() until sendmail timesout?

      step1
      ....
      step10
      sendmail() // is there any chance of getting delay with this stmt if some thing wrong with email server?
      step11
      step12
      .....

      thanks,
      gsyamala.

      Comment


        #4
        Hi,

        i am very close to go live and need some clarifications related to NT7->TT -> CME
        can you please help me with the below post related to order types?



        thanks,
        gsreddy

        Comment


          #5
          gsyamala, we will take a look at your other thread as well soon for the TT order questions.

          For SendMail() - I would not expect an issue if the mail could not be sent or server not accessed. What you want be very careful with is not entering into a loop with potentially realtime intrabar updates enabled that could lead to a flood of emails being sent by your code.

          Comment


            #6
            Bertrand,

            thanks for the reply,

            Today I have seen very unexpected behavior in my strategy with live data and SIM account. Have seen OnMarketData is not getting called and then restarted Ninja, after restarting NT7 and starting strategy,
            Strategy has paced one entry order and got filled, with the fill status and order reference in OnExecution strategy has submitted OCO order for Stop loss STOP and Profit target LIMIT orders and got all the expected OnOrderUpdate calls for this OCO order.
            Market conditions has changed and strategy has changed the stop order stop price to ABOVE/BELOW current ASK/BID to close the position at market price. This change order got filled and received all the expected OnOrderUpdates for Stop loss order with the fill and Pending Cancel status for Profit target order. This PT order got cancelled in the Orders tab, and haven’t seen any footprint of this cancel either in LOG or in the strategy with cancel status in OnOrderUpdate.
            For debugging, I am printing all the order objects and their status in OnorderUpdate and OnExecution.
            Since onOrderUpdate haven’t received the cancel status for Profit target, strategy is not setting the PTOrder reference NULL and strategy waiting for cancel status for PT order to submit new trade. This is happened with TT live data and SIM account. Is this the expected behavior?
            In my strategy, I am need to change the STOP order type to STOP LIMIT order type.
            How do I me sure my stop limit order gets executed at market?
            Thanks
            gsreddy.

            Comment


              #7
              gsreddy, could you please contact us via Help >> Mail to Support so we could review your trace / log files for this order sequence you've seen? Please try to include an approximate time when this was occuring as well when you sent those files in to us. Was it a direct CancelOrder() via your code or an implicit cancelleation due to OCO logic?

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
              0 responses
              672 views
              0 likes
              Last Post Geovanny Suaza  
              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
              0 responses
              379 views
              1 like
              Last Post Geovanny Suaza  
              Started by Mindset, 02-09-2026, 11:44 AM
              0 responses
              111 views
              0 likes
              Last Post Mindset
              by Mindset
               
              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
              0 responses
              575 views
              1 like
              Last Post Geovanny Suaza  
              Started by RFrosty, 01-28-2026, 06:49 PM
              0 responses
              582 views
              1 like
              Last Post RFrosty
              by RFrosty
               
              Working...
              X