OPEN-SOURCE SCRIPT
Solana 4H RSI->MACD — Counter-Trend By Tetrad

Tetrad RSI→RSI Cross→MACD (Sequenced) — Counter-Trend (SL-Only)
Category: Market-neutral, counter-trend, sequenced entries
Timeframe default: Works on any TF; designed around 4H On Solana
Markets: Any (spot, perp, futures); parameterize to your asset
What it does
This strategy hunts reversals using a 3-step sequence on RSI and MACD, then optionally restricts entries by market regime and a price gate. It shows stop-loss lines only when hit (clean chart), and paints a Donchian glow for quick read of backdrop conditions.
Entry logic (sequenced)
1. RSI Extreme:
Long path activates when RSI < Oversold (default 27.5).
Short path activates when RSI > Overbought (default 74).
2. RSI Cross confirmation:
Long path: RSI crosses up back above the oversold level.
Short path: RSI crosses down back below the overbought level.
Each step has a max bar lookback so stale signals time out.
3. MACD Cross trigger:
Long: MACD line crosses above Signal.
Short: MACD line crosses below Signal.
→ When step 3 fires and gates are satisfied, a trade is entered.
Optional gates & filters
Regime Filter (Counter-Trend):
Longs allowed in **Range / Short Trend / Short Parabolic** regimes.
Shorts allowed in **Range / Long Trend / Long Parabolic** regimes.
Based on ADX/DI and ATR% intensity.
* Price Gate (Long Ceiling):
Toggle to **disable new longs above a chosen price (default 209.0 For SOL).
Useful for assets like SOL where you want longs only below a cap.
Exits / Risk
* Stop-Loss (% of entry):** default **14%**, toggleable.
* SL visualization:** plots a **thin dashed red line only on the bar it’s hit**.
* (No take-profit or time-based exit in this version—keep it pure to the sequence and regime. Add TP/time exits if desired.)
Visuals
* Donchian Glow (50): background band only (upper/lower lines hidden).
* Regime HUD: compact table (top-right) highlighting the active regime.
* Minimal marks: no entry/exit “arms” clutter; only SL-hit lines render.
Inputs (key)
* Core: RSI Length, Oversold/Overbought, MACD Fast/Slow/Signal.
* Sequence: Max bars from Extreme→RSI Cross and RSI Cross→MACD Cross.
* Regime: ADX Length, Trend/Parabolic thresholds, ATR length & floor.
* Stops: Enable/disable; SL %.
* Price Gate: Enable; Long ceiling price.
Alerts
Sequenced Long (CT): RSI<low → RSI cross up → MACD bull cross (+ price gate).
Sequenced Short (CT): RSI>high → RSI cross down → MACD bear cross.
## Notes & Tips
Designed for counter-trend fades that become trend rides. The regime filter helps avoid fading true parabolics and aligns entries with safer contexts.
The sequence is stateful (steps must occur in order). If a step times out, the path resets.
Works on lower TFs, but the 4H baseline reduces noise and over-trading.
Consider pairing with volume or structure filters if you want fewer but higher-conviction entries.
Past performance ≠ future results. **Educational use only. Not financial advice.
Category: Market-neutral, counter-trend, sequenced entries
Timeframe default: Works on any TF; designed around 4H On Solana
Markets: Any (spot, perp, futures); parameterize to your asset
What it does
This strategy hunts reversals using a 3-step sequence on RSI and MACD, then optionally restricts entries by market regime and a price gate. It shows stop-loss lines only when hit (clean chart), and paints a Donchian glow for quick read of backdrop conditions.
Entry logic (sequenced)
1. RSI Extreme:
Long path activates when RSI < Oversold (default 27.5).
Short path activates when RSI > Overbought (default 74).
2. RSI Cross confirmation:
Long path: RSI crosses up back above the oversold level.
Short path: RSI crosses down back below the overbought level.
Each step has a max bar lookback so stale signals time out.
3. MACD Cross trigger:
Long: MACD line crosses above Signal.
Short: MACD line crosses below Signal.
→ When step 3 fires and gates are satisfied, a trade is entered.
Optional gates & filters
Regime Filter (Counter-Trend):
Longs allowed in **Range / Short Trend / Short Parabolic** regimes.
Shorts allowed in **Range / Long Trend / Long Parabolic** regimes.
Based on ADX/DI and ATR% intensity.
* Price Gate (Long Ceiling):
Toggle to **disable new longs above a chosen price (default 209.0 For SOL).
Useful for assets like SOL where you want longs only below a cap.
Exits / Risk
* Stop-Loss (% of entry):** default **14%**, toggleable.
* SL visualization:** plots a **thin dashed red line only on the bar it’s hit**.
* (No take-profit or time-based exit in this version—keep it pure to the sequence and regime. Add TP/time exits if desired.)
Visuals
* Donchian Glow (50): background band only (upper/lower lines hidden).
* Regime HUD: compact table (top-right) highlighting the active regime.
* Minimal marks: no entry/exit “arms” clutter; only SL-hit lines render.
Inputs (key)
* Core: RSI Length, Oversold/Overbought, MACD Fast/Slow/Signal.
* Sequence: Max bars from Extreme→RSI Cross and RSI Cross→MACD Cross.
* Regime: ADX Length, Trend/Parabolic thresholds, ATR length & floor.
* Stops: Enable/disable; SL %.
* Price Gate: Enable; Long ceiling price.
Alerts
Sequenced Long (CT): RSI<low → RSI cross up → MACD bull cross (+ price gate).
Sequenced Short (CT): RSI>high → RSI cross down → MACD bear cross.
## Notes & Tips
Designed for counter-trend fades that become trend rides. The regime filter helps avoid fading true parabolics and aligns entries with safer contexts.
The sequence is stateful (steps must occur in order). If a step times out, the path resets.
Works on lower TFs, but the 4H baseline reduces noise and over-trading.
Consider pairing with volume or structure filters if you want fewer but higher-conviction entries.
Past performance ≠ future results. **Educational use only. Not financial advice.
Skrip open-source
Dengan semangat TradingView yang sesungguhnya, penulis skrip ini telah menjadikannya sumber terbuka, sehingga para trader dapat meninjau dan memverifikasi fungsinya. Hormat untuk penulisnya! Meskipun anda dapat menggunakannya secara gratis, ingatlah bahwa penerbitan ulang kode tersebut tunduk pada Tata Tertib kami.
Pernyataan Penyangkalan
Informasi dan publikasi tidak dimaksudkan untuk menjadi, dan bukan merupakan saran keuangan, investasi, perdagangan, atau rekomendasi lainnya yang diberikan atau didukung oleh TradingView. Baca selengkapnya di Persyaratan Penggunaan.
Skrip open-source
Dengan semangat TradingView yang sesungguhnya, penulis skrip ini telah menjadikannya sumber terbuka, sehingga para trader dapat meninjau dan memverifikasi fungsinya. Hormat untuk penulisnya! Meskipun anda dapat menggunakannya secara gratis, ingatlah bahwa penerbitan ulang kode tersebut tunduk pada Tata Tertib kami.
Pernyataan Penyangkalan
Informasi dan publikasi tidak dimaksudkan untuk menjadi, dan bukan merupakan saran keuangan, investasi, perdagangan, atau rekomendasi lainnya yang diberikan atau didukung oleh TradingView. Baca selengkapnya di Persyaratan Penggunaan.