Gamestudio Links
Zorro Links
Newest Posts
StartWeek not working as it should
by jcl. 04/20/24 08:38
Data from CSV not parsed correctly
by jcl. 04/20/24 08:32
Zorro FIX plugin - Experimental
by jcl. 04/20/24 08:30
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:46
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
5 registered members (7th_zorro, Aku_Aku, henrybane, flink, 1 invisible), 739 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, howardR, 11honza11, ccorrea, sakolin
19047 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