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
I don't understand. Suppose
rates_total == MA_Period - 1
and this is the first call of the function so
prev_calculated == 0
and also begin == 0
then the condition in the first if (rates_total < MA_Period - 1 + begin) evaluates to false
then
first = MA_Period - 1 would be executed
but then NO CALCULATIONS because the condition in the first for loop evaluates to false.
I think the first if condition should be
if( rates_total < MA_Period + begin )
am I missing something here?
And one more. Why should I start calculating from the bar with the number (prev_calculated - 1), if I already calculated the indicator prev_calculated times?
For example, I calculated the indicator 5 times for the bars 0, 1, 2, 3 and 4. I don't need to calculate it on the bar 4 again. I should continue from the bar 5.
And one more. Why should I start calculating from the bar with the number (prev_calculated - 1), if I already calculated the indicator prev_calculated times?
For example, I calculated the indicator 5 times for the bars 0, 1, 2, 3 and 4. I don't need to calculate it on the bar 4 again. I should continue from the bar 5.
I don't understand. Suppose
rates_total == MA_Period - 1
and this is the first call of the function so
prev_calculated == 0
and also begin == 0
then the condition in the first if (rates_total < MA_Period - 1 + begin) evaluates to false
then
first = MA_Period - 1 would be executed
but then NO CALCULATIONS because the condition in the first for loop evaluates to false.
I think the first if condition should be
if( rates_total < MA_Period + begin )
am I missing something here?
I'm newbie here so I don't know how to this..and how to start..can you teach me how? And how this will work?
Start by reading the full article. It is intended to help you learn how to program indicators in MT5.
After that copy the example program into your terminal and attach it to a chart. Or use it in your EA. How to do that? There are other articles about it. (Hint: you will need the iCustom() function.)