Announcement

Collapse
No announcement yet.

1-min backtest with 15-min study fails

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

  • 1-min backtest with 15-min study fails

    I am working on a backtest using the 1-min chart, and for some reason if I add a 15-min interval study it fails to run the backtest without any error notice.

    For example:

    xUpperBB15 = upperBB(20, 1, inv(15));

    Everything backtests fine until I add the above line.

    If I change it to

    xUpperBB15 = upperBB(20, 1, inv("D"));

    that works fine...

    Any idea what I'm doing wrong or if there is some trick or is esignal having a jammer?

    Thanks,

    Robert

  • #2
    Hi Robert,

    On my end both seem to work fine on a 1 min chart.

    Wayne
    Attached Files

    Comment


    • #3
      Hi Wayne,

      Thanks for your help! I'm still having issues back testing using different intervals. It always displays on the chart itself fine, but back testing doesn't work.

      Here is an example, based on what you sent over.

      PHP Code:
      function preMain(){
          
      setPriceStudy(true);
          
      setDefaultBarFgColor(Color.blue,0);
          
      setDefaultBarFgColor(Color.red,1);
          
      setDefaultBarThickness(2,0);
          
      setDefaultBarThickness(3,1);
      }

      var 
      xUpperBB15;
      var 
      xUpperBB_D;
      var 
      bInit false;

      function 
      main(){
          if (!
      bInit){
              
      xUpperBB15 upperBB(201inv(15));
              
      xUpperBB15 getSeries(xUpperBB15);
              
      xUpperBB_D upperBB(201inv("D"));
              
      xUpperBB_D getSeries(xUpperBB_D);
          }
          
          if (
      xUpperBB15.getValue(0) > xUpperBB_D.getValue(0) && Strategy.isLong() == false){
              
      Strategy.doLong("Long"Strategy.MARKETStrategy.THISBAR);
          }
          if (
      xUpperBB15.getValue(0) < xUpperBB_D.getValue(0) && Strategy.isLong() == true){
              
      Strategy.doSell("Sell"Strategy.MARKETStrategy.THISBAR);    
          }
          
          return new Array(
      xUpperBB15xUpperBB_D);

      - Open a 1 minute chart with the study. Advanced Chart Time template = 1 day (for example)

      - Perform back-testing using study and time template = 90 days (for example)

      Result = "Back test complete" displays briefly yet no report shows up.

      IF you change the advanced chart time template to be 90 days for example and then run the back test using 90 days it works. BUT it doesn't seem to me that you should have to do that...

      Let me know if you get the same results.

      Thanks!

      Robert

      Comment

      Working...
      X