This is the same as 'Problem with iMAOnArray; It doesn't function.' right?
Looking at the silent treatment that one is getting, I would say it's a bug :)
Looking at the silent treatment that one is getting, I would say it's a bug :)
Well if it's a bug then it really ruins most of MQL4's features.
The thing is, MQL4 wants to be like C but is nowhere near it.
Look at a simple issue. How do i shift arrays? How do i resize arrays efficiently?
Shifting an array of 3-4 mil records takes a hell of a long time (with a for .. . some 2-3 secs on my computer ...and it's a pretty beefy computer). And this makes me think that mql code is NOT compiled but interpreted. Also the underlaying implementation of the array may be a linked list or something.
Now if the array is a real C array underneath...i have no memcpy, and the overhead on malloc/realloc is huge on resizing arrays. But if it's a linked list...then please give us some tools to work it. And most importantly say something about it.
I searched all the docs on the Documentation pages, and not a thing is said about the language itself, efficiency, autoshifting arrays, underlaying implementation. And i believe these to be of utmost importance in an application that handles large amounts of data, and constantly needs shifting.
Now i'm criticizing and i may not be aware of all the info that's out there on the subject. And that's why i came here, hoping the dev team might sched some light on these things.
The thing is, MQL4 wants to be like C but is nowhere near it.
Look at a simple issue. How do i shift arrays? How do i resize arrays efficiently?
Shifting an array of 3-4 mil records takes a hell of a long time (with a for .. . some 2-3 secs on my computer ...and it's a pretty beefy computer). And this makes me think that mql code is NOT compiled but interpreted. Also the underlaying implementation of the array may be a linked list or something.
Now if the array is a real C array underneath...i have no memcpy, and the overhead on malloc/realloc is huge on resizing arrays. But if it's a linked list...then please give us some tools to work it. And most importantly say something about it.
I searched all the docs on the Documentation pages, and not a thing is said about the language itself, efficiency, autoshifting arrays, underlaying implementation. And i believe these to be of utmost importance in an application that handles large amounts of data, and constantly needs shifting.
Now i'm criticizing and i may not be aware of all the info that's out there on the subject. And that's why i came here, hoping the dev team might sched some light on these things.
death_ghast:
Look at a simple issue. How do i shift arrays? How do i resize arrays efficiently?
Article: Effective usage of Arrays in MQL
Look at a simple issue. How do i shift arrays? How do i resize arrays efficiently?
death_ghast:
The thing is, MQL4 wants to be like C but is nowhere near it.
Where is written that mql4 wants to be like C? The thing is, MQL4 wants to be like C but is nowhere near it.
Since when does C have strings for example? There is not much in mql4, except maybe the ugly C-ish syntax that seems to be so popular amongst tasteless language designers nowadays, that reminds of C.
And why do you want to shift arrays at all? Why not offset the index instead, when accessing it? In C you would do pointer arithmetics to offset the whole array or similar dirty tricks, which is one of the only reasons one would ever consider the use of C for a programming task and for the very same reason [because such things are possible] it is recommended by old programming veterans like me to never ever use C for anything at all.
Good article, now i know why my series array was not working.
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
Here's the code i use...just a test sample:
Now this outputs:
Default. result = 0.90000000 test_array[0] = 0.50000000
Modified. result = 0.90000000 test_array[0] = 1.00000000
The result of the MA function is the same, and what i got from the documentation tell different. This is what i expect to be coming out:
Default. result = 0.60000000 test_array[0] = 0.50000000
Modified. result = 0.90000000 test_array[0] = 1.00000000
Can someone explain this to me please...or is it just a bug?
Thanks,
Alex