Gamestudio Links
Zorro Links
Newest Posts
Trading Journey
by howardR. 04/28/24 09:55
basik85278
by basik85278. 04/28/24 08:56
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Help with plotting multiple ZigZag
by M_D. 04/26/24 20:03
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
M1 Oversampling
by jcl. 04/26/24 11:12
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
Eigenwerbung
by jcl. 04/26/24 11:08
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (alibaba, howardR, basik85278), 756 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Can you change Detrend between cycles? #467675
08/21/17 05:48
08/21/17 05:48
Joined: Feb 2017
Posts: 369
D
Dalla Offline OP
Senior Member
Dalla  Offline OP
Senior Member
D

Joined: Feb 2017
Posts: 369
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?

Re: Can you change Detrend between cycles? [Re: Dalla] #467678
08/21/17 10:59
08/21/17 10:59
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
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.


Moderated by  Petra 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1