OPEN-SOURCE SCRIPT

Trinity Signal [Cythos]

134
Trinity Signal is a regime-adaptive indicator that combines three independent signal types into a single overlay. It automatically detects whether the market is trending or sideways, then activates the appropriate signal for each condition.

Unlike single-method indicators, Trinity Signal does not force one approach on all market conditions. Trend-following signals fire only during confirmed trends, while mean reversion signals activate only during sideways regimes.


🔶 THREE SIGNAL TYPES

1 — Volume Breakout (VB)
Fires during trending regimes when price breaks above/below the Donchian Channel with a volume spike (default 2.5x the 20-bar average). Additional filters: ADX must be above threshold and rising, ATR must be expanding relative to its 50-bar average, and DI+/DI- must confirm direction. An optional EMA trend filter (EMA 20 > EMA 50) is available for long entries.

2 — RSI Divergence (DIV)
Detects classic bullish and bearish RSI divergences using pivot points. A bullish divergence occurs when price makes a lower low but RSI makes a higher low. The minimum price difference and minimum RSI difference are configurable to filter out weak divergences. Regime filter prevents bullish divergences in bear regimes and bearish divergences in bull regimes.

3 — Mean Reversion (MR)
Activates only in sideways regimes. Uses Z-Score (standard deviations from the 20-bar mean) instead of RSI for entry detection. The Z-Score threshold adapts to current volatility: lower threshold (default 1.5) during low-volume periods, higher threshold (default 2.5) during high-volume periods. Entries beyond Z = 3.0 are blocked as cascade risk protection. An ATR percentile filter (default 65th percentile) prevents entries during abnormally volatile sideways conditions.


🔶 REGIME DETECTION

The regime engine uses a 3-vote ensemble:
• ADX vote — ADX above threshold with hysteresis (entry at 22, exit at 16 to prevent regime flicker)
• Bollinger Band Width vote — BB Width percentile rank above threshold
• ATR vote — ATR percentile rank above threshold

All three must agree for a "trending" classification. If trending, the regime is further classified as BULL (price > EMA 50) or BEAR (price < EMA 50). Otherwise, the regime is SIDEWAYS.

This unanimous-vote approach prevents false regime switches that would generate incorrect signals.


🔶 TP / SL SYSTEM

Each signal type has independent ATR-based take-profit and stop-loss multipliers:
• VB: TP = 5.0 ATR, SL = 4.0 ATR (trend-following: wide TP, moderate SL)
• DIV: TP = 3.5 ATR, SL = 2.5 ATR (balanced R:R)
• MR: TP = 3.0 ATR, SL = 7.0 ATR with 2% cap (mean reversion: small TP, wide SL, high win rate)

The indicator tracks a virtual position internally and shows TP exits as green dots and SL exits as pink dots on the chart. A minimum TP percentage filter prevents entries when ATR is too small relative to price.


🔶 ADDITIONAL FILTERS

• OI Confirmation (VB only) — When enabled, Volume Breakout signals require Open Interest to be above its 20-bar SMA. If OI is declining during a breakout, it may indicate a liquidation-driven move rather than genuine new positions.
• RSI Extreme Filter (VB only) — Blocks VB longs when RSI > 75 and VB shorts when RSI < 25 to avoid chasing exhausted moves.
• Cooldown — Separate cooldown periods for VB/DIV (default 8 bars) and MR (default 25 bars) to prevent signal clustering.
• No same-bar entry+exit — The indicator will not enter a new position on the same bar an exit occurred.
• Non-repainting — All signals evaluate only on confirmed (closed) bars using barstate.isconfirmed. Signals will never appear and then disappear.


🔶 HOW TO USE

• Add to any chart (optimized for crypto perpetual futures, 5-minute timeframe)
• "L" labels = long (buy) entry, "S" labels = short (sell) entry
• Green dot = take profit exit, Pink dot = stop loss exit
• White dot at entry = entry price marker
• All parameters are adjustable in the indicator settings
• JSON-formatted alerts are available for webhook integration


🔶 LIMITATIONS

• Designed primarily for crypto perpetual futures — default parameters are tuned on BTCUSDT 5m. Other pairs may require adjustment
• The 5-minute timeframe produces the most signals; higher timeframes will generate fewer signals
• Mean Reversion signals have a low R:R ratio by design (compensated by high win rate)
• Past performance in backtesting does not guarantee future results
• OI data may not be available for all symbols — the filter automatically skips when OI data is missing
• This is a tool to assist your analysis, not a standalone trading system. Always use proper risk management.

Declinazione di responsabilità

Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.