Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

OrderState() question

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

    OrderState() question

    Hello,

    Say I place an order to buy 10 contracts at market, and i get a partfill for 4 contracts first and then pick up the other 6 contracts a tick later, so in total i get my long 10 contracts done.

    1. Are the partfill for 4 lots and fill for 6 lots, 2 seperate orders?

    2. Would calling OrderState() return string "partfilled" for the first 4 lots, and then a tick later return "filled" for the 6 lots? is this how it would work live?

    3. After calling OrderState() if i call OrderFilled(), will OrderFilled() return the number 4 for the first partfilled order, and then after i call it a second time it would return 6 which is the second order? is this how it works in live trading?

    Im just doing some more research to make sure that my set-up will work. Im thinking of using OrderStatus() to do my order handling, rather than NTMarketPosition().

    Thanks in advance.

    Regards

    Rod

    #2
    1) Order are order and fills are execution. Please don't confuse them. One order could result in multiple executions/fills. The order then would make it to order state PartFilled and finally to Filled as the last execution/fill was seen.
    2) yes
    3) Will return 4 and then 10.

    Comment


      #3
      there is still a problem with calling OrderState() straight after the order is sent, as i am told orderstate() will return an empty string when in fact it should return "initialized", if 20 ticks flow through between when orderstate goes from empty string to "filled", then as NTmarketpostion will have not updated until orderstate returns "filled" or "partfilled", the TS or esignal program could fire off 20 orders when in fact we ony want 1 order fired off. this is an error in NT, and it would be great to see this fixed. many other traders have reported the same problem.

      there is also another bug to do with NTmarketposition returning a incorrect value, which i will replicate for you ASAP so as you can fix it in the next build. apart from these errors, the software does a good job.

      Comment


        #4
        We have had no other reports of this same problem. There is no error in NT with respect to this, you need to control your program flow based on the information that NT provides. With respect to incorrect market position, please provide us a clear example that we can reproduce and we for sure would address this.
        RayNinjaTrader Customer Service

        Comment


          #5
          a recent post by "Moscu" reports a problem with calling OrderState(). straight after an order is submitted, calling orderstate() returns an empty string. problem is that returning an empty string can cause problems as reported by moscu and i agree with moscu about this problem being a problem. even in the NT help manual, it says that orderstate() should return a string that says "initialized" straight after order is sent but this does not happen, instead we get an "Empty" string, and naturally, a string that is empty is surely not the same as a string that returns "initialized". this is the mistake im talking about. "moscu" has reported the same problem.

          Comment


            #6
            Not exactly sure what you mean by "OrderState()", but if you are referring to IOrder.OrderState in the OnOrderUpdate() method, then it will never (!) be empty string. In fact IOrder.OrderState is not even a string but an enum, thus it never could be "empty".

            Comment


              #7
              sorry about that i was talking about OrderStatus(). In NT, it would be good if straight after an order was sent that OrderStatus() returned "initialized" string, instead of empty string. this is the problem that trader "Moscu" was talking about, and i agree with Moscu in that it is indeed a problem, and that the problem is very clear and easy to see. Even the NT help guide says it should not return an empty string straight after an order is submited by traders local PC.

              Comment


                #8
                What "OrderStatus()" are you referring to? There is no OrderStatus() method. Please clarify.

                Please provide a link to the docs where you believe there is incorrect info in.

                Comment


                  #10
                  What exactly do you believe in incorrect in our "what's new"?

                  Also: both links you provided are the same.

                  Comment


                    #11
                    my mistake, link provided did not work. the error is located under the "Appendix A" - Order State Definitions. in the Appendix A, it states that the first order state is "initialized" and this is what Moscu says is incorrect. Moscu states that the when you send an order, OrderStatus() returns an empty string and not a string that says "initialized". If this is true, which i beleive is the case, then this is a problem and mistake in NT.

                    my main concern is will you fix this problem in teh next build, as some traders will need to rely upon OrderStatus() to do successful order handling.

                    Comment


                      #12
                      Please be specific. What problem did you encounter?

                      Also: Please see my post below, there is NO way that IOrder.OrderState EVER could be "empty" since it's not of type string. If you feel there is something wrong then please provide precise information on the details including a reproducible scenario.

                      Comment


                        #13
                        Hi Dierk,

                        Im refering to Moscu's specific problem reported in this thread http://www.ninjatrader-support.com/v...ead.php?t=9983

                        this is the problem i would like to see fixed if possible in the next build. OrderStatus() should never return a empty string straight after an order is submitted, otherwise there could be problems like mutiple orders being fired off. BTW, if you read the thread in the link provided above, Ray has already agreed that the problem does in fact exist (see Ray's quote "This state is not exposed in the ATI. I don't recall why this decision was made but it is by design and how it currently works.").

                        My problem is that i would really like to see this fixed?
                        Last edited by Rocket130713; 09-15-2008, 04:58 AM.

                        Comment


                          #14
                          To clarify: You are referring to the ATI or to a NinjaScript strategy?

                          Comment


                            #15
                            ATI.

                            thanks for helping us Dierk. Much appreciated.

                            Regards

                            Rod

                            Comment

                            Latest Posts

                            Collapse

                            Topics Statistics Last Post
                            Started by argusthome, 03-08-2026, 10:06 AM
                            0 responses
                            88 views
                            0 likes
                            Last Post argusthome  
                            Started by NabilKhattabi, 03-06-2026, 11:18 AM
                            0 responses
                            48 views
                            0 likes
                            Last Post NabilKhattabi  
                            Started by Deep42, 03-06-2026, 12:28 AM
                            0 responses
                            30 views
                            0 likes
                            Last Post Deep42
                            by Deep42
                             
                            Started by TheRealMorford, 03-05-2026, 06:15 PM
                            0 responses
                            34 views
                            0 likes
                            Last Post TheRealMorford  
                            Started by Mindset, 02-28-2026, 06:16 AM
                            0 responses
                            68 views
                            0 likes
                            Last Post Mindset
                            by Mindset
                             
                            Working...
                            X