Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Debug strategy

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

    Debug strategy

    I want to debug my strategy.

    In Strategy Analyzer, how do I do that?

    (I have Visual Studio 2010).

    I loaded the strategy c# script from \Documents\NinjaTrader 7\bin\Custom\Strategy in VS, and set the break points in OnBarUpdate(). Enabled debug mode in Strategy editor. Hit Run Strategy in Strategy Analyzer. Nothing happens. Why?
    Last edited by yubo27; 10-12-2012, 03:40 PM.

    #2
    Hello,

    Your strategy is located in (My) Documents\NinjaTrader 7\bin\custom\Strategy\<your strategy name>.cs

    Please also see our Help Guide article on Visual Studio Debugging - http://www.ninjatrader.com/support/h..._debugging.htm
    MatthewNinjaTrader Product Management

    Comment


      #3
      I loaded the strategy c# script from \Documents\NinjaTrader 7\bin\Custom\Strategy in VS, and set the break points in OnBarUpdate(). Enabled debug mode in Strategy editor. Hit Run Strategy in Strategy Analyzer. Nothing happens. Why?

      Comment


        #4
        Is OnBarUpdate even being called?

        Can you try debugging the SampleMACrossOver.cs and see if you can get any results?
        MatthewNinjaTrader Product Management

        Comment


          #5
          Please note I'm backtesting historical data.

          Breakpoints don't get hit.

          Also, I don't see historical data I imported using Historical Data Manager available as input in Strategy Analyzer.

          Comment


            #6
            I hit "Run Backtest" in Strategy Analyzer. No break points are hit. eg. OnBarUpdate()

            when you say "debug", do you mean "Compile" in Strategy editor?

            I'm trying to debug backtesting historical data in Strategy Analyzer.

            Comment


              #7
              What symbols did you import data for and what interval?

              Do you see this data from Tools--> Historical Data Manager--> Edit tab?
              MatthewNinjaTrader Product Management

              Comment


                #8
                Yes I imported several data series (eg. CL 09-12), but none of them show up in Strategy Analyzer.

                They are available in Historical Data Manager.

                Comment


                  #9
                  You will need to add these to your instrument list under Tools--> Instrument Manager

                  Please see our Help Guide on adding instruments to a list:

                  MatthewNinjaTrader Product Management

                  Comment


                    #10
                    My "CL 11-12" has been added using Instrument Manager.
                    But the backtest is not picking up the correct historical data (imported) time frame, which is set to 8/14 to 9/14. In debug, the first Time[0] comes as dated 9/11.
                    Why is that?
                    How to associate imported historical data to Instrument?

                    Comment


                      #11
                      Hello yubo27,
                      Can you please verify from the Historical Data Manager>Edit tab that you have necessary historical data for the backtest.


                      Also please let me know if you are connected to any data feed provider or you are simply importing the historical data.
                      JoydeepNinjaTrader Customer Service

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                      0 responses
                      648 views
                      0 likes
                      Last Post Geovanny Suaza  
                      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                      0 responses
                      369 views
                      1 like
                      Last Post Geovanny Suaza  
                      Started by Mindset, 02-09-2026, 11:44 AM
                      0 responses
                      108 views
                      0 likes
                      Last Post Mindset
                      by Mindset
                       
                      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                      0 responses
                      572 views
                      1 like
                      Last Post Geovanny Suaza  
                      Started by RFrosty, 01-28-2026, 06:49 PM
                      0 responses
                      574 views
                      1 like
                      Last Post RFrosty
                      by RFrosty
                       
                      Working...
                      X