
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
Nicholas!
Can you tell me why when I try to fill an indicator array in a loop using the formula Mass[ i ]= Mass[ i+1]+A; where A is a variable, compilation goes without errors, but when I join the window I get the message array out of range (array out of range)?
Nikolay, thank you. It's a great tutorial!
But I think that variable
will always be zero valued, in the code. Is it significant for calculation?
Nikolay, thank you. It's a great tutorial!
But I think that variable
will always be zero valued, in the code. Is it significant for calculation?
The value of "begin" will be different depending on what indicator applied to. If you apply to RSI, "begin" will be 14, for example.
If you try to compile for the first time, you may get buffer error. So please change the amount of buffers:
#property indicator_buffers 2
Later on, you can switch back to 1 (one) buffer:
#property indicator_buffers 1
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.