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 xiinteractive, 04-09-2024, 08:08 AM
          5 responses
          13 views
          0 likes
          Last Post NinjaTrader_Erick  
          Started by swestendorf, Today, 11:14 AM
          2 responses
          5 views
          0 likes
          Last Post NinjaTrader_Kimberly  
          Started by Mupulen, Today, 11:26 AM
          0 responses
          2 views
          0 likes
          Last Post Mupulen
          by Mupulen
           
          Started by Sparkyboy, Today, 10:57 AM
          1 response
          6 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Started by TheMarlin801, 10-13-2020, 01:40 AM
          21 responses
          3,918 views
          0 likes
          Last Post Bidder
          by Bidder
           
          Working...
          X