Gerard Ngawati:
...
Hi All
Is there any advantage of the implementation of mq5 indicators compared to mq4.
The mq5 by comparison seem to be all over the place code wise and requires so much more resource coding wise.
one call in oninit, 2 global variables. Has anyone managed to get to get it down to one or 2 lines? Is the call in oninit necessary?
Are there speed advantages? or does it make for better error checking.
To be honest I haven't looked in detail hoping someone had a quick answer. Hopefully I am not sounding to negative but its discouraging my transition to mq5.
Quick answer :
double MA[]; int MA_handle; int OnInit() { MA_handle=iMA(NULL,0,21,0,MODE_EMA,PRICE_CLOSE); return(0); } void OnTick() { CopyBuffer(MA_handle,0,0,100,MA); ArraySetAsSeries(MA,true); if(MA[0]>MA[1]) { /* some operations */ } }
2 lines !
Alain Verleyen:
Quick answer :
2 lines !
Ha! Perfect!
Alain Verleyen:
Figured that, can use it but still a big overhead. Its funny how mt5 is by far superior application to mt4 but the vast majority of EA's and signals are mt4. Filter by 3 years and it becomes even more significant.Quick answer :
2 lines !
I wonder why? Apparently I am not the only who thinks that.

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hi All
Is there any advantage of the implementation of mq5 indicators compared to mq4.