Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Handling ChangeOrder method

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

    Handling ChangeOrder method

    Hello,

    Let's say that I set and unmanaged limit order and I want to change the price but not the quantity of the order. But, between a change of the price the order has been partially filled,

    When I use changeorder() with the new Price parameter, the Quantity parameter has to be updated to the number or remaining shares to be filled or the original value of the order has to be kept even if the order has been partially filled?

    Thanks

    #2
    Hello guillembm,

    When calling ChangeOrder() this will also change the quantity. The quantity must be set to the quantity you want the order to have after the change order takes effect.

    If there is a part fill and you want to modify the price, you would set the price to the remaining unfilled amount.
    (i.e. the original quantity is 10, a quantity of 2 part fills, the change order should be set to the remaining 8).
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Would it be possible to use the ChangeOrder method with a setting that only modifies the price of the order, leaving the Quantity parameter blank?

      Comment


        #4
        Hello guillembm,

        There is not an overload that would allow for ChangeOrder to be called without a quantity.

        Would you like to submit a feature request for the NinjaTrader development to consider adding functionality to change an order without specifying the quantity in a future version of NinjaTrader?
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          This would be a great idea. Thanks for your support

          Comment


            #6
            Hello guillembm,

            I've received a tracking ID for your request. For future reference, your request to add an overload for ChangeOrder() that does not have the quantity parameter is being tracked with ID #SFT-1914.

            Please keep in mind it is up to the NinjaTrader Development to decide if and when a feature request will be implemented.

            Thanks for your feedback. Please let me know of any other suggestions or ideas you have for the NinjaTrader platform.
            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              Here ya go,

              Code:
                      protected void ChangeOrder(IOrder order, double LimitPrice, double StopPrice)
                      {
                          ChangeOrder(order, order.Quantity, LimitPrice, StopPrice);
                      }

              Comment


                #8
                This would be more correct, I think:
                ChangeOrder(order, order.Quantity - order.Filled, LimitPrice, StopPrice);
                But the problem is that it's possible that order.Filled doesn't yet reflect all recent fills.
                Last edited by YuriyGulyayev; 07-10-2017, 10:47 AM.

                Comment


                  #9
                  Actually the code in my previous post appears to be incorrect.
                  What bltdavid posted appears to work better.

                  My questions is: will this work if applied to OCO orders amid concurrently occurring partial fills?
                  I set the "Enforce Partial Fills" setting and I have observed that only after the 1st partial fill the quantity of the order on the other side of the market gets reduced, but not after further partial fills.

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by GwFutures1988, Today, 02:48 PM
                  1 response
                  5 views
                  0 likes
                  Last Post NinjaTrader_Clayton  
                  Started by ScottWalsh, 04-16-2024, 04:29 PM
                  6 responses
                  30 views
                  0 likes
                  Last Post ScottWalsh  
                  Started by frankthearm, Today, 09:08 AM
                  10 responses
                  36 views
                  0 likes
                  Last Post frankthearm  
                  Started by mmenigma, Today, 02:22 PM
                  1 response
                  3 views
                  0 likes
                  Last Post NinjaTrader_Jesse  
                  Started by NRITV, Today, 01:15 PM
                  2 responses
                  9 views
                  0 likes
                  Last Post NRITV
                  by NRITV
                   
                  Working...
                  X