Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by EternallyCurious. 04/18/24 10:45
StartWeek not working as it should
by Zheka. 04/18/24 10:11
folder management functions
by VoroneTZ. 04/17/24 06:52
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
zorro 64bit command line support
by 7th_zorro. 04/15/24 09:36
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:48
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:46
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 559 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, 11honza11, ccorrea, sakolin, rajesh7827
19046 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,978
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,978
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