Can you change Detrend between cycles?

Posted By: Dalla

Can you change Detrend between cycles? - 08/21/17 05:48

I'm tried modifying one of my scripts to run first with Detrend = 0, and then the rest of the runs with Detrend = SHUFFLE. The idea was to first get the profit of the strategy, and then run a robustness test (from Alice4b) in the rest of the runs using input from the first run.

Code:
if(Test) {
		NumTotalCycles = 11;
		if (TotalCycle > 1) {
			Detrend = SHUFFLE;
		}
	}



Alice4b code, modified to use input from first cycle

Code:
function evaluate()
{
  static int TestProfit = 0;
  if (TotalCycle == 1) {
    TestProfit = Balance;
  } else {
    //var TestProfit = 13559;
    static int Count = 0;
    if(Balance > TestProfit)
    Count++;

    var Bucket = floor(Balance/250);
    Bucket *=3;
    plotBar("Profit",Bucket,250*Bucket,1,SUM+BARS+LBL2,RED);
    plotBar("TestProfit",3*floor(TestProfit/250)+1,250*floor(TestProfit/250),1,BARS+LBL2,BLUE);

    if(TotalCycle == NumTotalCycles) {
      var Probability = (100.*Count)/NumTotalCycles;
      printf("n-------------------------------------------");
      printf("nBase system profit was: %f",TestProfit);
      printf("nReality Check: %.1f%% Random Probability",Probability);
      if(Probability <= 1)
      printf("nSystem result is significant");
      else if(Probability <= 5)
      printf("nSystem result is possibly significant");
      else
      printf("nSystem result is not statistically significant");
      printf("n-------------------------------------------");
    }
  }
}



When running this I get error 030 after the first run.
Is it not possible to achieve what I'm trying to do?
What should I do instead?
Posted By: jcl

Re: Can you change Detrend between cycles? - 08/21/17 10:59

Detrend must be set before the price history is loaded. It can not be shuffled afterwards. You could create a copy of the asset, shuffle only the copy, and switch to the copy at the second cycle.
© 2024 lite-C Forums