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
And this library calculates correctly, if we specify calculation not of the whole array, but only of its last part (current values)? Besides, this is only half of the problem, but what about iBandsOnArray?
There is a "begin" parameter there, try to limit it.
There was a time when theiMAOnArray functionwas very slow. Well, I had code that was optimized for about three hours usingiMAOnArray but then this function became sluggish and optimization took about 30 hours.
I don't know, maybe it was fixed now. But when I createdMovingAverages.mqh indicator thesame code was computed in about an hour and a half, i.e. the time was cut by half.
Ihave nothing to say about iBandsOnArray, I haven't seen such an includeable file with the same task in mql4.
Here you go.
With iBandsOnArray the indicator is slow on startup. Changed it to iStdDevOnArray, it starts instantly.
Except that in the tester it lags withboth iBandsOnArray and iStdDevOnArray.
Here you go.
Yeah, well... Boy, go for a walk.
This is not a boy, but a very mature man. Although the habit of referring to everyone as "you" doesn't make him respectable, imho :)
And now compare the result of your code and the original one in LWMA or SMMA straight line smoothing mode and get different values, because these two types of smoothing use their own previous values in their calculations, and using only N period elements each time you, respectively, lose this data, besides I need different calculation periods for iBands and iMA, so I have to copy them twice. And the initial array for the calculation is used the same. The logic of your reasoning is clear to me, but it is wrong, because by reducing the length of the array, but at the same time doing each copy and recalculating all of its elements you finally increase the total time of the indicator calculation during optimization or work with several versions of the indicator for different TFs. In my case it slows down only the initial calculation, after that only 1 new element is calculated. The problem is in the implementation of these functions in MQL. Self-written versions work better and faster. Please draw your own conclusions.
I used to think you were a good programmer. The truth is, all you can do is spread your fingers and fight. You don't get any because you're so angry?