
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
If you want performance, do not use iOpen, iClose or other iXXX functions. Use CopyXXX functions.
If you want performance, you need to use more memory. In general, memory usage and performance are correlated.
Touché!
I'm glad to see you here again, I've been thinking for days; Where is Alain, post-Christmas holiday hangover? 😅
If you want performance, do not use iOpen, iClose or other iXXX functions. Use CopyXXX functions.
If you want performance, you need to use more memory. In general, memory usage and performance are correlated.
Yes I have previously issues with iXXX functions So Is this better to MqlRates which is inbuilt structure?
It doesnt matter. - Here is why:
iOpen and iClose are precompiled binary functions, provided by the terminal. - Your code has to do a jmp operation to call the functions. This includes a stack push, function stack initialization and, after the function (iClose) has done what it needs to do, a result push to the calling function, ending with a jmp back to the caller, in this case your function.
Now since the result needs to be stored on the stack of (your function) the caller, a memory area needs to be assigned anyways, let it be a dedicated variable, you define, or let it be an implicit declaration by the compiler. - No difference.
There is however a difference in calling an API function once or multiple times, the compiler is unable to optimize your callings, since the result of that calling is unknown at that point, also cacheing cannot be applied, as the code of the API function is precompiled, its inner workings re unknown to your code.
So no matter how or what you do, calling a (precompiled) function will under all circumstances result in a stack push jump and return. . Hence slower than calling the function once and storing the result in an explicit declared variable.
And it is completley irrelevant what the function you are calling actually does, accessing memory (pointer-arithmetic) or calculations on its input parameters, the penalty is always the same.
(End of story and discussion.... - Haha)
ahh i see . Thanks
Yes I have previously issues with iXXX functions So Is this better to MqlRates which is inbuilt structure?
Simplified version: