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

backtesting

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

    backtesting

    Hello. I am currently using the Strategy Analyzer. When I select ES futures, it runs fine and populates the results fields. However, when I then select NQ and run it, none of the fields get populated.
    I assume it's a data issue, but I currently have charts open that contain all the ES and NQ data that would be required to run the backtest.
    Any ideas?
    Thanks

    #2
    Hello stewarco,

    Thank you for the post.

    This could certainly be related to data, this can also relate to your conditions or even an error. When you run the test, are you seeing any errors in the Log tab of the control center of the output window?

    To confirm you have data, generally, you can do what you have said or open a chart and select the date range the same as you did in the analyzer along with the same bars type and timeframe/settings. The data should be there for the analyzer to use if you can see it in the chart and have used the same settings.

    This test can help make sure you have data but is only going to tell us there is data but wont tell is if that data was used or if some other problem happened. If you have the required data, but nothing happens you will likely need to add some Prints into your script to make sure the strategy is being executed.

    A simple test would be to add a print into OnBarUpdate like the following to make sure the strategy is being called while testing:

    Code:
    protected override void OnBarUpdate()
    {
    	Print(Time[0].ToString() + " Bar: " + CurrentBar);
    After adding this print and opening the NinjaScript output window, you should see prints for each bar when run in the analyzer. If not, please try restarting the analyzer or NinjaTrader to retest.

    If you see prints, the problem likely is with the conditions to trade not becoming true. You could also use prints to verify the values in your conditions if that is the case.

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      resolved

      Thanks for your reply. Not sure what I did exactly but it's working now. I enabled the strategy on the Strategies tab to check what showed up in the Output Window, and that seemed to populate the data somewhere such that the Analyzer then worked.
      Thanks.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by cre8able, Today, 03:20 PM
      1 response
      9 views
      0 likes
      Last Post cre8able  
      Started by fiddich, Today, 05:25 PM
      0 responses
      3 views
      0 likes
      Last Post fiddich
      by fiddich
       
      Started by gemify, 11-11-2022, 11:52 AM
      6 responses
      804 views
      2 likes
      Last Post ultls
      by ultls
       
      Started by ScottWalsh, Today, 04:52 PM
      0 responses
      4 views
      0 likes
      Last Post ScottWalsh  
      Started by ScottWalsh, Today, 04:29 PM
      0 responses
      9 views
      0 likes
      Last Post ScottWalsh  
      Working...
      X