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

Trades from previous walk-foward days

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

    Trades from previous walk-foward days

    Hello good afternoon,

    I'm backtesting a strategy using walk-forward analysis.
    Using:
    10min bars;
    Kind of a moving average cross-over requiring a max of 100 bars for calculation (max value for optimizer in that which is the lengthiest);
    10 days optimization - 2 days walk-forward;
    Strategy stops at 1900 hours everyday;

    Already setup minimum bars required in the strategy analyzer to 100.



    I'm having the issue displayed in the images. Could you please clarify what is happening?
    In this example the walk-forward is considering the past 2 days and showing the pl for that trade regarding the previous period in the chart in question the subsequent 2 days.


    Thank You Very Much
    Attached Files

    #2
    Hi hliboi,

    I am not quite sure what you are trying to point out in the first screenshot.

    In the second screenshot I am seeing there are orders filled far outside the bar.

    How are these orders being placed? Can we see the code that has placed these orders?

    What is the expected behavior?

    May we have a screenshot of the parameters used for this script?

    To send a screenshot press Alt + PRINT SCREEN to take a screen shot of the selected window. Then go to Start--> Accessories--> Paint, and press CTRL + V to paste the image. Lastly, save as a jpeg file and send the file as an attachment.

    For detailed instructions please visit the following link
    http://take-a-screenshot.org/
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      The first screenshot shows the trade that filled outside the bar. It corresponds to the day before.

      I will post the screenshots later, for now i´m unable.

      Thank You

      Comment


        #4
        Hello,

        What i'm getting is trades from past days in the walk forward using the optimized setting from the periods after.

        Can you see it better?

        Thank You

        edit: and its counting double the trades and the settings are equal to those of the after walk-forward days.
        Attached Files
        Last edited by hliboi; 06-21-2014, 11:37 AM.

        Comment


          #5
          Hello hliboi,

          Thank you for your response.

          May we test the strategy on our end as well. You will find the strategy in the following directory on your PC: (My) Documents\NinjaTrader 7\bin\Custom\Strategy

          You can attach it to your response or send it to support[at]ninjatrader[dot]com with 'ATTN: 1097600' in the subject line and a reference to this thread in the body of the e-mail: http://www.ninjatrader.com/support/f...ad.php?t=66939

          Comment


            #6
            Hello Patrick,

            There is no need to share any, although i would. But you can see the same bug using the sample ma strategy. Try using 10 Days optimize 2 days walkforward. Or lets say 25 days optimize 5 days wf.

            I tested with various strategie.

            Could you please see the issue.

            Thank you

            Comment


              #7
              Hello hliboi,

              Thank you for your response.

              Can you advise what session template you are using in these tests?

              Comment


                #8
                Hello,
                Thought about that also.

                Well I used Forex default template for the currencies. Then modified that template for gmt 0hours. For the futures used default template ETH. Did get some different results but still the same problem.

                Also reseted the Db and the results from the strategy differ greatly from those before (used brute force for both same settings, same template, same everything)

                Did you manage to reproduce the error?

                I'm using 2 pcs. One w7 32bit another w7 64bit. Same issue regarding the wf from one day before the period stipulated for wf. I quite relieved that it also shows loosing trades but still the majority are trades that are very profitable which seems to be part of the curve fitting process as it is applying the parameter settings used in those preceding days it seems.

                Thank You
                Attached Files
                Last edited by hliboi; 06-23-2014, 12:29 PM. Reason: adding pics for example and to show chart

                Comment


                  #9
                  Hello hliboi,

                  Thank you for your response.

                  When using session templates that are 24 hrs with times cross multiple days (e.g. FOREX session template), it is expected that doing things like backtests will include trades from seemingly the date before and the date after. This is because those dates are required to get the full trading session as defined by the session template.

                  When running walk forwards with the FOREX session template (or similar), each walk forward period may double count trades on "transition" dates. This is a limitation.

                  Example scenario:
                  • First period is 1/29 to 2/25. Second period is 2/26 to 3/25.
                  • First period counts trades from 1/28 to 2/26.
                  • Second period counts trades from 2/25 to 3/26.

                  There is an overlap of two days of 2/25 and 2/26 being double counted between each walk forward period.

                  Comment


                    #10
                    Thanks Patrick

                    Could you post a solution?

                    Should one put the end at 23.59? In this strategy i'm using a sort of moving average so i need all bars from the day. I'm also using a strategy without ma's so that shouldn't be a problem.

                    What about the CME FX ETH template where it stops for one hour?

                    Thank You
                    Attached Files
                    Last edited by hliboi; 06-23-2014, 02:13 PM. Reason: add pic

                    Comment


                      #11
                      Hello hliboi,

                      Thank you for your response.

                      The solution is not to use a session template that would span across more than one day for your time zone and avoid 24 hour session templates.

                      Comment


                        #12
                        Hello Patrick,

                        I would like to say thanks first of all. Secondly I'll have to add that most of my strategies have now poor results. Please Patrick make a sticky where that limitation in cleary spoken of. But know i get true results i guess.
                        Could you please clarify the template of cme eth template and also why after reset the db the results have changed.

                        Thanks

                        Comment


                          #13
                          Hello hliboi,

                          Thank you for your response.

                          Which CME ETH template? Are you speaking of the CME FX Futures ETH or US Index ETH?

                          Resetting the database will set the instruments and Session Templates back to their original values.

                          Comment


                            #14
                            Hello,

                            I can`t stop Walkforward from double counting results, even when the session template does NOT cross over a 24 hour period.

                            I`ve included a screen scrape of WFO for YM 12-15 which includes a view of the session template being used.

                            The test is just to Optimize 1 day (9/10/2014 THU) and Walkforward 1 day (9/11/2015 FRI).

                            As you can see the WFO trades of for both days and should ONLY be for 9/11/2015.

                            Can you please tell me what I can do to stop WFO from double counting results.

                            Thank you
                            Attached Files
                            Last edited by rayko; 11-29-2015, 03:44 AM.

                            Comment


                              #15
                              Hello Rayko,

                              Thank you for your post.

                              This is due to how the sessions can bleed into the next. You can find detail on this matter at the following link: http://ninjatrader.com/support/forum...ad.php?t=71832

                              Please let me know if you have any questions.

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by cls71, Today, 04:45 AM
                              0 responses
                              1 view
                              0 likes
                              Last Post cls71
                              by cls71
                               
                              Started by mjairg, 07-20-2023, 11:57 PM
                              3 responses
                              213 views
                              1 like
                              Last Post PaulMohn  
                              Started by TheWhiteDragon, 01-21-2019, 12:44 PM
                              4 responses
                              544 views
                              0 likes
                              Last Post PaulMohn  
                              Started by GLFX005, Today, 03:23 AM
                              0 responses
                              3 views
                              0 likes
                              Last Post GLFX005
                              by GLFX005
                               
                              Started by XXtrader, Yesterday, 11:30 PM
                              2 responses
                              12 views
                              0 likes
                              Last Post XXtrader  
                              Working...
                              X