Gamestudio Links
Zorro Links
Newest Posts
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Trading Journey
by 7th_zorro. 04/27/24 04:42
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
MT5 bridge not working on MT5 v. 5 build 4160
by EternallyCurious. 04/25/24 20:49
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
0 registered members (), 781 guests, and 2 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
Page 2 of 2 1 2
Re: Ahead bias when retrain [Re: JRA] #472828
05/25/18 12:03
05/25/18 12:03
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
Calling asset() is needed to select the asset. It has absolutely nothing to do with peeking bias.

I do not really understand your problem with the WFO setup. Anyway, when you post your code and explain in more detail what you want to achieve, people can most likely help you. If you don't want to reveal your code here, you can buy a support ticket and let Support fix your setup.

Re: Ahead bias when retrain [Re: jcl] #472833
05/25/18 14:53
05/25/18 14:53
Joined: Oct 2017
Posts: 17
J
JRA Offline OP
Newbie
JRA  Offline OP
Newbie
J

Joined: Oct 2017
Posts: 17
This is the code. I get different results when the asset is selected on the scrollbox or settled in the script.




Code:
// XGBoost on S&P500

#include <r.h>
#include <profile.c>
#include <contract.c>

var neural ........................
{	
...................................	
...................................	
}	
	
function run()
{	
	NumCores = 8;
set(RULES|PLOTNOW|OPENEND);
	StartDate = 20020101;
//	EndDate = 20180515;
	BarPeriod = 1440;
	LookBack = 400;
	asset("ES");  // Fantastic results when comment and select it from scrollbox
   DataSplit = 90;
   WFOPeriod = 25 * DataSplit/(100-DataSplit); /* One month test and one year train, but better profits when lower test period, this made the suspicions */
	

	vars Close = series(priceClose());
	var desv = 2;
	var volumeDown = marketVol();
	var volumeUp = marketVal();
	
/* And the signals and transformations.............
.......................................
........................................ */

	if(Train) 
	{
		 
		Hedge = 2;
		NumSampleCycles = 4;
		LifeTime = 1;
		if(adviseLong(NEURAL+BALANCED, 0, 
			Sig1,Sig2, Sig3, Sig4,Sig5,Sig6,Sig11,Sig16,Sig17,Sig18,Sig20) > 0.5)
		{
			enterLong(1);
		}
		if(adviseShort() > 0.5)
		{
			enterShort(1);
		}
	}
	
	if(!Train)
	{
		var LongPrediction = adviseLong(NEURAL+BALANCED,0, Sig1,Sig2, Sig3,Sig4,Sig5,Sig6,Sig7,Sig11,Sig16,Sig17,Sig18,Sig20);
			
		var ShortPrediction = adviseShort();

		if(LongPrediction > 0.5 && ShortPrediction < 0.5)
			{	Stop = 4*ATR(20);
		      TakeProfit = 6*ATR(20);
				reverseLong(1);
			}

		
		if(ShortPrediction > 0.5 && LongPrediction < 0.5)
			{  Stop = 4*ATR(20);
		      TakeProfit = 4*ATR(20);
				reverseShort(1);
			}
		 PlotWidth = 800;
	    PlotHeight1 = 600;
	}
 
}


Re: Ahead bias when retrain [Re: JRA] #472837
05/25/18 18:38
05/25/18 18:38
Joined: Sep 2003
Posts: 929
Spirit Offline

Moderator
Spirit  Offline

Moderator

Joined: Sep 2003
Posts: 929
you got the asset call right this time but the datahorizon is still not set. so you have still the peeking bias.

Re: Ahead bias when retrain [Re: Spirit] #472838
05/25/18 18:47
05/25/18 18:47
Joined: Oct 2017
Posts: 17
J
JRA Offline OP
Newbie
JRA  Offline OP
Newbie
J

Joined: Oct 2017
Posts: 17
I have never seen the "DataHorizon" in a script, included in any Zorro version or in the web.
And "DataHorizon" does not exist for some versions ¿?,I can´t compile it.

And yes, it´s exactly like the Deeplearn.c. Is this one peeking bias too? shocked

Re: Ahead bias when retrain [Re: JRA] #472839
05/25/18 19:07
05/25/18 19:07
Joined: Sep 2003
Posts: 929
Spirit Offline

Moderator
Spirit  Offline

Moderator

Joined: Sep 2003
Posts: 929
you need datahorizon when you have peeking bias. the deeplearn.c and the other examples have no peeking bias, but in your script with only 25 bars test period you have a large overlap and large peeking bias.

if you have an old zorro with no data horizon, no problem, then you must just simulate the data horizon in your script by checking the overlap and not trading during that time. That was described in the old manual. hope this helps!

Re: Ahead bias when retrain [Re: Spirit] #472841
05/25/18 21:52
05/25/18 21:52
Joined: Oct 2017
Posts: 17
J
JRA Offline OP
Newbie
JRA  Offline OP
Newbie
J

Joined: Oct 2017
Posts: 17
I have the newest versions, and DataHorizon it’s compiling again. I have goblins on my pc or the compiler has remote control. grin




Last edited by JRA; 05/26/18 06:04.
Page 2 of 2 1 2

Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1