Questions from Beginners MQL5 MT5 MetaTrader 5 - page 1217
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
Good afternoon!
I'm trying to understand arrays and have the following question.
Why useArraySetAsSeries in this example and set flag true, if inCopyRates counting is made from present to the past?
I understand, that theArraySetAsSeries function is necessary to search the array from the present to the past.
I want to understand the purpose of this function in this example.
After
rates[0] will correspond to the RIGHT BAR in the chart. This is the simplest explanation, without the confusing terms "present" and "future".
After
rates[0] will correspond to the RIGHT BAR on the graph. This is the simplest explanation, without the confusing terms "present" and "future".
Thanks for the answer!
But if we don't useArraySetAsSeries, thenCopyRates will also assign rates[0] to the rightmost bar on the chart.
Just trying to understand what isArraySetAsSeriesfunction for when it works the same without it?
Or it's just an accepted form of writing code?
Thanks for the answer!
But if we don't useArraySetAsSeries, thenCopyRates will also assign rates[0] to the rightmost bar on the chart.
Just trying to understand whyArraySetAsSeriesfunction is needed when it works the same without it?
Or it's just an accepted form of writing code?
you're wrong, CopyRates assign rate[0] to the oldest value due to the size of rate[] array.
Thank you!
Now I get it, I was wrong)
Good afternoon!
Once again I am asking for help!
I have written a code with the condition "buy" when MA(20) crosses MA(50) from bottom to top
But in fact it executes like this
Good afternoon!
Once again I am asking for help!
I have written a code with the condition "buy" when MA(20) crosses MA(50) from bottom to top
But in fact it is done like this
Gross error: You create two indicator handles on every tick. The correct way to do it is to
move to OnInit, add a check of the handle correctness.
Also arrays that take values from IMA must be made
Thank you very much for your prompt reply!
I understand aboutArraySetAsSeries.
I will try to figure out how to move indicator to OnInit, and check the handle.
***
Thank you very much for your prompt reply!
I understand aboutArraySetAsSeries.
I will try to figure out how to move indicator to OnInit, and check the handle.
***
Everything is there from the beginning
It's all there from the beginning.
Thanks, I will study
Fixed it, everything seems to be working!)
I transferred two MA indicators to the OnInit function.
I understand that we create only the indicator handle in the OnInit function and perform all other manipulations with the arrays in the OnTick function and check it on every tick?