Libraries: SmoothAlgorithms

 

SmoothAlgorithms:

A library of averaging algorithms, the algorithms were described in details in the article "Averaging Price Series for Intermediate Calculations Without Using Additional Buffers"

Fig1. The EMA indicator in the MetaTrader 5 terminal window

Author: Nikolay Kositsin

 
Good afternoon! Please advise... After updating to the latest build errors in "SmoothAlgorithms" started to fly out. And averaging sma, lwma, parma, vidya stopped working. It warns on this line:"array out of range in 'SmoothAlgorithms.mqh' (3394,9)". How to fix it? Thanks!
 
007yurik:
Good afternoon! Please advise... After updating to the latest build errors in "SmoothAlgorithms" started to fly out. And averaging sma, lwma, parma, vidya stopped working. It warns on this line: "array out of range in 'SmoothAlgorithms.mqh' (3394,9)". How to fix it? Thanks!

I don't fix any irregularities in the code or in its compilation at all. It is absolutely unclear what you are talking about?

 
Nikolay Kositsin:

I do not detect any violations in the code's operation or compilation at all. I don't understand at all, what are you talking about?

Taking into account my low level of mql knowledge I will try to explain on my fingers)Before the latest terminal updates everything was fine.Now, after the update, when adding any indicator with SmoothAlgorithms to the chart, not all averaging methods work.For example, let's take your indicator XFisher_org_v1_Vol, I download-compile it - everything is normal, no errors.When I try to change the smoothing method to sma, smma, lwma, parma, vidya and ama. I get an empty indicator window. All other methods work normally.The following line appears on the Expert Advisors tab in the tools:2018.11.20 17:20:49.028 XFisher_org_v1_Vol_Supr (Si-12.18,M1) array out of range in 'SmoothAlgorithms.mqh' (3394,9).


 
Of course, maybe I'm in the wrong place and it's not about SmoothAlgorithms, but I don't have any other ideas yet. If you can tell me something, I'll be grateful.
 
007yurik:
Of course, maybe I'm not in the right place and it's not about SmoothAlgorithms, but I don't have any other ideas yet. If you can tell me something, I would be grateful.

If I had something like this on my computer, it would be possible to do something, but so there is only one way to solve the problem - download the installation file from the Metaquotes site and install it in an empty folder. And check the work of indicators in the new terminal.

And the number of bars in the window should be more or less decent. Otherwise there will be nothing to average, and it is the problematic methods of averaging that require more bars than other averaging methods.

 

If you add the #property strict directive in the code.

and in the PriceSeries function replace Open with open, Low with low, etc.

it will compile in MT4 without errors and warnings. Maybe the author will do this little thing?

 
Sergey Tselikov:

If you add the #property strict directive in the code.

and in the PriceSeries function replace Open with open, Low with low, etc.

it will compile in MT4 without errors and warnings. Maybe the author will do this little thing?

The thing is that I don't follow the changes in MQL4 language at all and, by and large, I don't do it at all, because I don't have time for this kind of work. There is a variant of SmoothAlgorithms for mql4 in the Zip file in the attachment to the publication, but I don't know how well it works. Indicators will not be compiled straightforwardly anyway.

 
The library compiles and works. Only this little thing is missing. I think it is incorrect to post someone else's cosmetically corrected code.
 
Actually, the proposed does not change the work of your code in any way. Cosmetics.
 
Nikolay Kositsin:

If I had something like this on my computer, I could do something about it, but the only way to solve the problem is to download the installation file from the Metaquotes site and install it in an empty folder. And check the work of indicators in a new terminal.

And the number of bars in the window should be more or less decent. Otherwise, there will be nothing to average, and it is the problematic methods of averaging that require more bars than other averaging methods.

Confirmed. The error occurs, but not always. Sometimes it works normally, sometimes it crashes. The error occurs more often if you run the indicator in the tester. For example, the same XFisher_org_v1_Vol_Supr after compiling in the last build (1980) and running in the tester on the RTS Splice instrument, gives the error "array out of range in 'SmoothAlgorithms.mqh' (3394,9)". The error occurs not only on this indicator, but also on many others that use SmoothAlgorithms.mqh library. Nikolai, please check it.

XFisher_org_v1_Vol
XFisher_org_v1_Vol
  • www.mql5.com
Осциллятор XFisher_org_v1 в виде цветной гистограммы с использованием объемов. Формула вычисления: По вполне понятным причинам, в таком модифицированном осцилляторе пересчет уровней перекупленности и перепроданности должен происходить по этой же формуле, что и было выполнено. В итоговом варианте эти...