Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to cancel partial filled pending orders

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

    How to cancel partial filled pending orders

    Hi,

    I have a questions about multiple orders entry. If I placed 10 orders at same position, 6 orders filled and 4 orders is pending. How can I cancel the 4 pending orders after 30 second ?

    Thanks,
    Thomson

    #2
    Hello Thomson,

    Inside of OnOrderUpdate() you may use a variable to get the number of bars (if using a small enough time frame to calculate 30 seconds in your data series) or time that your order was part filled and then check that to your local PC clock time so that you can see when 30 seconds have passed.

    Here is a reference that you may look at that uses a custom event to have a method called after a certain amount of seconds have passed.



    Let us know if you have any questions.
    JCNinjaTrader Customer Service

    Comment


      #3
      Thanks for your quickly respond.
      Do you have any example for cancel partial filled order?
      I mean I placed realOrderLong order, which include 10 orders, and the order filled 6 and time passed 30 seconds. I want to cancel the pending 4 orders which not filled, how can I write the code?
      Is the code as below correct?
      CancelOrder(realOrderLong);

      Many thanks,
      Last edited by thomson; 01-23-2014, 10:04 AM.

      Comment


        #4
        Hello Thomson,

        Yes, that is correct.
        JCNinjaTrader Customer Service

        Comment


          #5
          How to cancel partial filled pending orders

          Great post. Thanks for posting..

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by hazylizard, Today, 08:38 AM
          2 responses
          8 views
          0 likes
          Last Post hazylizard  
          Started by geddyisodin, Today, 05:20 AM
          2 responses
          17 views
          0 likes
          Last Post geddyisodin  
          Started by Max238, Today, 01:28 AM
          5 responses
          46 views
          0 likes
          Last Post Max238
          by Max238
           
          Started by giulyko00, Yesterday, 12:03 PM
          3 responses
          13 views
          0 likes
          Last Post NinjaTrader_BrandonH  
          Started by habeebft, Today, 07:27 AM
          1 response
          16 views
          0 likes
          Last Post NinjaTrader_ChristopherS  
          Working...
          X