Trying to code an indicator to show duration of bar for Renko charts
Thought I'd bump this in case anybody missed it that might be able to help.
Thanks.
i dont c anywhere that u r calculating renko like: double renko = iCostom(....);
| Counted_bars is initially zero, so your loop starts at Bars, which does not exist. No need for the decrement Contradictory information on IndicatorCounted() - MQL4 forum | if (counted_bars>0) counted_bars--; //---- main calculation loop int pos=Bars-counted_bars; while ( pos>0) { ExtMapBuffer1[pos] = Time[pos-1]-Time[pos]; pos--; } |
| Handle your look back of one zero. | //---- main calculation loop for(int pos=Bars-1-MathMax(1,counted_bars); pos >0 --pos) ExtMapBuffer1[pos] = Time[pos-1]-Time[pos]; |
Hi,
I've been trying to code an indicator ( only my second one! ) that will enable be to show the duration of each bar. This is to be used on Renko charts. However I'm having some difficulties even though on the face of it it should be simple. Below is the code, any suggestions gratefully received.