Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

AccountSize

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

    #16
    Hello,

    i had so many problems with this, here is my experiences:
    In your strategy:
    • If you use default quantity, all trades will be submited always with the same quantity.
    • If you use AccountSize, all trades will be submited like it will count how many can be bought from AccountSize. (Eg, at FOREX trading, it uses Margin for counting.)
    Accourding to my experience if you use these two, then it will not use the quantity written in the code, eg:

    Code:
    EnterLong(50000);
    and profit result of these will not be added to AcoountSize. But you can reach profit result, use TradeCollection class and add it to AccountSize value (accourding to my oppinion) in OnExecution() method. At the next trade it will use new AccountSize value.
    • If you use "by strategy" you can define everything from the code.
    I hope it helps

    Comment


      #17
      Originally posted by NinjaTrader_Josh View Post
      Try using DefaultQuantity for the Enter() orders.
      Opps, this is new for me also, thanks

      Comment


        #18
        I tried, and accourding to my oppinion it did not add profit to AccountSize

        Comment


          #19
          You need to use ByAccountSize and not specify any quantity then if you want it to take control of the aggregation of the size.
          Josh P.NinjaTrader Customer Service

          Comment


            #20
            Originally posted by NinjaTrader_Josh View Post
            You need to use ByAccountSize and not specify any quantity then if you want it to take control of the aggregation of the size.
            Using my test case steps already posted, I've also tried using "by account size" and no quantity using EnterLong() as well as EnterLong(DefaultQuantity), and neither cause the AccountSize to update. Does anyone have any test case at all where it updates during a backtest? The order quantities do change to approximately match the AccountSize, but AccountSize itself is completely static throughout the backtest, similar to what others are reporting. This is the confusing part that I believe should be better documented.

            Comment


              #21
              Clarified with development, the AccountSize updates in the sense that it will help you keep the quantity dynamic for order placement, not in the sense that accessing the property will give you updated values.

              If you want to see actual AccountSize updates you will need to track with your own variables.
              Josh P.NinjaTrader Customer Service

              Comment


                #22
                Thanks for checking - please consider sending a note to the doc people to make note of this in the AccountSize topic, since it can be confusing.

                Comment


                  #23
                  Thank you for the suggestion. They will be informed.
                  Josh P.NinjaTrader Customer Service

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                  0 responses
                  648 views
                  0 likes
                  Last Post Geovanny Suaza  
                  Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                  0 responses
                  369 views
                  1 like
                  Last Post Geovanny Suaza  
                  Started by Mindset, 02-09-2026, 11:44 AM
                  0 responses
                  108 views
                  0 likes
                  Last Post Mindset
                  by Mindset
                   
                  Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                  0 responses
                  573 views
                  1 like
                  Last Post Geovanny Suaza  
                  Started by RFrosty, 01-28-2026, 06:49 PM
                  0 responses
                  575 views
                  1 like
                  Last Post RFrosty
                  by RFrosty
                   
                  Working...
                  X