Forum on trading, automated trading systems and testing trading strategies
Alain Verleyen, 2020.04.14 02:55
What MT5 build ?
What server ?
- If you want to check D1 data, unless you have other good reasons to not do it, run your code on D1.
- Most probably not related to the speed issue :
Your code is not good. Initializing an indicator handle and using CopyBuffer() on the next statement is likely to give bad results.
You NEED to check the return value of CopyBuffer().
- Your way to check a crossover is also wrong. What will happen if the 2 values are equals ?
- If you want to check D1 data, unless you have other good reasons to not do it, run your code on D1.
- Most probably not related to the speed issue :
Your code is not good. Initializing an indicator handle and using CopyBuffer() on the next statement is likely to give bad results.
You NEED to check the return value of CopyBuffer().
- Your way to check a crossover is also wrong. What will happen if the 2 values are equals ?
Thank you Alain,
oddly after i changed it to Shift 1, 13 minutes turn to 1 minute! in demo version 2380
thou in my rl broker version 2361 still slow
sorry about H1 thingy actual script as you see on the code is hardcoded script on PERIOD_D1
yeah in my actual code i grab err codes copybuffer return etc just remove them for simplicity sake here,
no error as far as i can see on copybuffer returns
as matter of crossover yeah just wanted not the touching 2 lines but actual crossover
wondering if that slowness is due 2361 or something like that i guess i have to wait till they update the version and recheck it
Thank you Alain,
oddly after i changed it to Shift 1, 13 minutes turn to 1 minute! in demo version 2380
thou in my rl broker version 2361 still slow
sorry about H1 thingy actual script as you see on the code is hardcoded script on PERIOD_D1
yeah in my actual code i grab err codes copybuffer return etc just remove them for simplicity sake here,
no error as far as i can see on copybuffer returns
as matter of crossover yeah just wanted not the touching 2 lines but actual crossover
wondering if that slowness is due 2361 or something like that i guess i have to wait till they update the version and recheck it
Example: Bars after the last iMA crossing

- 2020.04.09
- www.mql5.com

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
got new issue! sorry to keep asking for help but this one is just simply weird!
MA crossover wrote million times by everyone here...
here is my code but instead of MA crossover i use EMA & AMA cross over i tested as usual work very quick with MA crossover but as soon as i change it one of them to AMA it slow down
and its not my system i have i7 32gb ram and while checking the process never went above 2% CPU
2020.04.14 01:20:55.027 Collector (AUDCAD,H1) Time:2020.04.13 23:50:54 Counted:71 No Cross over on:XAUUSD
2020.04.14 01:33:29.274 Collector (AUDCAD,H1) Time:2020.04.14 00:03:27 Counted:0 No Cross over on:EURUSD
13 minutes to calculate few pairs!
its even worse if use stocks instead of FX Pairs
as matter of collecting historical data i re ran it few times so it can collect whatever needed same result more or less
also Freeing array after each calculation that should be an issue too
so if anyone can me figure it out what's going on i appreciate it
tnX in advance