I'm developing a simple indicator that paints the background panel:
- green color when MACD Histogram is rising
- red color when MACD Histogram is falling
This is the code:
if (MACD1.Diff[0] > MACD1.Diff[1])
{
BackBrushes[0] = Brushes.Green;
}
if (MACD1.Diff[0] < MACD1.Diff[1])
{
BackBrushes[0] = Brushes.Red;
}
My surprise is that it works totally the other way around as I expected. Please see image here attached. It is red when the MACD histogram is rising and green when going down.
What's wrong with this sentence? As far as I understand, it is stated very clear that MACD is rising, isn't it?
(MACD1.Diff[0] > MACD1.Diff[1])
regards
Albert

Comment