what do they count? do they count every variation of price on every tick, or on each bar?
for example here:
I've seen that on OnCalculate, it counts each variation on tick, but, how do I do an indicator that counts on each time period bar?
Bars
rates_total parameter represents the total number of bars on the chart
prev_calculated parameter indicates the number of bars that have been calculated in the previous call of the OnCalculate function
begin parameter indicates the index of the first bar to be calculated in the current call
price array contains the price data for the bars
I've seen that on OnCalculate, it counts each variation on tick, but, how do I do an indicator that counts on each time period bar?
Actually, if you want to count ticks you use for loops within OnCalculate.
// Iterate over each bar for (int i = prev_calculated; i < rates_total; i++) { // Count ticks within the bar }
![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
what do they count? do they count every variation of price on every tick, or on each bar?
for example here: