OPEN-SOURCE SCRIPT
Trend-Aware Oscillator [Indicatr]

Trend-Aware Oscillator puts classic oscillators into the context of the prevailing trend. Overbought in an uptrend is shown as strength, oversold in a downtrend as weakness, and pullback signals are only marked in the direction of the trend - for long and short.
WHAT IT DOES
Oscillators such as RSI or Stochastic are often read as "overbought = sell, oversold = buy". In trending markets this reading fails: an oscillator can stay overbought for weeks in an uptrend and oversold for weeks in a downtrend. This script adds a trend regime and changes how readings are coloured and signalled.
HOW IT WORKS
Each oscillator has its own default levels, e.g. RSI 70/30 with pullback levels 60/40, Williams %R -20/-80 with -30/-70. Custom levels can be set in the inputs.
HOW TO USE
THE CHART
BTCUSD daily with RSI 14 and the EMA 200 trend filter. Red background = downtrend regime, green background = uptrend regime. In the downtrend phase the red triangles mark RSI rejections from the 60 level (pullback short). After the regime turns up, RSI above 70 is coloured as strength instead of an exit signal.
WHAT IS ORIGINAL
The built-in oscillators show readings without context. This script adds a selectable trend regime, regime-dependent colouring (strength/weakness instead of overbought/oversold), oscillator-specific pullback levels and symmetric long/short pullback logic. Combining eight oscillators in one script is intentional: the same trend logic is applied to interchangeable momentum sources so they can be compared on equal terms.
CREDITS
RSI and ADX/DMI (J. Welles Wilder), Stochastic (George Lane), Williams %R (Larry Williams), CCI (Donald Lambert), MFI (Gene Quong and Avrum Soudack), Fisher Transform (John Ehlers). The WaveTrend calculation follows the community version popularised on TradingView by LazyBear; it is re-implemented here and credited accordingly.
LIMITATIONS
Disclaimer
For educational and analytical purposes only. Not financial advice. Marks and signals are not buy or sell recommendations. Past behaviour does not guarantee future results.
WHAT IT DOES
Oscillators such as RSI or Stochastic are often read as "overbought = sell, oversold = buy". In trending markets this reading fails: an oscillator can stay overbought for weeks in an uptrend and oversold for weeks in a downtrend. This script adds a trend regime and changes how readings are coloured and signalled.
HOW IT WORKS
- Choose one oscillator: RSI, Stochastic, Stochastic RSI, Williams %R, CCI, MFI, WaveTrend or Fisher Transform. All use their standard formulas.
- Trend filter classifies every bar as uptrend, downtrend or no trend:
EMA - price above a rising EMA (default 200) = uptrend, below a falling EMA = downtrend.
ADX / DMI - ADX above the threshold with +DI above -DI = uptrend, the opposite = downtrend.
EMA + ADX - both must agree. - Uptrend: overbought readings are coloured as strength, not as a sell signal. A trend pullback long (green triangle) is marked when the oscillator dips below the uptrend pullback level and crosses back above it.
- Downtrend: oversold readings are coloured as weakness, not as a buy signal. A trend pullback short (red triangle) is marked when the oscillator rises above the downtrend pullback level and crosses back below it.
- No trend: classic overbought/oversold reversal marks can optionally be shown (grey circles).
Each oscillator has its own default levels, e.g. RSI 70/30 with pullback levels 60/40, Williams %R -20/-80 with -30/-70. Custom levels can be set in the inputs.
HOW TO USE
- Use it as a context tool: is an extreme reading more likely continuation or exhaustion, given the trend?
- Combine the pullback marks with your own entry rules, levels and risk management.
- Alerts: trend pullback long, trend pullback short, range long, range short.
THE CHART
BTCUSD daily with RSI 14 and the EMA 200 trend filter. Red background = downtrend regime, green background = uptrend regime. In the downtrend phase the red triangles mark RSI rejections from the 60 level (pullback short). After the regime turns up, RSI above 70 is coloured as strength instead of an exit signal.
WHAT IS ORIGINAL
The built-in oscillators show readings without context. This script adds a selectable trend regime, regime-dependent colouring (strength/weakness instead of overbought/oversold), oscillator-specific pullback levels and symmetric long/short pullback logic. Combining eight oscillators in one script is intentional: the same trend logic is applied to interchangeable momentum sources so they can be compared on equal terms.
CREDITS
RSI and ADX/DMI (J. Welles Wilder), Stochastic (George Lane), Williams %R (Larry Williams), CCI (Donald Lambert), MFI (Gene Quong and Avrum Soudack), Fisher Transform (John Ehlers). The WaveTrend calculation follows the community version popularised on TradingView by LazyBear; it is re-implemented here and credited accordingly.
LIMITATIONS
- The trend filter lags by design - regime changes are confirmed after the move has started.
- In choppy markets the regime can switch often.
- Signals can appear and disappear on the current, unclosed bar.
Disclaimer
For educational and analytical purposes only. Not financial advice. Marks and signals are not buy or sell recommendations. Past behaviour does not guarantee future results.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
Indicatr - the indicators you know, rebuilt with market context: volume, trend and momentum, for long and short. Free open-source tools and Pro tools. Guides and setups: indicator.trading/en/link
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
Indicatr - the indicators you know, rebuilt with market context: volume, trend and momentum, for long and short. Free open-source tools and Pro tools. Guides and setups: indicator.trading/en/link
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.