Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

NTOrderStatus question

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

    #16
    Initial state of NTOrderStatus

    Hello,

    What would be the initial state of an order?
    NTOrderStatus(OrderID) = ""

    I have a script that checks the status of an order and trying to determine what value it should find when an order has not even been placed yet.

    Thanks

    Comment


      #17
      If an order has not even been placed yet how would you have the OrderID?
      Josh P.NinjaTrader Customer Service

      Comment


        #18
        Hello,

        I set the Order ID within the code. My signal can change quickly, so I will not fire a new order until I get a confirmed cancel or filled in a previous trade, but to fire the initial order it is neither cancelled or filled yet. My condition is to fire an order only if the state is null, cancelled or filled; null only being the beginning of the day.

        Thanks

        Comment


          #19
          You can check all potential states here - http://www.ninjatrader-support.com/H...V6/IOrder.html

          First thing you would see it being in PendingSubmit while going in accepted / working status.
          BertrandNinjaTrader Customer Service

          Comment


            #20
            lost OrderStatus overnight

            Hello,

            i use orderrouting from tradestation through Ninjatrader to Patsystems. Almost all works well. However, ninjatrader lost the orderstatus for overnight-positions. At startting a position orderstate is filled. Next day the getting orderstatus is "". Why?

            Thanks.

            sigworks

            Comment


              #21
              sigworks,

              What version of NT? Are you shutting NT down?
              Josh P.NinjaTrader Customer Service

              Comment


                #22
                Originally posted by NinjaTrader_Josh View Post
                sigworks,

                What version of NT? Are you shutting NT down?
                Hello,

                yes I'm shutting down NT. OrderStatus will be safed locally? Is it lost, when I restart NT?
                I use NT 7.

                Thank you.

                Comment


                  #23
                  sigworks,

                  As you connect, NT reads position updates from your brokerage. Whatever comes across the wire when you read them is what will be displayed for those orders. For the most part, if your brokerage has a working order, it will always report that as working.
                  Josh P.NinjaTrader Customer Service

                  Comment


                    #24
                    Originally posted by NinjaTrader_Josh View Post
                    sigworks,

                    As you connect, NT reads position updates from your brokerage. Whatever comes across the wire when you read them is what will be displayed for those orders. For the most part, if your brokerage has a working order, it will always report that as working.
                    Josh, maybe for working orders. I have an issue with opened positions, when I start NT next day, I can not determine the orderstatus of the opened position. The Function NTOrderStatus(String OrderID) returns "0". When I restart NT at the same day where the position opened, then NTOrderStatus(String OrderId) returns the correct status.

                    Is this issued by my brokerage?

                    Thanks.

                    Comment


                      #25
                      sigworks,

                      I guess I am not following. If you already opened the position, the order's state is Filled because that's how you opened the position. Guess I am not sure which order you are trying to look for exactly? Thanks.
                      Josh P.NinjaTrader Customer Service

                      Comment


                        #26
                        Hi Josh,
                        right, but I do some processes with the orderstatus. When I got not "filled" with an opened position, so this processes are not working. How could I determine the NTOrderStatus for this opened position next day after restart NT?

                        Thanks.

                        Comment


                          #27
                          sigworks,

                          Unfortunately I am still not following you. Your order is definitely filled if it opened a position. Only other possibility is a partial fill.

                          NTOrderStatus does not run on positions, it runs on orders.
                          Josh P.NinjaTrader Customer Service

                          Comment


                            #28
                            Ok. I understand, but it is a little inconsistent for me, because the OrderId of the running position is existent until the position is closed (at the same day). The OrderStatus of this OrderId is "filled" until it comes overnight. Next day this is empty.
                            The Status of this ID could be generally deleted after the position will be closed, I think. Little confused

                            Thanks.

                            sigworks

                            Comment


                              #29
                              sigworks,

                              Sounds to me you are using some external application to try and read the OrderState of the same OrderID you had prior to shutting down NT. This OrderID may or may not be the same.

                              Have you considered using NTOrders() to get a list of all the orderIDs? What does it show you then? What do you get when you run NTOrderStatus() off those IDs?
                              Josh P.NinjaTrader Customer Service

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by PopovDS, Today, 07:11 AM
                              0 responses
                              5 views
                              0 likes
                              Last Post PopovDS
                              by PopovDS
                               
                              Started by Kashin, 03-23-2023, 10:07 AM
                              13 responses
                              1,403 views
                              0 likes
                              Last Post NinjaTrader_Adrian  
                              Started by bourasrafik, 05-12-2024, 03:26 PM
                              1 response
                              23 views
                              0 likes
                              Last Post bourasrafik  
                              Started by cardiodefend, Today, 06:33 AM
                              0 responses
                              2 views
                              0 likes
                              Last Post cardiodefend  
                              Started by Mr Bread, Today, 06:03 AM
                              0 responses
                              6 views
                              0 likes
                              Last Post Mr Bread  
                              Working...
                              X