Trying my first Indicator. Any Support is really appreciated. Code Attachhed.
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); } //+------------------------------------------------------------------+
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).