Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

using Change for Addon -> Account order

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

    using Change for Addon -> Account order

    Hello, I am using the Change method within the Addon->Account section of methods.

    I am either changing the entry price or quantity and this is for a pending order.

    I see in the log the change method :

    (My NinjaTrader Continuum) Cbi.Account.Change0: realOrderState=Working orderId='6388df806f654aecb2d04e2a2a2af1aa' account='Sim1 etc etc ....

    is there any onOrderUpdate event that can be expected for this ie submit or accepted ? It doesnt appear that there is and so i wanted to confirm what if any state changes this entry order (in this example) would go through for a pending order.

    Also - i am using LimitPriceChanged and Quantity changed for the order before submitting this change which in most cases is Limit order - if my entry is an MIT order what field do i set in the order before submitting the change?

    thanks
    Last edited by soulfx; 11-15-2017, 07:51 AM.

    #2
    Hello soulfx,

    Thank you for the post.

    You can subscribe to an OrderUpdate event, then implement OnOrderUpdate once you subscribe to the event in your script. The help guide link on OrderUpdate has a full example of how to subscribe to OrderUpdate, how to implement and use the OnOrderUpdate function once subscribed, and how to unsubscribe from the event when you are done as well.



    Please let us know if we may be of any further assistance.
    Chris L.NinjaTrader Customer Service

    Comment


      #3
      Hello this is not what i had asked - You have not answered my question nor considered the issue - i am well aware of the functioning of the events and i am using onorderupdate already.

      This sort of first level 'basic' response is not helpful and a waste of time

      Please re read my post

      thank you

      Comment


        #4
        Hello still patiently awaiting a reply on this from over 2 hours ago now. Even an update to say checking with someone else would have been appreciated

        Comment


          #5
          Hello soulfx,

          Thank you for your response.

          The order when changed should see the ChangeSubmitted state. You can refer to the order states at the following link: https://ninjatrader.com/support/help...efinitions.htm

          MIT orders use the Stop Price field and not the Limit Price field.

          Please let me know if you have any questions.

          Comment


            #6
            Hello, thanks thats what i needed to confirm - it wasnt clear if i would get a series of state changes as with other events. So to confirm changeSubmitted is what i would check for should i need to do anything & is the only state i would be ablel to track in onOrderUpdate? ie it doesnt additionally have another 'working' state for the order. I would have thought there would be a ChangeAccepted or Accepted state also for this?

            Comment


              #7
              Hello soulfx,

              Thank you for your response.

              The working and accepted states should also be seen.

              Please let me know fi you have any questions.

              Comment


                #8
                Hello, ok all good and have verified this for the Change.
                In testing i also note and want to confirm ; i have a process which tracks changes to certain key levels whilst in pending mode and if they change to submit a change to the original order.

                In certain instances this could change the quantity based on the risk and also the entry price may not change. It seems in instances where there is no change to the original quantity or entry price that the change is submitted but there is no onorderupdate event.

                So it seems i need to keep track of the prior price and quantity and to know i will not get an event in onorderupdate - is there something in ninja which checks this and doesnt send the change request?
                I understand if this is the case it just means any logic i had to reset something in onorderupdate will not fire if there is no change to quantity or entry price/stop price (for MIT). i just need to tweak my calculation/logic to check for this

                thanks

                Comment


                  #9
                  Originally posted by soulfx View Post
                  In certain instances this could change the quantity based on the risk and also the entry price may not change. It seems in instances where there is no change to the original quantity or entry price that the change is submitted but there is no onorderupdate event.
                  Hello soulfx,

                  Thank you for your response.

                  Can you provide an example of this? Such as changing the order type?

                  I look forward to your response.

                  Comment


                    #10
                    Hello, for clarity there is no change to the order type - is either Limit or MIT in all cases for the entry for this scenario context.

                    What i was referring to if there is no quantity change or entry price change would you expect there to be an event triggered for the states in onorderupdate.

                    Since i posted last response i put in logic to handle this and check for the entry price OR quantity and if there is no change i no longer submit the Change on the entry order.

                    i was just asking if you were aware specifically that this is the case as it indeed appears to be as i get no event in onorderupdate when there is no quantity or entry price change in the Change method.
                    Does that make sense? For completeness and clairifcation i wanted to ask so the documentation could be updated to state that no event would be triggered in this instance.

                    I am writing this from the perspective of a developer writing an application using an API and what is expected or not as the help page does not have much information

                    thanks

                    Comment


                      #11
                      Hello soulfx,

                      Thank you for your response.

                      No order updates should occur unless the order is submitted, changed, cancelled, filled, partially filled, or rejected.

                      Please let me know if you have any further questions.

                      Comment


                        #12
                        Hello Patrick, sorry but could you please re read my posts.

                        Of course i would not expect order updates if i did not submit, or change the order - that is not what i asked nor stated.

                        I said that with sending the Change on the order - in instances where the quantity had not changed and the entry price did not change that i received NO updates in onorderupdate. Is this to be expected?

                        I dont know how i can make my post clearer if you need more clarity let me know

                        thanks

                        Comment


                          #13
                          Hello soulfx,

                          Thank you for your response.

                          In regards to your question on orders changing I had asked you what type of change you were making that would not be quantity or price and you had not answered. Essentially, there is no order update as a change that is going to come through if the quantity or price is not being requested for change.

                          Please let me know if you have any further questions on the matter.

                          Comment


                            #14
                            Hello, you asked about changing the order type and i said i was not changing that :

                            _entryOrder.QuantityChanged = _tradeSize;

                            if (IsExecuteAsMITOrder)
                            _entryOrder.StopPriceChanged = EntryPrice;
                            else
                            _entryOrder.LimitPriceChanged = EntryPrice;

                            above is extract of the code - when i submit this _entryOrder Change - if none of the above EntryPrice or _tradeSize is different to prior quantity or price - Is this ignored in ninja or is still submitted - that is the question? And i am stating i do not get an onorderupdate event state in my code - i just want to confirm this and am now handling NOT submitting the change where price and quantity have not changed since the last check - i would still like to know what ninja internally is doing

                            thanks

                            Comment


                              #15
                              Hello soulfx,

                              Thank you for your response.

                              Submitting the same price with ChangeOrder() will trigger ChangePending and ChangeSubmitted events.

                              Using Order.LimitPriceChanged or Order.StopPriceChanged has no event triggered in my tests whether the price is the same or not. In fact these two values are not supported and should not be used to change orders. Are you seeing these two values actually work to change orders?

                              I look forward to your response.

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by cre8able, Today, 01:01 PM
                              0 responses
                              2 views
                              0 likes
                              Last Post cre8able  
                              Started by manitshah915, Today, 12:59 PM
                              0 responses
                              2 views
                              0 likes
                              Last Post manitshah915  
                              Started by ursavent, Today, 12:54 PM
                              0 responses
                              3 views
                              0 likes
                              Last Post ursavent  
                              Started by Mizzouman1, Today, 07:35 AM
                              3 responses
                              17 views
                              0 likes
                              Last Post NinjaTrader_Gaby  
                              Started by RubenCazorla, Today, 09:07 AM
                              2 responses
                              13 views
                              0 likes
                              Last Post NinjaTrader_ChelseaB  
                              Working...
                              X