As you can see - there are ten orders, but their indexes are 1 less, because in any array the count starts from zero.
OrdersTotal() is 10, but if you start a loop with OrdersTotal(), it will go outside the array - there is no index for order 10 - the largest index is 9 - so OrdersTotal()-1
Vitaly Muzichenko: Print via Print() and you won't have these questions, it's not difficult.
Thanks ... Got it ... I just thought theOrdersTotal count was also including zero ... Then I was wrong, I wrote like this(int i=OrdersTotal(); i>-1; i--) and it didn't work properly.
Hello! In the documentation, in the article "Indicator Styles in Examples" it says : By default, the indicator buffer is used to store the data to be drawn (INDICATOR_DATA).
If the calculation of indicator values requires intermediate calculations and storing an auxiliary value for each bar, you can declare such an array as a calculation buffer ( INDICATOR_CALCULATIONS) when binding.
None of 18 given examples of constructions in MQL5 demonstrates thearray of calculation buffer ( INDICATOR_CALCULATIONS). Please advise where else to read about this topic ?
Leo59: Hello! In the documentation, in the article "Indicator Styles in Examples" it says : By default, the indicator buffer is used to store the data to be drawn (INDICATOR_DATA).
If the calculation of indicator values requires intermediate calculations and storing an auxiliary value for each bar, you can declare such an array as a calculation buffer ( INDICATOR_CALCULATIONS) when binding.
None of 18 given examples of constructions in MQL5 demonstrates thearray of calculation buffer ( INDICATOR_CALCULATIONS). Please tell me where else to read about it ?
Think of it as a normal dynamic array for storing intermediate calculation data. You just don't need to increase/decrease its size - the client terminal will do it for you. The data of such an array-buffer will not be shown on a chart - that's the difference between DATA and CALCULATIONS
Artyom Trishkin: Think of it as a normal dynamic array for storing intermediate calculations. You just do not need to control it and increase/decrease its size - the terminal will do it for you. The data of such an array-buffer will not be shown on a chart - that's the difference between DATA and CALCULATIONS.
Artyom Trishkin: Think of it as a normal dynamic array for storing intermediate calculations. You just do not need to control it and increase/decrease its size - the terminal will do it for you. The data of such an array-buffer will not be printed on a chart - this is the difference between DATA and CALCULATIONS
If the indicator #property indicator_chart_window - this is correct, it is not output. But if indicator #property indicator_separate_window - it is output for some reason.
As you can see - there are ten orders, but their indexes are 1 less, because in any array the count starts from zero.
OrdersTotal() is 10, but if you start a loop with OrdersTotal(), it will go outside the array - there is no index for order 10 - the largest index is 9 - so OrdersTotal()-1
Thank you ... Got it ... Thank you.
This is because it is counted from 0. If you have 10 orders, then count ordinal numbers should be 0...9, that is, 0...(10-1), whereOrdersTotal()=10.
Just keep this in mind when writing programs.
Thank you ... got it ...
Print via Print() and you won't have these questions, it's not difficult.
Thanks ... Got it ... I just thought theOrdersTotal count was also including zero ... Then I was wrong, I wrote like this(int i=OrdersTotal(); i>-1; i--) and it didn't work properly.
In the documentation, in the article "Indicator Styles in Examples" it says :
By default, the indicator buffer is used to store the data to be drawn (INDICATOR_DATA).
If the calculation of indicator values requires intermediate calculations and storing an auxiliary value for each bar, you can declare such an array as a calculation buffer ( INDICATOR_CALCULATIONS) when binding.
None of 18 given examples of constructions in MQL5 demonstrates thearray of calculation buffer ( INDICATOR_CALCULATIONS).Please advise where else to read about this topic ?
Hello!
In the documentation, in the article "Indicator Styles in Examples" it says :
By default, the indicator buffer is used to store the data to be drawn (INDICATOR_DATA).
If the calculation of indicator values requires intermediate calculations and storing an auxiliary value for each bar, you can declare such an array as a calculation buffer ( INDICATOR_CALCULATIONS) when binding.
None of 18 given examples of constructions in MQL5 demonstrates thearray of calculation buffer ( INDICATOR_CALCULATIONS).Please tell me where else to read about it ?
Think of it as a normal dynamic array for storing intermediate calculations. You just do not need to control it and increase/decrease its size - the terminal will do it for you. The data of such an array-buffer will not be shown on a chart - that's the difference between DATA and CALCULATIONS.
Think of it as a normal dynamic array for storing intermediate calculations. You just do not need to control it and increase/decrease its size - the terminal will do it for you. The data of such an array-buffer will not be printed on a chart - this is the difference between DATA and CALCULATIONS
Where's a working code example for clarity?
And the one you gave.... For example line 87 : maHandle=iMA(Symbol(),0,ExtPeriod,0,MODE_EMA,PRICE_CLOSE);
Well, what does it matter?