Discussion of article "Event handling in MQL5: Changing MA period on-the-fly"

 

New article Event handling in MQL5: Changing MA period on-the-fly is published:

Suppose that simple MA (Moving Average) indicator with period 13 is applied to a chart. And we want to change the period to 20, but we do not want to go to indicator properties dialog box and edit the number 13 to 20: simply tired of these tedious actions with mouse and keyboard. And especially we don't want to open indicator code and modify it. We want to do all this with a single press of a button - "up arrows" next to the numeric keypad. In this article I'll describe how to do it.

Author: Sceptic Philozoff

 

I don't think the GPT has anything to do with it.

Besides the disadvantage mentioned in the article, there are several others. For example, the impossibility (in the current implementation) to run several copies of the indicator (even on different charts!).

In my opinion, it would be more reasonable to leave the inputs (to set initial values) and store the used values in simple GPs.


In general, the idea, implementation and the article are "A". Don't be modest, Alexey;)

 
komposter:

I don't think the GPT has anything to do with it.

Besides the disadvantage mentioned in the article, there are several others. For example, the impossibility (in the current implementation) to run several copies of the indicator (even on different charts!).

In my opinion, it would be more reasonable to leave the inputs (to set initial values) and store the used values in simple GPs.

Thanks, Andrei.

Yes, I didn't think about multiple copies on different charts: it's more universal to store them in GPs. But the redesign is very simple anyway. And don't forget to take care of the short indicator name so that it is displayed correctly.

I chose the GPTs originally precisely because they can be easily called in the dialogue and viewed. But not to edit! Well you can, of course, if you really want to, but at the same time taking into account what is written in the article.

 

Alexey, have you tried the indicator (the one with the "nesting doll") on M1-M15? It glitches on these intervals. It manifests itself in such a way - when you throw the indicator on the chart or change the TF, then either by pressing a hotkey or just clicking in the chart window, the indicator shifts to the left. On hours and above, such an effect is not visible.

Please take a look, it is very necessary.

 

Median Price does not coincide with the real MA.

In short, it is not finalised.

 
costy_: Median Price does not coincide with the real MA.

In short, it is not finalised.

From the article:

If the required price will be "elementary" (Open, High, Low, Close), we already have the corresponding CopyXXXX() function, but in case of "complex" prices (median, average or typical) we will have to calculate this array in another way.

 

Though I'd love to see that MA line's sneaky move at my command, anyone who knows MQL4 will be sad that in MQL5 we really can't call and change any indicator parameter on the-the-fly.

In MQL5 once it's handle initialized, the indicator is fixed - dead to it's parameter. I can't no longer scan price movement with different Period, because indicator's Period is already fixed. 

In MQL4, we can call indicator right inside start(), and change it's parameter as many as we like. 

No wonder, Integer wrote so many ...OnArray libraries in code base.

:( 

 
Mathemat:

From the article:

coming back, who is interested in the method, oninit cannot be called a second time, the display buffer rolls to zero (size == 0).

prices corrected, implemented via par-ry

in short as a memo.

 
It compiles, but it doesn't work, it gives a critical error
 
Thanks for sharing such a application which it is pushing the brain to go further and further