Announcement

Collapse
No announcement yet.

inaccurate backtests

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

  • inaccurate backtests

    i have no idea what the problem might be, but i ran a backtest last night after the markets closed on a 144T chart and i printed out the results of the backtest. this morning i ran the same backtest yet somehow the results are different, the number of trades that occured yesterday, the net profit for yesterday, everything. could anyone please explain what could be going on here?

  • #2
    kalzenith,

    If the strategy efs did not change between backtest runs, then most likely the historical data was not identical.

    You would have to insure the time template you are using is the same for both runs.

    In the future if you post the strategy efs code then there is a greater chance that someone can offer asssistance.

    Glen
    Glen Demarco
    [email protected]

    Comment


    • #3
      the time template is exact, i never change it, but here is the code, i apologize for it being uncommented, if you need help understanding something, just ask. (PS: i used the old way to use MACD because i wanted it to calculate using simple moving averages, not exponential)

      PHP Code:
      var LastEntry 0;
      var 
      StudyCount 2;
      var 
      v1 0;
      var 
      v2 0;
      var 
      v3 0;
      var 
      v4 0;
      var 
      v5 0;
      var 
      vMACD115_116_39 = new MACDStudy(11511639'Close'true);

      function 
      main() {
          
      setColorPriceBars(true);
          
      setPriceStudy(false);
          
      setStudyTitle('Formula Finder 1.2');
          
      setCursorLabelName('Formula Finder'0);
          
      setDefaultBarFgColor(Color.blue0);
          
      setPlotType(PLOTTYPE_HISTOGRAM0);
          
      setDefaultBarThickness(50)

      if (
      vMACD115_116_39.getValue(MACDStudy.HIST) > 0v1 1
      if (vMACD115_116_39.getValue(MACDStudy.HIST) < 0v1 = -1

      if (sma(84) < close()) v2 1
      if (sma(84) > close()) v2 = -1

      if(v1 v2 v3 v4 v5 == StudyCount && Strategy.isLong() == false) {
          
      Strategy.doLong(''Strategy.CLOSEStrategy.THISBARStrategy.DEFAULT, 0)
      }
      if(
      v1 v2 v3 v4 v5 == StudyCount*-&& Strategy.isShort() == false) {
          
      Strategy.doShort(''Strategy.CLOSEStrategy.THISBARStrategy.DEFAULT, 0)
      }

      setPriceBarColor(Color.RGB(128128128))
      if (
      Strategy.isShort() == truesetPriceBarColor(Color.RGB(255,0,0))
      if (
      Strategy.isLong() == truesetPriceBarColor(Color.RGB(0,255,0))

      setBarBgColor(Color.RGB(128128128))
      if (
      Strategy.isShort() == truesetBarBgColor(Color.RGB(255,0,0))
      if (
      Strategy.isLong() == truesetBarBgColor(Color.RGB(0,255,0))

      return 
      v1 v2 v3 v4 v5


      Comment


      • #4
        kalzenith,

        The code looks straight forward enoug, no problem with the comments at all, the code is easy to read.

        What symbol and time interval did you experience the differing backtesting results?


        Can you post the the time templates parameters?

        If you still have the differing back tester reports check the report "settings" tab and see if the time span is identical for both, along with the other settings.

        It's possible that you received a bad price that may have been corrected.

        If that doesn't do it, you can email me at [email protected] as there are a few other possibilities that we can talk about after the close on the phone as things are getting too busy I won't be on the forum again today.

        Glen
        Glen Demarco
        [email protected]

        Comment


        • #5
          the discrepency occurred on QQQQ with an interval of 144T with the default 24 hour time template (0 days, start time 0:00, end time 0:00) i unfortunately didnt print out the settings page last night, but i can be relatively certain it is the same since i didnt change anything myself. i would like to think that there was just one bad tick that has been corrected, but this is the second time it has happened to me on 2 different EFS studies. the first time being over this past weekend

          Comment

          Working...
          X