Since the crossover rules for this oscillator frequently give false signals, I have opted for a more general approach: When the oscillator passes above the 50 line, the background of the indicator will turn green, indicating a general short term buy condition. When the oscillator passes below the -50 line, the background of the indicator will turn red, indicating a general short term sell condition. Use this indicator in combination with other indicators and price signals to identify short term trend changes.
This version improves on existing versions by:
- Adding background colors to indicate general buy/sell conditions
- More visually appealing
- Uses the latest version 5 features
- Well documented source code that conforms to the style guide
- Turn off indicator overlay mode
- Fix erroneous tooltip
- Changed the rendering of horizontal lines to use hline() instead of plot()
- Rename Buy/Sell to Uptrend/Downtrend
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.