Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Set Account Programmatically

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

    Set Account Programmatically

    Hi,

    How do I set the Account for a strategy to "Sim102" progammatically in State.SetDefaults?

    Regards

    #2
    Hello maltese,

    The Account is one setting that cannot be set from code specifically in a NinjaScript Strategy. (The account can be selected for addons)

    This needs to be set in the strategy parameters when running the strategy on a chart or from the Strategies tab of the Control Center. (It cannot be selected for the Strategy Analyzer)
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      I'm a little unclear, there's no way to adjust account size ($) or margin for back-testing strategies in the Strategy Analyzer? In the results, on what default account size are the cumulative profit/loss ($) calculated from?

      Wouldn't account size have a significant impact on back-test results due to slippage, commission fees and margin?

      Thanks

      Comment


        #4
        Hello emj1414,

        Thank you for your post.

        There are not account values in backtest as there is no account to reference. The SetStopLoss and SetProfitTarget do not use an account size but rather the strategy's position size.

        Backtests are performed over the historical data purely as a test of the strategy and not of the account values.

        Please let me know if you have any questions.

        Comment


          #5
          Originally posted by emj1414 View Post
          Wouldn't account size have a significant impact on back-test results due to slippage, commission fees and margin?
          Not really, you can set back testing results to include commissions and slippage. If you're backtesting on FX, the KPI's profit factor and percent profitable is the main KPI's I'm looking for when testing strategies.

          If you're planning on trading stocks, you can also program the "quantity" to be e.g. $10k per entry.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by NullPointStrategies, Yesterday, 05:17 AM
          0 responses
          71 views
          0 likes
          Last Post NullPointStrategies  
          Started by argusthome, 03-08-2026, 10:06 AM
          0 responses
          143 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          76 views
          0 likes
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          47 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Started by TheRealMorford, 03-05-2026, 06:15 PM
          0 responses
          51 views
          0 likes
          Last Post TheRealMorford  
          Working...
          X