Gamestudio Links
Zorro Links
Newest Posts
Blobsculptor tools and objects download here
by NeoDumont. 03/28/24 03:01
Issue with Multi-Core WFO Training
by aliswee. 03/24/24 20:20
Why Zorro supports up to 72 cores?
by Edgar_Herrera. 03/23/24 21:41
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (monk12, Quad), 830 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Not getting the same result on every backtest run, why? #472545
05/04/18 11:08
05/04/18 11:08
Joined: Feb 2017
Posts: 369
D
Dalla Offline OP
Senior Member
Dalla  Offline OP
Senior Member
D

Joined: Feb 2017
Posts: 369
My code looks liks this:

Code:
//https://oxfordstrat.com/trading-strategies/hikkake-pattern/

function run()
{
	StartDate= 20110101;
	EndDate = 20171231;
	set(PARAMETERS+LOGFILE+TESTNOW);
	BarPeriod = 1440;
	BarOffset = 1020;
	EntryTime = 3;
	
	while(asset(loop("EUR/USD","USD/JPY","GER30"))) {
		vars close = series(priceClose());
		vars low = series(priceLow());
		vars high = series(priceHigh());
		
		var trend_index = optimize(1,1,200,10);
		LifeTime = optimize(25,1,200,10);

		Stop = ATR(20) * 6;
		
		if(high[1] < high[2] && low[1] > low[2]) {
			if (high[0] <  high[1] && low[0] < low[1]) {
				if(close[0] > close[trend_index]) {
					enterLong(1, high[2] + (1*PIP));
				}
			} else if (high[0] >  high[1] && low[0] > low[1]) {
				if(close[0] < close[trend_index]) {
					enterShort(1, low[2] - (1*PIP));
				}
			}
		}
	}
	
	PlotWidth = 1200;
}



After training, I don't get the same result on every run, and I cannot understand why. I can't see anything obviously wrong with my code?

For example, running with the assets in the script above, I'm seeing these two different results. It is consistent in the sense that I'm only seeing those two results, but I expect to the same result every time of course.

Code:
Oxford_HikkakePattern compiling...........
Read Oxford_HikkakePattern.par
Multiple assets...
Test: Oxford_HikkakePattern  2011..2017
Assets AssetsMini
Monte Carlo Analysis... Median AR 98%
Win 13804$  MI 165$  DD 2209$  Capital 2027$
Trades 90  Win 48.9%  Avg +180.6p  Bars 62
AR 97%  PF 2.04  SR 0.70  UI 21%  R2 0.62

Oxford_HikkakePattern compiling...........
Read Oxford_HikkakePattern.par
Multiple assets...
Test: Oxford_HikkakePattern  2011..2017
Assets AssetsMini
Monte Carlo Analysis... Median AR 23%
Win 7374$  MI 87.91$  DD 5406$  Capital 4146$
Trades 94  Win 43.6%  Avg +104.5p  Bars 61
AR 25%  PF 1.44  SR 0.37  UI 41%  R2 0.23



I'm running with Zorro 1.81.9.
What might be causing this?

Last edited by Dalla; 05/04/18 11:08.
Re: Not getting the same result on every backtest run, why? [Re: Dalla] #472547
05/04/18 13:20
05/04/18 13:20
Joined: Feb 2017
Posts: 369
D
Dalla Offline OP
Senior Member
Dalla  Offline OP
Senior Member
D

Joined: Feb 2017
Posts: 369
Adding Lookback = 200 solved the issue


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