Announcement

Collapse
No announcement yet.

Backtesting time span - how to control.

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

  • Backtesting time span - how to control.

    Hi there,

    how do I control the backtesting time span (ex. if I want to test from 1/1/2002 - 2/2/2003).

    I am actually not currently interested in specifying the time to the dot, but rather curious about something that seem to happen almost at random:

    Many times, the backtest seem to run the the bars (period) loaded, i.e. by scrolling back in the display before testing.
    On this one I only get a limited time for the backtest, whilst on the display I can actually see futher back, with indication of trades done (I set the background colour when in trade), thus I know the script is working.

    Hope I make myself understood...

    All the best...
    CJ

  • #2
    CJ
    Without seeing the efs it may be difficult to determine why that would happen.
    When you set the background color do you do that in the context of the same conditions that trigger the trades? If so you may want to try separating the commands that paint the background and base them on specific isLong/isShort conditions after the trades are triggered and see if the background still gets painted.
    Even though you are not necessarily looking for a specific way of controlling the back testing times you may want to look at the trade permission.efs which is posted here
    Alex

    Comment


    • #3
      Originally posted by Alexis C. Montenegro
      CJ
      Without seeing the efs it may be difficult to determine why that would happen.
      When you set the background color do you do that in the context of the same conditions that trigger the trades? If so you may want to try separating the commands that paint the background and base them on specific isLong/isShort conditions after the trades are triggered and see if the background still gets painted.
      Even though you are not necessarily looking for a specific way of controlling the back testing times you may want to look at the trade permission.efs which is posted here
      Alex
      Hi Alex,

      thank you for your answer, though I think I might not have explained proper what my problem is:

      When I load ex. 5-min bars into eSignal, I currently get back to about 1st May 2005 (for DJ #f).

      When inserting the formula on this, all is fine and I see the results clearly.

      When I following go to use proper backtest on the chart, it only backtests from 30th Sep until today... in other words, a measly 10 days worth of testing.

      So this is not a script problem per se, alas rather a matter of a very limited time period made available to the backtester.

      Is there anyway that I can force the bactester to take all data that is available to me, i.e. going back to about May (like available to charting)?

      All the best, and thank for your reply!
      CJ

      Comment


      • #4
        CJ
        All the data that is loaded in a chart is available to the Back Testing module (see enclosed images).
        Alex



        Comment


        • #5
          Originally posted by Alexis C. Montenegro
          [B]CJ
          All the data that is loaded in a chart is available to the Back Testing module (see enclosed images).
          Alex
          Alex, simply not the case here, as can be seen from my screenshots below.

          CJ

          EDIT: Sorry, pics above.
          Last edited by C-J; 10-09-2005, 09:26 AM.

          Comment


          • #6
            Pics...
            Attached Files

            Comment


            • #7
              ...
              Attached Files

              Comment


              • #8
                CJ
                I understand that but as I said in my prior reply it is difficult to determine why this may be happening without seeing the efs.
                Try running another efs such as btMovingAverage.efs (which is what I used) that is in the Back Testing folder and see if the issue persists
                Alex

                Comment


                • #9
                  Originally posted by Alexis C. Montenegro
                  CJ
                  I understand that but as I said in my prior reply it is difficult to determine why this may be happening without seeing the efs.
                  Try running another efs such as btMovingAverage.efs (which is what I used) that is in the Back Testing folder and see if the issue persists
                  Alex
                  Hi Alex,

                  on your suggestion, I have tried that. The backtest still limits itself to start date of 30 Sep 2005.

                  As you can see from the screen cap, the backtester states that as the start date. Surely that is independent of the script itself (unless I have misunderstood and the startdate is that of the first actual trade encountered)?

                  CJ

                  Comment


                  • #10
                    CJ
                    That is the date of the first trade. In the enclosed image you can see that the date matches that of the first trade reported in the Trades tab
                    Alex

                    Comment


                    • #11
                      Originally posted by Alexis C. Montenegro
                      CJ
                      That is the date of the first trade. In the enclosed image you can see that the date matches that of the first trade reported in the Trades tab
                      Alex
                      Alex, having just tried the BtMovingAverage.efs again, just to make sure, it does colour code my chart all the way back to the beginning (April), i.e. the trades are 'taken' on the chart.
                      The backtester limits itself to 30 Sep still.

                      Could any distinction be made between getting data from the data manager (for the backtester) as opposed to cached data (for the charts themselves)?
                      I know I am clutching at straws, but it's just not likely that both scripts contain the same error (especially as the BtMovingAverage.efs script has not been altered).
                      Also, it - both of them - works fine on the chart.

                      You asked... the logic for the background colouring is seperate to the chart logic in my script, simply:
                      if (BG_COLOR == "Yes")
                      { if(Strategy.isLong())
                      { setBarBgColor(Color.RGB(200, 240, 200)); }
                      else if(Strategy.isShort())
                      { setBarBgColor(Color.RGB(240, 200, 200)); }
                      }

                      Again, why would it work on the chart but not in the backtester... unless I have some more general settings wrong somewhere.

                      I am stumped! Any suggestions would be welcome, Alex.

                      CJ

                      Comment


                      • #12
                        CJ
                        In looking again at the images you posted I noticed that you have the Time Template set to Dynamic. Edit the Time Template you have applied to that chart and add a User Defined 5 min Interval setting it to load 120 Days (include Start/End Times if required). Then run the Back Test again and see if that fixes your problem.
                        Alex

                        Comment


                        • #13
                          Originally posted by Alexis C. Montenegro
                          CJ
                          In looking again at the images you posted I noticed that you have the Time Template set to Dynamic. Edit the Time Template you have applied to that chart and add a User Defined 5 min Interval setting it to load 120 Days (include Start/End Times if required). Then run the Back Test again and see if that fixes your problem.
                          Alex
                          Alex, that did the trick, very astute.

                          Thank you!

                          CJ

                          Comment

                          Working...
                          X