Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy Analizer questions

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

    Strategy Analizer questions

    Hello, I was looking through the help guide but I could not find an answer to my questions and if you could provide some information that would be great.

    1) During strategy optimization how does the data being fed into the strategy ? At the bar closure or tick by tick?

    2) During strategy optimization is it possible to set execution for all posible combination in the data ranges provided?

    Thanks a lot,

    #2
    Hello,

    1) When backtesting/optimization the events will be evaluated at the close of each bar. Please review our Help Guide article on Discrepancies: Real-Time vs Backtest



    2) Can you elaborate on this? Do you mean to optimize on tick vs minute vs range, etc? Or do you just want to run on range of values? (e.g., 1 minute to 60 minute)
    MatthewNinjaTrader Product Management

    Comment


      #3
      Thanks for the reply, I read that optimization does not go through all the values that you set in ranges to optimize strategy on, it picks patherns to achive the most for selected type of otpimization. So I was woundering if there is a setting to run optimization for all possible combinations in the ranges that you give to the strategy input fiels.

      Comment


        #4
        Hello,

        It will only pick patterns if you're using the genetic optimization.

        The standard optimization will be fully exhaustive and optimize on all possible combinations.
        MatthewNinjaTrader Product Management

        Comment


          #5
          Thank you for your reply, it really helped me to optimize my code for the "last tick in bar" order handling.

          I was wondering how the strategy execution is different in the Strategy Analyzer vs running it manually in terms of internal functions being executed by that I mean:

          1) when the Analyzer moves to the next value in data range what functions are being triggered in the strategy ? Same as if it would be added to the chart and enabled ?

          Initialize() >OnStartUp()>OnBarUpdate() ? Or the Strategy Analyzer skips some of it when looping through the values ?

          Comment


            #6
            Hello vitaliys,

            Thank you for your response.

            The Initialize(), OnStartUp(), and OnBarUpdate() methods will work the same on both real-time data and the Strategy Analyzer. The only difference here is you must remember that Backtesting always runs as CalculateOnBarClose = True, which means OnBarUpdate() is called on the close of a bar.

            For information on the Initialize(), OnStartUp(), and OnBarUpdate() methods please visit the following links:


            For information on CalculateOnBarClose pelase visit the following link: http://www.ninjatrader.com/support/h...onbarclose.htm

            Please let me know if I may be of further assistance.

            Comment


              #7
              Thanks ! running smoothly,! could you take a look at the screenshot below, it looks like the application is not using a lot of CPU but using a lot of RAM. Is there any way to make it run faster? I already set the process priority to "High" I'm running optimization on 18 day period but with quite a lot of parameters. Not sure if its hanging or not, Control Centre's window is greyd out as you can see in the background.
              Attached Files
              Last edited by vitaliys; 08-19-2012, 10:01 PM.

              Comment


                #8
                Hello vitaliys,

                Thank you for your post.

                You can find performance tips for the NinjaTrader 7 platform at the following link: http://www.ninjatrader.com/support/h...ance_tips2.htm

                So I may investigate this matter further please send me your log and trace files to support[at]ninjatrader[dot]com for today so that I may look into what occurred. In addition, please advise how many Workspaces you have open and the size of your database file which can be found by going to Documents-->NinjaTrader 7-->db folder and the database will be named "NinjaTrader.sdf".

                You can send your log and trace files by going to the Control Center-> Help-> Mail to Support.

                Please reference this thread in the body of your e-mail: http://www.ninjatrader.com/support/f...ad.php?t=51300
                And include "ATTN: Patrick" in the subject line.

                I look forward to assisting you further.
                Last edited by NinjaTrader_PatrickH; 08-20-2012, 07:38 AM.

                Comment


                  #9
                  Thanks Patrick for the support, I think I found two issues with my code, first I compiled it in Debug mode and second I need to put condition on the Print statements so I could turn it off for the optimization runs so it wouldn't consume CPU on logging messages. Let me do these changes and I will update on the results.

                  Is there a function to save "Optimization Template" with optimization values ?

                  Update: I have excluded pint function from the code with condition and disabled the debugging mode, see the screenshot for the details. I see more CPU activity going through as well as activity in page file, its ranging from 700mb - 1.6GB. DB file size is about 6 mb but time stamp in "modified date" field is not changing during the test and "Control Center" window looks greyed out not sure if its normal.
                  Attached Files
                  Last edited by vitaliys; 08-20-2012, 10:32 AM.

                  Comment


                    #10
                    Don't know if this will help as you seem to have found a few things to help your high ram, but here is an awesome video that someone posted on another thread to eliminate that issue.



                    Thanks to the person who posted this as I certainly didn't know anything about setting Vitual Memory.

                    Good luck.

                    Comment


                      #11
                      Thanks for the link, I already changed my page file settings, since my 16GB of ram wasn't enough and the windows would shut down NinjaTrader due to lack of RAM lol. Please see my previous post for the updates. I can't get to the Control Center menu to get the logs.

                      my system configuration
                      16GB DDR3 2133
                      CPU i7-3930k
                      SSD system drive

                      Win7 Sp1 64 bits,
                      Running NinjaTrader 64 bits
                      Last edited by vitaliys; 08-20-2012, 10:50 AM.

                      Comment


                        #12
                        Hello vitaliys,

                        Thank you for your response.

                        Your database is about average in size. Please manually attach your log and trace files to your response and please advise how many Workspaces you have open.

                        You will find the log file on your PC in the (My) Documents > NinjaTrader 7 > Log folder.
                        • The log file will be named "log.20120820.txt"

                        You will find the trace file on your PC in the (My) Documents > NinjaTrader 7 > Trace folder.
                        • The trace file will be named "trace.20120820.txt"

                        Please send your e-mail to support[at]ninjatrader[dot]com with your log and trace files attached.
                        Please reference this thread in your e-mail: http://www.ninjatrader.com/support/f...ad.php?t=51300
                        Please also place "ATTN: Patrick" in the subject line.

                        I look forward to assisting you further.

                        Comment


                          #13
                          Concerning this statement :

                          "
                          The Initialize(), OnStartUp(), and OnBarUpdate() methods will work the same on both real-time data and the Strategy Analyzer. The only difference here is you must remember that Backtesting always runs as CalculateOnBarClose = True, which means OnBarUpdate() is called on the close of a bar.
                          "

                          Does it mean that the Strategy Analyser can work with a strategy with CalculateOnBarClose =False , meaning that OnBarUpdate() is called on the close of the bar ( as if CalculateOnBarClose =True) ?

                          Regards

                          Comment


                            #14
                            Ggeib,

                            That is correct.

                            You can add intrabar granularity to backtests using the following : http://www.ninjatrader.com/support/f...ead.php?t=6652
                            Adam P.NinjaTrader Customer Service

                            Comment


                              #15
                              My whole code was built with the idea of CalculateOnBarClose = True calculations, but it looks like Market Position does not go flat after ExitLong(); command , at least not right away it looks like it goes through all code , so to say finished all actions and only then renders market position flat state on the OnBarUpdate() event during historical calculations after I added condition to check that the market state is flat I got rid of all the error messages , but can't reverse now on the same bar.

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by Tim-c, Today, 03:54 AM
                              0 responses
                              3 views
                              0 likes
                              Last Post Tim-c
                              by Tim-c
                               
                              Started by FrancisMorro, Today, 03:24 AM
                              0 responses
                              2 views
                              0 likes
                              Last Post FrancisMorro  
                              Started by Segwin, 05-07-2018, 02:15 PM
                              10 responses
                              1,770 views
                              0 likes
                              Last Post Leafcutter  
                              Started by Rapine Heihei, 04-23-2024, 07:51 PM
                              2 responses
                              31 views
                              0 likes
                              Last Post Max238
                              by Max238
                               
                              Started by Shansen, 08-30-2019, 10:18 PM
                              24 responses
                              945 views
                              0 likes
                              Last Post spwizard  
                              Working...
                              X