The indicator shows the MACD histogram sign (positive or negative) for several timeframes at once. You can see at a glance how the price is trending across higher and lower timeframes.
The code uses recursive calculations for the SMA and EMA to avoid lookahead errors and repainting on higher timeframes.
Note that, for lower timeframes, the line becomes yellow to the left because history is limited and there are not enough bars to calculate.