Hi,
Is it right that indicators can only work at ‘bar’ level, not at ‘tick’ level?
thanks
They can work at tick level in real time, but not historically.
Hi,
Is it right that indicators can only work at ‘bar’ level, not at ‘tick’ level?
thanks
By default indicators' routine occurs on bars, but one can tweak an indicator to process each ticks.
Thank you both.
Icham, can you provide some detail on how that tweak could be done?
Thank you both.
Icham, can you provide some detail on how that tweak could be done?
Yeah. Very simply.
int OnCalculate(const int rates_total, const int prev_calculated, const int begin, const double &price[]) { <------ even if this occurs each ticks //--- check for data if(rates_total<2*InpPeriodEMA-2) return(0); //--- int limit; if(prev_calculated==0) limit=0; else limit=prev_calculated-1; //--- calculate EMA ExponentialMAOnBuffer(rates_total,prev_calculated,0,InpPeriodEMA,price,Ema); //--- calculate EMA on EMA array ExponentialMAOnBuffer(rates_total,prev_calculated,InpPeriodEMA-1,InpPeriodEMA,Ema,EmaOfEma); //--- calculate DEMA for(int i=limit;i<rates_total && !IsStopped();i++) DemaBuffer[i]=2*Ema[i]-EmaOfEma[i]; <---- each element of this array is a bar //--- OnCalculate done. Return new prev_calculated. return(rates_total); }
Yeah. Very simply.
Its looks great! thank you very much!
Its looks great! thank you very much!
You welcome. Keep in mind that ...
Calculation based on data array
int OnCalculate( |
Calculations based on the current timeframe timeseries
int OnCalculate( |
All these arrays are bars. So you have to gather ticks datas yourself.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi,
Is it right that indicators can only work at ‘bar’ level, not at ‘tick’ level?
thanks