Questions from Beginners MQL5 MT5 MetaTrader 5 - page 343
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
Change in the calculation code
to
That is 13 or 12 or some other number - this should be the "Period" parameter. Averaging period
Hooray!
Thank you it worked. Why this parameter is not in the original indicator? It is preset by default, do you know?
That is, I set only the number of bars for averaging and nothing else. In fact this is the only parameter in the source and it is used in the formula.
In the last version, I have two parameters. Number of bars for averaging and one for SmoothFactor calculation.
Hooray!
Thank you. But why isn't this parameter in the original indicator? Do you know if it is prescribed by default?
That is, I only set the number of bars for averaging and that's it. In fact, in the source code, this is the only parameter that is used in the formula.
In the last version, I have two parameters. Number of bars for averaging and one for SmoothFactor calculation.
Everything is in the delivery. See indicator code "***\MQL5\Indicators\Examples\Custom Moving Average.mq5".
That's where I got everything from :-). I guess I just don't understand.....
Still, for some reason the calculated EMA values do not add up to the original ones.
Maybe this indicator converted to a function is available somewhere?
That's where I got everything from :-). I guess I just don't understand.....
I want to use it as a handle and for some reason calculated EMA values do not coincide with original ones.
Maybe somewhere there is this indicator converted to a function ?
Or maybe it's better to create in OnInit() of the EA two handles of the iMA indicator with different types of smoothing and then just get the values of these indicators?
Or maybe it's better to create two handles of iMA indicator with different types of smoothing in OnInit() and then just get the values of these indicators?
I already tried it. MQL5 produces some nonsense by handles. For example.
At the output at the first bar we get variable values even though the bar has already been formed! Everything works well in MQL4 but here is a mess.
I've already tried it. MQL5 produces some nonsense by handles. For example.
In this way, the first bar outputs variable values even though the bar has already been formed! Everything works fine in MQL4 but here it is horrible.
Forum on trading, automated trading systems and strategy testing
Questions from Beginners
I have never tried to use Handlestick in trading, it is too early to use it.
Or maybe it would be better to create two iMA indicator handles with different types of smoothing in OnInit() of the EA and then just get the values of these indicators?
I've already had a lot of trouble with transferring the code to MQL5. Mostly the problem is with the indicators. The stochastic is getting some kind of "lefty" values.
I have decided to calculate the values by myself.
I need MQL5 only for optimization speed and for checking multicurrency mode. That's all!
It is not useful for anything else. I hope that no dealing centre will ever use this "wonder".
I've got the variable values figured out! It turns out that CopyBuffer reverses the order of indices!
Why would I do that?
Alvin1976:
...Aaah with the variable values figured out ! CopyBuffer is reversing the order of the indices!
Why do I do that?
If you want to avoid asking the indicator what you don't need... Imagine, you come to a newsstand. And you need a newspaper from the last 3 days. And they say, "We can sell you your paper, but only for the last 20 days...". Do you need it? :-)
Well, in MQL4 you don't have to ask too much either. It's not about the quantity, it's about the order.
Where is the logic? Everyone has got used to the fact that the zero element of the array is the current bar. Why would you change something ????.
P.S. Fixed it through ArraySetAsSeries.
Tumbling .....
Well, in MQL4 you don't have to ask too much either. It's not about the quantity, it's about the order.
Where is the logic? Everyone has got used to the fact that the zero element of the array is the current bar. Why would you change something ????.
P.S. Fixed it through ArraySetAsSeries.
Dancing with tambourine.....