• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

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 XimoTrader, Today, 12:57 PM
                  1 response
                  6 views
                  0 likes
                  Last Post NinjaTrader_PatrickG  
                  Started by FxInception, Today, 12:27 PM
                  2 responses
                  10 views
                  0 likes
                  Last Post FxInception  
                  Started by siroya, Today, 10:34 AM
                  1 response
                  20 views
                  0 likes
                  Last Post NinjaTrader_ShawnB  
                  Started by Leeroy_Jenkins, Today, 11:22 AM
                  2 responses
                  12 views
                  0 likes
                  Last Post Leeroy_Jenkins  
                  Started by RedDuke, Today, 10:27 AM
                  2 responses
                  15 views
                  0 likes
                  Last Post RedDuke
                  by RedDuke
                   
                  Working...
                  X