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.
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...
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
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...
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.
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 - but i must admit i was suprised that others use my ideas, i developed without knowing that someone aleady uses similar stuff.