For resources to work, the terminal has to read it out of the ex4 and create the resource, then process it as usual.
Try timing a few thousand ticks. Likely you will see a one time hit and then little difference.
I confirm the big difference (40 times on my side).
Thank you for confirmation. It's a bug in my opinion. But I don't know where I can report it.
Try timing a few thousand ticks. Likely you will see a one time hit and then little difference.
It isn't this case in my opinion. I updated the EA. Now the EA count every tick.
#define INDI_AS_RESOURCE // If you want to run the EA without resource use // in front of this line and compile #ifdef INDI_AS_RESOURCE #resource "\\Indicators\\RSI.ex4" #endif uint countStart=GetTickCount(); ulong countStartOnTick, countTick=0, timeWith=0, timeWithout=0; double rsi; int OnInit() { countStart=GetTickCount(); return(INIT_SUCCEEDED); } void OnDeinit(const int reason) { #ifdef INDI_AS_RESOURCE printf("It took %I64dms with resources. %d ticks ; Average time for one tick %.2fμs",GetTickCount()-countStart,countTick,countTick>0?timeWith/countTick:double("nan")); #else printf("It took %I64dms without resources. %d ticks ; Average time for one tick %.2fμs",GetTickCount()-countStart,countTick,countTick>0?timeWithout/countTick:double("nan")); #endif } void OnTick() { countTick++; #ifdef INDI_AS_RESOURCE countStartOnTick=GetMicrosecondCount(); rsi=iCustom(_Symbol,_Period,"::Indicators\\RSI.ex4",0,0); timeWith+=GetMicrosecondCount()-countStartOnTick; #else countStartOnTick=GetMicrosecondCount(); rsi=iCustom(_Symbol,_Period,"RSI.ex4",0,0); timeWithout+=GetMicrosecondCount()-countStartOnTick; #endif }
And here is the results:
Indicator as a resource:
It took 233078ms with resources. 6546038 ticks ; Average time for one tick 35.00µs
Without a resource:
It took 4531ms without resources. 6546038 ticks ; Average time for one tick 0.00µs
Thank you Alain. You're my angel ;-)
Same thing happens here...
Does anyone has some news about it?
Is the only way to solve the problem to embeed resource indicator code inside "main" code?
Same thing happens here...
Does anyone has some news about it?
Is the only way to solve the problem to embeed resource indicator code inside "main" code?
There will be no news. MT4 is not in development any more, only security issues will be fixed.
I am wondering if this also occurs with MT5, did you try ?
There will be no news. MT4 is not in development any more, only security issues will be fixed.
I am wondering if this also occurs with MT5, did you try ?
Didn't try... but from my (little) experience it can be same or worse :-D
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
A custom indicator included as a resource slow down 60 times tester against using the same indicator with the same inputs (not as a resource).
Is it a bug? Or am I doing something wrong?
Here is a simple EA so you can try it: