Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Position Size based on account size

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

    Position Size based on account size

    I recently completed a strategy using the NT7 strategy wizard. I am very inexperienced in coding but I am happy with the outcome of this strategy. I have been looking on this site for suggestions on some way to change the order quantity according to account size. I am trading Futures contracts, and I am hoping to find some way to have the script get the account size, divide by 5000, and then round down to nearest whole number in order to allow $5000+ of margin per contract trading. I would also like it to update after each trade. Is there a good way to do this?
    Thanks.
    --Adam.

    #2
    Hello Adam,
    Welcome to the forum and I am happy to assist you.
    Unfortunately the strategy is for coding simple ideas. If you want to code a account size like you described, you have to unlock your code and edit it further in the NinjaScript editor.

    The GetAccountValue function will get you the account value and once you have it you can simply divide it with the margin amount. Please refer here for more on GetAccountValue http://www.ninjatrader.com/support/h...countvalue.htm

    You can check the values in the OnExection event for any updates after each trades http://www.ninjatrader.com/support/h...nexecution.htm

    Please let me know if I can assist you any further.
    JoydeepNinjaTrader Customer Service

    Comment


      #3
      Thanks for the help, I'll see what I can do with that.

      Comment


        #4
        Hello Adam,
        Thanks for your note.
        Please let me know if I can assist you any further.
        JoydeepNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        647 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
        572 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        573 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X