Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

strategy with historicals only

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

    strategy with historicals only

    How can I backtest my strategy while disabling it from live trading?

    #2
    Hi Afshinmoshrefi,

    Thank you for posting.

    You can use the Strategy Analyzer to run a backtest on your strategy.

    Note, you will need to have access to historical data to run the backtest.

    File>New>Strategy Analyzer
    On the left select the instrument you want to backtest.
    Click Backtest on the right edge of the window.
    Select the strategy and the parameters for the strategy you want to run.

    Below is a link to the online help guide on the Strategy Analzyer.
    http://www.ninjatrader.com/support/h...y_analyzer.htm

    Please let me know if I can be of further assistance
    Cal H.NinjaTrader Customer Service

    Comment


      #3
      I didn't do a good job asking the question. I would like to stop the strategy from live trading. however I want to look at the historical trades.

      Thanks,

      Afshin

      Comment


        #4
        Hi Afshin,

        The best method will be to use the Strategy Analyzer and run it with the same parameters that you have your chart set to. You can even look at a chart display, executions, and trades in the Strategy Analyzer.

        Additionally, you can run the strategy on your chart with the Sim101 account instead of your live account.

        Please let me know if I can be of further assistance
        Cal H.NinjaTrader Customer Service

        Comment


          #5
          I understand both - My question was how can I stop a strategy in code from trading live on a chart.

          Comment


            #6
            Hi Afshin,

            You can use this code snippet in the beginning section of the OnBarUpdate() to ensure that you will not trade live -
            Code:
            if(Historical == false)
            return;
            However, if you wanted to switch back to live you will need to comment our this snippet and reload NinjaScript on the chart.

            The other option is you can create a user defined input parameter for the Bool, so that you can change the true or false from the strategy parameters rather than the going to the code.

            Below is a link to a reference sample from the support forum on creating user defined input parameters.
            http://www.ninjatrader.com/support/f...ead.php?t=5782

            Please let me know if I can be of further assistance.
            Cal H.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            670 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            379 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            111 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            575 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            582 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X