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

How to get account position and order status?

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

    How to get account position and order status?

    I would like to check the positions and active orders I have before I make new orders. Is there any Methord or Function that I can use to check my account position and active orders?

    #2
    atrader,

    A strategy only knows its strategy position. You can check your strategy position by going Position.MarketPosition and Position.Quantity.

    For active orders, you just have to hold onto active IOrder objects for your orders.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Thanks Josh! Since the internet sometimes is not stable,

      the active orders might be filled when the internet is temperarily disconnected. After the internet connection comes back by itself, the strategy will lose its synchronization with the account. That is why I would like to have a method or function to check account position and order status before making any new orders. If it is not possible now, is it planned in the future version of NT?

      Comment


        #4
        NT7 will come with features for you to check account position/quantity.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Thanks again Josh!

          I can let my computer run by itself when NT7 is ready.

          Comment


            #6
            Dear Ninjatrader Support,

            Hi, I have a question.

            Have you come up with a method to get account position / quantity in NT7?
            I would like to know because I have the same problem sometimes.
            (meaning I would need to check the actual account position after reconnection.)

            Look forward to hearing from you.

            Comment


              #7
              hana_maui, I will have someone get back with an answer on Monday.
              AustinNinjaTrader Customer Service

              Comment


                #8
                hana_maui,

                What was possible to be released with NT7 was a way to check your account values. This is done in GetAccountValue(). Unfortunately there is no way to do positions across the strategy. The way to do that would be you have to store global variables across your strategies to be able to calculate your own position/quantity. If you do manual trades though, that would not be included.
                Josh P.NinjaTrader Customer Service

                Comment


                  #9
                  Thank you

                  Dear Mr. Josh,

                  Thanks for your kind reply.
                  I understand about GetAccountValue()

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by inanazsocial, Today, 01:15 AM
                  1 response
                  5 views
                  0 likes
                  Last Post NinjaTrader_Jason  
                  Started by rocketman7, Today, 02:12 AM
                  0 responses
                  6 views
                  0 likes
                  Last Post rocketman7  
                  Started by dustydbayer, Today, 01:59 AM
                  0 responses
                  1 view
                  0 likes
                  Last Post dustydbayer  
                  Started by trilliantrader, 04-18-2024, 08:16 AM
                  5 responses
                  23 views
                  0 likes
                  Last Post trilliantrader  
                  Started by Davidtowleii, Today, 12:15 AM
                  0 responses
                  3 views
                  0 likes
                  Last Post Davidtowleii  
                  Working...
                  X