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 CarlTrading, 03-31-2026, 09:41 PM
        1 response
        67 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        36 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        60 views
        1 like
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        62 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        53 views
        0 likes
        Last Post CarlTrading  
        Working...
        X