For some reason when I use IndicatorParameters(); on the ROC I get an extra input parameter when there is only 1 input parameter. It seems like a bug since all other indicators I have tested work.
It's not a bug. When the OnCalculate() is declared this way:
int OnCalculate( const int rates_total, // price[] array size const int prev_calculated, // number of handled bars at the previous call const int begin, // index number in the price[] array meaningful data starts from const double& price[] // array of values for calculation );
The price array is considered an input.
But when OnCalculate() is declared this way:
int OnCalculate( const int rates_total, // size of input time series const int prev_calculated, // number of handled bars at the previous call const datetime& time{}, // Time array const double& open[], // Open array const double& high[], // High array const double& low[], // Low array const double& close[], // Close array const long& tick_volume[], // Tick Volume array const long& volume[], // Real Volume array const int& spread[] // Spread array );
It's not an input.
So you can verify by checking back those indicators you've tested and see which OnCalculate() do they use...
It's not a bug. When the OnCalculate() is declared this way:
The price array is considered an input.
But when OnCalculate() is declared this way:
It's not an input.
So you can verify by checking back those indicators you've tested and see which OnCalculate() do they use...
Thanks, is there a way I can detect which version of OnCalculate() an indicator uses; so I don't have to manually go through all the code of the indicators I have already tested?
I'm not aware of any way.
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
For some reason when I use IndicatorParameters(); on the ROC I get an extra input parameter when there is only 1 input parameter. It seems like a bug since all other indicators I have tested work.
https://www.mql5.com/en/code/46