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 (1 invisible), 672 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
Page 2 of 2 1 2
Re: Zorro SKIPPED/MARGIN 0 [Re: easyX] #469864
12/12/17 08:34
12/12/17 08:34
Joined: Jul 2000
Posts: 27,978
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,978
Frankfurt
From my experience, anything in Zorro is normally about 10x faster than the same thing in mql5 - or if not, something is wrong.

I am not very familiar with profile.c, but if you suspect a bug in your code, you can get a support ticket and send your script to Support - they'll tell you what the problem is. Or post it here, maybe the problem is easy to see.

Re: Zorro SKIPPED/MARGIN 0 [Re: jcl] #469875
12/12/17 11:12
12/12/17 11:12
Joined: Nov 2017
Posts: 39
Germany
E
easyX Offline OP
Newbie
easyX  Offline OP
Newbie
E

Joined: Nov 2017
Posts: 39
Germany
As you can hopefully see in the attachment this is the Seasonal for a Day with M1 resolution.

Code:
Code:
#include <default.c>
#include <seasonal.c>

function run()
{
	BarPeriod = 1;
	StartDate = 2010;
	EndDate = 2015;
	set(PLOTNOW);
	asset("EURUSD");
	plotDay(priceClose(0),0);
	PlotWidth = 1800;
	PlotHeight1 = 500;
}



seasonal.c is a modified profile.c

i changed

Code:
function plotSeason(
	int n,			// plotted bar number
	int label,	// bar label
	int season, // season number
	var value,	// profit to plot
	int type)		// cumulative or difference
{
	if(is(INITRUN) || !is(TESTMODE)) return; // [Test] only

	static int lastseason = 0;
	static var value0 = 0;
	if(!(type&PVAL) && season != lastseason) {
		value0 = value;
		lastseason = season;
	} 

	plotBar("Value",n,label,value-value0,NEW|AVG|BARS|LBL2,COLOR_AVG);	
	//plotBar("StdDev",n,0,(value-value0)/4,DEV|BARS,COLOR_DEV);	

	if(type&PDIFF) value0 = value;
}


I don' really understand whats happening here, just commented the StdDev plotting. Maybe there is still some unnecessary code within this?

And to get the M1 resolution i changed plotDay as well:

Code:
function plotDay(var value,int type)
{
	int periods = 1440;
	checkLookBack(periods);
	int m30 = hour()*60 + minute();
	if(m30 > periods) return;
	plotSeason(m30,hour()*60+minute(),dow(),value,type);
}




I don't know what profile.c is doing, we used to create arrays for each day within mql5 and stored the price change to to opening of the day for all 1440 values and you have to fill small gaps of course. Then just add all days and divide through the number of days. This is on my symstem a matter of seconds if no other calculations (filters, indicators, ...) are involveld. But with Zorro for the sample above it takes more then 1 min for me, and it is bugged...

Attached Files seasonalM1.jpg
Last edited by easyX; 12/12/17 12:30.
Re: Zorro SKIPPED/MARGIN 0 [Re: easyX] #469882
12/12/17 15:28
12/12/17 15:28
Joined: Nov 2017
Posts: 39
Germany
E
easyX Offline OP
Newbie
easyX  Offline OP
Newbie
E

Joined: Nov 2017
Posts: 39
Germany
Also i just notice that a simple test, opening one trade a day for certain time without any parameter except time is very slow. It may be that Zorro is faster for more difficult tasks, but somehow for some very basic things it is not. Hope i can find ways to improve that.

Edit:

It seem there is also no generic optimization frown

And if i optimze a parameter with bigger steps first, then choosing a smaller range and smaler steps, in metatrader it remembers all runs with same parameters. So it does not do the same calculation again, if nothing in the script changed.

e.g first run from 200-600 with steps of 20, then 240-340 with steps of 5 => 1/4 of all runs are already made. It makes no sense to do it twice, but since you have to change the code itself in zorro to change optimize parameter thats the problem i guess...

Last edited by easyX; 12/12/17 15:53.
Re: Zorro SKIPPED/MARGIN 0 [Re: easyX] #469891
12/12/17 17:48
12/12/17 17:48
Joined: Jul 2000
Posts: 27,978
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,978
Frankfurt
I cannot comment on your optimization ideas, but your season modification looks syntactically ok. However I can imagine that it produces a slow and bad plot. It is just no good solution. For plotting any single minute, aside from speed issues, you would need data that really covers any minute. Forex M1 data has often missing minutes, and at those points you'll see nothing or single peaks in your plot. - If you want to do it faster, don't plot millions of bars, but collect the data really in an array, and remove minutes that are only represented by 1 or 2 samples. Then you won't get those peaks and gaps.

Re: Zorro SKIPPED/MARGIN 0 [Re: jcl] #469892
12/12/17 18:00
12/12/17 18:00
Joined: Nov 2017
Posts: 39
Germany
E
easyX Offline OP
Newbie
easyX  Offline OP
Newbie
E

Joined: Nov 2017
Posts: 39
Germany
This is plotting millions of bars? i thought it's just plotting the final result at the end. If so it's a pretty bad solution within profile.c And yes you have to take care of small gaps, like i said i did in mql5. I just was hoping you guys thought about things like this (performance+gaps) already, since many things go into detail very well, but seasonals are handled just in a very basic manner smirk - but i must admit i was suprised that others use my ideas, i developed without knowing that someone aleady uses similar stuff.

Page 2 of 2 1 2

Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1