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 nailui, Today, 07:26 AM
          1 response
          28 views
          0 likes
          Last Post NinjaTrader_Spencer  
          Started by chartchartchart, Today, 08:08 AM
          1 response
          5 views
          0 likes
          Last Post NinjaTrader_Emily  
          Started by andreslazor7, Today, 08:08 AM
          2 responses
          14 views
          0 likes
          Last Post andreslazor7  
          Started by FatCanary, Today, 08:09 AM
          2 responses
          9 views
          0 likes
          Last Post FatCanary  
          Started by vantojo, 01-12-2021, 02:13 PM
          15 responses
          197 views
          0 likes
          Last Post FatCanary  
          Working...
          X