Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Waiting for execution

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

    Waiting for execution

    Hello,

    It is my understanding that duplicate orders (unfilled, same underlying, same quantity, same direction) will be cancelled. Does anyone know a way to either override this or make a strategy pause before sending another order with the same attributes?

    Thanks

    #2
    [email protected],

    You can use your own flags to limit resending.

    Code:
    if (some condition && flag)
    {
         EnterLongLimit(...);
         flag = false;
    }
    
    if (position changes or execution received)
         flag = true;
    If you do not want your order to be cancelled because you did not keep it alive on every bar you can try the signature with the liveUntilCancelled bool. Set that to true and it will remain live until it is filled or until you cancel it.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Thanks Josh,

      Would the live until cancel bool work in this situation?

      Suppose you're looking at stocks A, B and C.

      A event happens that triggers a buy A, sell B order.

      Before the fills for A and B return an event happens that triggers a buy C and sell B set of orders.

      I'm still not sure if the first sell B order gets canceled or the second and will the liveuntilcancel bool prevent either from being canceled?

      Comment


        #4
        Not sure what you mean. Just because you call ExitLong() again does not cancel the order. If anything it will either a) keep it alive or b) modify it to the new parameters you are calling the exit with.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Hi Josh,

          This is the kind of situation I am trying to avoid:

          In my output window I recieve the following trace message:

          Ignored PlaceOrder() method... Reason = "There is already a matching order with the same prices and quantity"

          I actually want both orders even though the first isn't filled yet. Would liveuntilcancel achieve that?

          Comment


            #6
            If you want both orders use different signal names and also ensure you have EntriesPerDirection set higher. You can also just try submitting at double the quantity to modify the first. That will lower your commissions.
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              I'm not sure how I would use different signal names. From the A, B C example above an order can be generated to sell B is B's bid changed or if A or C's offer changed. I wouldn't want to miss any of those events. I could split all the cases into different strategies but I need to keep track of the aggregate short position in the stocks and I don't know how to share variables safely across strategies. Any suggestions?

              Comment


                #8
                Post an example of your code.

                Signal names are definable every time you call Enter() or Exit().
                Josh P.NinjaTrader Customer Service

                Comment


                  #9
                  Gotcha, thanks that will solve the issue.

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by algospoke, 04-17-2024, 06:40 PM
                  3 responses
                  26 views
                  0 likes
                  Last Post NinjaTrader_Jesse  
                  Started by bmartz, 03-12-2024, 06:12 AM
                  3 responses
                  27 views
                  0 likes
                  Last Post NinjaTrader_Zachary  
                  Started by Aviram Y, Today, 05:29 AM
                  2 responses
                  8 views
                  0 likes
                  Last Post Aviram Y  
                  Started by gentlebenthebear, Today, 01:30 AM
                  1 response
                  8 views
                  0 likes
                  Last Post NinjaTrader_Jesse  
                  Started by cls71, Today, 04:45 AM
                  1 response
                  7 views
                  0 likes
                  Last Post NinjaTrader_ChelseaB  
                  Working...
                  X