This is another spin of the classic MACD divergence indicator except we use a zero lag MACD and also consider the immediate price action to filter for stronger signals.

The only adjustable parameter is the lookback period to consider for calculating the divergence between price and the MACD crossover.

Note that the indicator only loads bars per default in order to load faster but this can easily be changed in the code if required.