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

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 llanqui, Today, 03:53 AM
            0 responses
            4 views
            0 likes
            Last Post llanqui
            by llanqui
             
            Started by burtoninlondon, Today, 12:38 AM
            0 responses
            10 views
            0 likes
            Last Post burtoninlondon  
            Started by AaronKoRn, Yesterday, 09:49 PM
            0 responses
            14 views
            0 likes
            Last Post AaronKoRn  
            Started by carnitron, Yesterday, 08:42 PM
            0 responses
            11 views
            0 likes
            Last Post carnitron  
            Started by strategist007, Yesterday, 07:51 PM
            0 responses
            14 views
            0 likes
            Last Post strategist007  
            Working...
            X