Slow Moving Average:
The top chart shows the moving average used to filter trends. I recommend using a higher window length(can be adjusted with the 'lenSlowMA' input option). I wanted this to be a very , so I used the following formula:
slow MA = ( (close, 64), 64)
This resulted in a pretty smooth line that still detects major price movements very well.
-The background and bar colors both change in response to the Slow MA's value. The background and bars change to green when a is detected and red when .
Bear and Bull Power:
To balance things out a little, I included two histogram's based on Elder's Ray. Here, a more responsive with a shorter window length is used to calculate the bull and bear power values and track short-term price fluctuations.
NOTE: The length of the used here can be adjusted in the input menu.
Bull Power = current high - (close, 13)
Bear Power = current low - (close, 13)
In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.