The situation is this. I have an EMA plotting on my chart. I can clearly see that it is rising over several bars by looking at my chart. I can look at the values of the same bars in the databox and see that price is in fact rising between those 3 bars I'm concerned with.
I wrote an indicator that displays a graphic on the chart when certain conditions are met. On of the conditions is as follows:
EMA(Typical,14)[1] < EMA(Typical,14)[2] &&
Rising(EMA(Typical,14))
So, the ema should be falling between bars 2 and 1 but rising between bars 1 and 0.
It's that simple.
Well the problem in this case is this. The ema on the chart and price in the databox show the EMA is clearly rising over the 3 bars but yet the code evaluates the EMA as falling between bars 2 and 1. I printed price for those bars and sure enough price shows that bar 2 to 1 is falling but again, the databox shows different prices for those bars and show price rising.
How can this be explained so i can understand and fix this stupid problem...
I hope I've explained this so it's understandable.
Thanks,
Mike
Comment