Hi please study the examples provided with the platform.
//+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int OnCalculate(const int rates_total, const int prev_calculated, const datetime &time[], const double &open[], const double &high[], const double &low[], const double &close[], const long &tick_volume[], const long &volume[], const int &spread[]) { //--- int limit; if(prev_calculated==0) { limit=0; } else { limit=prev_calculated-1; } //--- calculate value for(int i=limit;i<rates_total && !IsStopped();i++) { //--- do some calculations here... SomeBuffer[i]=high[i];// <-- assign some value to the buffer here, } //--- return value of prev_calculated for next call return(rates_total); } //+------------------------------------------------------------------+

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
Hi, this is my first indicator and I'm struggling to resolve an error. Any help is really appreciated to get me started.
I get the last 100 Bars on USDCAD and the last 100 Bars on EURUSD and I am tryting to find the ratio by dividing the USDCAD timeseries by the EURUSD timeseries.
However, for some reason on the final data point on the Indicator Plot, the drawing is plotted at zero. (Attached).