I'm simply trying to count the number of Renko ups and downs over a given period and get a ratio. Getting a weird problem with the plot even though it compiles OK. This is the code:
if (CurrentBar < LookBack) return; int CountUp = CountIf(delegate {return Close[0] > Open[0];}, LookBack); int CountDown = CountIf(delegate {return Close[0] < Open[0];}, LookBack); double a = CountUp / (CountUp + CountDown); Plot0.Set( (double) a);
- Plot0.Set(a) plots to zero only
- Plot0.Set( (double) a) it sometimes plots to zero and sometimes plots as the expected decimal.
There are no errors in the log.
Could someone please explain the best way to approach this.
Many thanks in advance.
Comment