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 bortz, 11-06-2023, 08:04 AM
          47 responses
          1,606 views
          0 likes
          Last Post aligator  
          Started by jaybedreamin, Today, 05:56 PM
          0 responses
          8 views
          0 likes
          Last Post jaybedreamin  
          Started by DJ888, 04-16-2024, 06:09 PM
          6 responses
          18 views
          0 likes
          Last Post DJ888
          by DJ888
           
          Started by Jon17, Today, 04:33 PM
          0 responses
          4 views
          0 likes
          Last Post Jon17
          by Jon17
           
          Started by Javierw.ok, Today, 04:12 PM
          0 responses
          13 views
          0 likes
          Last Post Javierw.ok  
          Working...
          X