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

Position.Quantity

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

    Position.Quantity

    Can I use Position.Quantity to tell me how many positions I have opened for that pair? It doesn't seem to be working. Is the object NULL if I don't have a position opened?

    Thanks!!
    Last edited by RiversideDude; 04-28-2016, 08:14 AM.

    #2
    Hello,
    Position.Quantity would return the number of positions that you have for the strategy. This would not be the position value for the whole account though. I would recommend reviewing the following reference on understanding the difference between the strategy position and account position: http://ninjatrader.com/support/forum...ead.php?t=4033
    If the strategy does not have a position then Position.Quantity would return a value of 0.
    If we can be of any other assistance please let us know.
    Cody B.NinjaTrader Customer Service

    Comment


      #3
      Hmmm ... So I stopped my strategy and restarted in with the Sync account position to true, but my position quantity still shows as 0 and I have 1 opened. Can I turn this off and have my strategies always run using account based positions?

      Also, when I check it a few minutes later, my strategy has been disabled and the sync set to false.

      Thanks!!

      Comment


        #4
        Hello,
        Was your account in a flat state before enabling the strategy? Was your position submitted by the strategy or manually placed?
        Having your strategies run off of your account positions is unsupported.
        Cody B.NinjaTrader Customer Service

        Comment


          #5
          The positions were manually placed.

          I'm not looking for the strategy to open positions, just manage moving the stops and limits of manually created positions when I'm away from my computer. What is the best way to do that?

          Thanks!!

          Comment


            #6
            Originally posted by RiversideDude View Post
            I'm not looking for the strategy to open positions, just manage moving the stops and limits of manually created positions when I'm away from my computer. What is the best way to do that?
            Strategies in NinjaTrader 7 can only force their position to the account on start up of the strategy. Any manual positions after that would not be reflected in the strategy.
            There is no means in NinjaTrader 7 to manage manually opened positions through a NinjaScript strategy.
            This is possible in NinjaTrader 8 through IsAdoptAccountPositionAware: http://ninjatrader.com/support/helpG...itionaware.htm

            Please let me know if you have any questions.

            Comment


              #7
              So in NT 8 I will have the ability to completely manage all of the positions I open manually? Any restrictions? When will NT 8 be out of beta?

              Thanks in advance!!

              Comment


                #8
                Can I get an answer to this question. If I can't manage trades created manually then neither NT7 nor NT8 is going to work for me.

                Thanks!!
                Last edited by RiversideDude; 04-30-2016, 09:30 AM.

                Comment


                  #9
                  Originally posted by RiversideDude View Post
                  So in NT 8 I will have the ability to completely manage all of the positions I open manually? Any restrictions? When will NT 8 be out of beta?

                  Thanks in advance!!
                  Did you read about IsAdoptAccountPositionAware?
                  What parts about that feature do you not understand?
                  Have you experimented with it yet?
                  Does it not work for you?

                  NT8's public release, aka "Out of beta", is, I believe, still an unknown.

                  Comment


                    #10
                    Originally posted by RiversideDude View Post
                    Can I get an answer to this question
                    It's the weekend ... patience

                    Comment


                      #11
                      I'll test it out.
                      Last edited by RiversideDude; 04-30-2016, 12:11 PM.

                      Comment


                        #12
                        Originally posted by RiversideDude View Post
                        So in NT 8 I will have the ability to completely manage all of the positions I open manually? Any restrictions? When will NT 8 be out of beta?

                        Thanks in advance!!
                        IsAdoptAccountPositionAware along with StartBehavior.AdoptAccountPosition will allow you to pick up the position of the account. This will not continue to pick up the position of the account after the initial start up of the strategy.

                        Comment


                          #13
                          Originally posted by NinjaTrader_PatrickH View Post
                          IsAdoptAccountPositionAware along with StartBehavior.AdoptAccountPosition will allow you to pick up the position of the account. This will not continue to pick up the position of the account after the initial start up of the strategy.
                          Specifically in NinjaTrader 8. NinjaTrader 7 does not have options for this.

                          Comment


                            #14
                            So, is it fair to assume that if I want the position picked up I just need to restart the strategy?

                            Thanks in advance

                            Comment


                              #15
                              RiversideDude,

                              That would be correct. You can check the account position and then submit orders that you would like.
                              You can check PositionAccount to find the current position of the account the strategy is running on: http://ninjatrader.com/support/helpG...ionaccount.htm
                              You can also use OnAccountItemUpdate() to check what account and item has updated: http://ninjatrader.com/support/helpG...itemupdate.htm

                              Please let me know if you have any questions.

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by aussugardefender, Today, 01:07 AM
                              0 responses
                              1 view
                              0 likes
                              Last Post aussugardefender  
                              Started by pvincent, 06-23-2022, 12:53 PM
                              14 responses
                              238 views
                              0 likes
                              Last Post Nyman
                              by Nyman
                               
                              Started by TraderG23, 12-08-2023, 07:56 AM
                              9 responses
                              383 views
                              1 like
                              Last Post Gavini
                              by Gavini
                               
                              Started by oviejo, Today, 12:28 AM
                              0 responses
                              1 view
                              0 likes
                              Last Post oviejo
                              by oviejo
                               
                              Started by pechtri, 06-22-2023, 02:31 AM
                              10 responses
                              125 views
                              0 likes
                              Last Post Leeroy_Jenkins  
                              Working...
                              X