Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy feature: Order quantity by account size missing?

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

    Strategy feature: Order quantity by account size missing?

    In NT7, when you set the Order quantity of a strategy, you have the option to do that with Account size, i.e. you can set the dollar size of the position. This seems to be missing in NT8.... I run all my strategies in NT7 with Account size, as I like to size my positions based on dollar value. Plus you can't do proper backtest without this feature for instruments whose price changed a lot over time.

    Is there a way to set order quantity by account size? If not, please put this feature back in NT8.

    #2
    Hello mic414,

    Thank you for your feed back on this item.

    The set order quantity by account size option was not included with NinjaTrader 8.

    I have submitted a feature request on your behalf to add this functionality to NT8. Once I have a tracking ID for this request I will post this in this thread for future reference.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hello mic414,

      Our development has let me know the following:
      We have decided to remove the "ByAccountSize" option for strategies since the concept no longer works if a margin template is not applied (which you can't apply to a live account). As its usage was limited and any strategy developer would program their own such quantity math in the strategy itself for the most part. Moving forward, we will be advising clients to move over to calculating the quantity size in the strategy with custom calculations.

      Utilizing AccountItem pull the information you would like: http://ninjatrader.com/support/helpG...ccountitem.htm

      You will need to calculate what margin to use on each trade.
      Chelsea B.NinjaTrader Customer Service

      Comment


        #4
        Hi Chelsea,
        Could you post some sample code as to how one would define order quantity by order size?
        Thanks,

        Comment


          #5
          Hello aaadetos,

          You should confirm with your broker the formula for calculating the funds required for each trade or contract.

          In general the formula would be the Account CashValue divided by Margin.

          The AccountItem.CashValue can be found from an account with Account.Get().

          Last edited by NinjaTrader_ChelseaB; 07-21-2020, 02:41 PM.
          Chelsea B.NinjaTrader Customer Service

          Comment


            #6
            Originally posted by NinjaTrader_ChelseaB View Post
            Hello mic414,

            Our development has let me know the following:
            We have decided to remove the "ByAccountSize" option for strategies since the concept no longer works if a margin template is not applied (which you can't apply to a live account). As its usage was limited and any strategy developer would program their own such quantity math in the strategy itself for the most part. Moving forward, we will be advising clients to move over to calculating the quantity size in the strategy with custom calculations.

            Utilizing AccountItem pull the information you would like: http://ninjatrader.com/support/helpG...ccountitem.htm

            You will need to calculate what margin to use on each trade.
            This makes perfect sense if someone is writing NinjaScript however it falls apart since there is no way to access AccountValue info from the Strategy Builder. Since "by account size" wasn't perfect it was removed yet if you look over the NT7 forum entries a lot of people seem to use it and it works well for them.

            Any update on the feature request ID?

            Comment


              #7
              Hello mic414,

              I have received an ID for your request. Your request to add an option to set the quantity by account size is being tracked with ID #SFT-1645.

              Please note it is up to the NinjaTrader Development to decide if and when a request will be implemented.
              Chelsea B.NinjaTrader Customer Service

              Comment


                #8
                Has this been added? Unless I am missing something, how do you backtest or optimize using a given number of shares when the share price varies over time? I need the Account Size.

                Comment


                  #9
                  Hello Ram011558,

                  You would need to calculate this in your script. You could use an input to allow the user to set the account size, or you could query the account balance by finding an account and using the AccountItem.CashValue with Account.Get().

                  (small edit for clarity)
                  In general the formula would be the Account CashValue divided by Margin.
                  Last edited by NinjaTrader_ChelseaB; 08-31-2017, 07:52 AM.
                  Chelsea B.NinjaTrader Customer Service

                  Comment


                    #10
                    OK. So the Account Size would need to be programmed. That said, without any programming, can the desired dollars traded be set? So instead of needing to specify that I want to trade 4000 units when the price is $25, I could specify $100,000 and NT8 would do the calculation?
                    Last edited by Ram011558; 08-28-2017, 06:25 PM.

                    Comment


                      #11
                      Hello Ram011558,

                      Unfortunately, this would be the ByAccountSize input in NinjaTrader 7 which was not included with NinjaTrader 8.

                      No, without any programming NinjaTrader 8 will not calculate a quantity from a dollar amount in put.

                      Please let me know if this does not clarify.
                      Chelsea B.NinjaTrader Customer Service

                      Comment


                        #12
                        Thank you. It does clarify but I have to say that I am taken back by this. The basis for having the strategy wizard is to allow those with no programming knowledge the ability to build and test strategies. Since prices vary widely over time, the current configuration makes this impossible. Seems crazy to me for what is likely a fairly easy fix. I'm guessing I'm not the only person in this boat.

                        Comment


                          #13
                          Hello Ram011558,

                          The Strategy Builder is capable of creating simple scripts.

                          More complicated concepts such as scripts that need to do math, accumulate values, or if you would like to do optimizing over inputs that are not typically optimizable are more advanced than what the Strategy Builder is able to do and may require that you unlock the script and code manually.

                          This makes the Strategy Builder a great starting point for generating the framework and setup of the script and will generate a much of the basic code so this does not have to be written by hand.
                          Chelsea B.NinjaTrader Customer Service

                          Comment


                            #14
                            Ok. Thank you. Sorry for my lack of knowledge with this. I would like to convert from 7 to 8 but this has been holding me back. So within the Strategy Builder I could specify an account and use a dollar value for Backtesting correct? During actual trading, I could specify a dollar value from my real account? For instance, I would like to trade $20K out of the total $100K in the account as an example. In other words, this would work in the same way that Account Value works in NT7?

                            If this is true, can you tell me how to do this or point me in a direction for online documentation. Thank you for the help.

                            Comment


                              #15
                              Hello Ram011558,

                              No, the 'Set order quantity' option 'by account' in NinjaTrader 7 does not exist in NinjaTrader 8.

                              You would need to create your own input, unlock your script, and calculate a quantity size in the logic your script.

                              The formula in general is Account CashValue divided by Margin

                              The Strategy Builder is not capable of math and would require that you make this modification after unlocking the strategy.
                              Last edited by NinjaTrader_ChelseaB; 08-31-2017, 07:54 AM.
                              Chelsea B.NinjaTrader Customer Service

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by bortz, 11-06-2023, 08:04 AM
                              47 responses
                              1,605 views
                              0 likes
                              Last Post aligator  
                              Started by jaybedreamin, Today, 05:56 PM
                              0 responses
                              8 views
                              0 likes
                              Last Post jaybedreamin  
                              Started by DJ888, 04-16-2024, 06:09 PM
                              6 responses
                              18 views
                              0 likes
                              Last Post DJ888
                              by DJ888
                               
                              Started by Jon17, Today, 04:33 PM
                              0 responses
                              4 views
                              0 likes
                              Last Post Jon17
                              by Jon17
                               
                              Started by Javierw.ok, Today, 04:12 PM
                              0 responses
                              13 views
                              0 likes
                              Last Post Javierw.ok  
                              Working...
                              X