What's wrong with my simple iMA indicator ?? (MQL5)
ccou:
Hi!
For some reason, it doesn't show anything and if I click on "Refresh", then I only see the moving average last part on the chart.
I must precise that I'm offline using custom symbols.
Please help!
Thanks
int OnCalculate(const int rates_total, const int prev_calculated, const int begin, const double &price[]) { if(BarsCalculated(ma_handle) < rates_total) return 0; int to_copy; if(prev_calculated>rates_total || prev_calculated<=0) to_copy=rates_total; else { to_copy=rates_total-prev_calculated; to_copy++; } //PlotIndexSetInteger(0,PLOT_DRAW_BEGIN,rates_total-periodMA-1); if(CopyBuffer(ma_handle,0,0, to_copy, MA) <= 0) return 0; return rates_total-1; }
Thanks. Can you please explain ? :
1) When "prev_calculated" can be > "rates_total", in which cases ?
2) When "prev_calculated" can be < 0, in which cases ? (I understand it can be == 0)
Thanks
Hi!
For some reason, it doesn't show anything and if I click on "Refresh", then I only see the moving average last part on the chart.
I must precise that I'm offline using custom symbols.
Please help!
Thanks