Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 sidlercom80, 10-28-2023, 08:49 AM
          168 responses
          2,262 views
          0 likes
          Last Post sidlercom80  
          Started by Barry Milan, Yesterday, 10:35 PM
          3 responses
          10 views
          0 likes
          Last Post NinjaTrader_Manfred  
          Started by WeyldFalcon, 12-10-2020, 06:48 PM
          14 responses
          1,429 views
          0 likes
          Last Post Handclap0241  
          Started by DJ888, 04-16-2024, 06:09 PM
          2 responses
          9 views
          0 likes
          Last Post DJ888
          by DJ888
           
          Started by jeronymite, 04-12-2024, 04:26 PM
          3 responses
          41 views
          0 likes
          Last Post jeronymite  
          Working...
          X