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.
Script open-source
Dans l'esprit de TradingView, le créateur de ce script l'a rendu open-source, afin que les traders puissent examiner et vérifier sa fonctionnalité. Bravo à l'auteur! Vous pouvez l'utiliser gratuitement, mais n'oubliez pas que la republication du code est soumise à nos Règles.
Clause de non-responsabilité
Les informations et les publications ne sont pas destinées à être, et ne constituent pas, des conseils ou des recommandations en matière de finance, d'investissement, de trading ou d'autres types de conseils fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.
Script open-source
Dans l'esprit de TradingView, le créateur de ce script l'a rendu open-source, afin que les traders puissent examiner et vérifier sa fonctionnalité. Bravo à l'auteur! Vous pouvez l'utiliser gratuitement, mais n'oubliez pas que la republication du code est soumise à nos Règles.
Clause de non-responsabilité
Les informations et les publications ne sont pas destinées à être, et ne constituent pas, des conseils ou des recommandations en matière de finance, d'investissement, de trading ou d'autres types de conseils fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.