OPEN-SOURCE SCRIPT
업데이트됨 NEXUS Signal Engine

NEXUS Signal Engine
Confluence Trading System
OVERVIEW
NEXUS Signal Engine (NSE) is a multi-indicator confluence system designed for cryptocurrency and futures markets. It combines six established open-source technical analysis components — credited in full below — into a unified signal framework featuring an original state-machine trade lifecycle, dual signal architecture (Grand + Trend), multi-symbol AutoTrend filtering, automated exit management (Stop / TP1 / TP2 / Breakeven / Trailing Stop), a structured alert system with JSON output, and an on-chart simulation table for historical review.
The core concept: rather than monitoring six separate indicators and manually assessing their agreement, NSE merges them into a single confluence score. When enough components align, the engine generates an entry signal and then tracks that signal from entry to exit through a rule-based state machine — all within one overlay indicator.
CREDITS AND ACKNOWLEDGMENTS
This indicator is built upon the following open-source works from the TradingView community. Full credit and sincere thanks to the original authors:
These six components provide the foundational signal inputs. All additional logic — including the confluence scoring engine, state machine architecture, trade lifecycle management, exit logic (TP1/TP2/Breakeven/Trailing), AutoTrend multi-symbol filter, Symbol EMA filter, dual signal system, alert dispatch architecture, simulation table, and theme/mobile system — represents original work.
RECOMMENDED CHART SETUP

This indicator is designed for use with Heikin Ashi candles for cleaner signal generation and smoother trend visualization.
HOW THE SIGNAL ENGINE WORKS
NSE uses a quad-indicator confluence framework. Four independent sub-indicators run simultaneously:
When a configurable minimum number of these four components fire within a signal bar window — combined with additional filters (RSI Band touch, WaveTrend zone visit) — the engine generates a signal.
SIGNAL TYPES
Grand Signals: Higher-confluence signals requiring agreement across all four sub-indicators, RSI band touch, and WaveTrend extreme zone visit. These represent the strongest alignment conditions the engine can detect.
Trend Signals: Macro-trend-aligned entries. Fire when the AutoTrend filter confirms direction, price touches its RSI entry band, and optional Symbol EMA and WaveTrend filters pass. If a Grand signal fires on the same bar, the Trend signal is suppressed.
ENTRY AND EXIT MECHANICS
Entry: Confirmed at bar close when all signal conditions are met. Entry price, stop level, and TP1 target are drawn on the chart immediately.
Stop Level — Grand signals: Lowest low (longs) or highest high (shorts) over the past N bars (configurable lookback).
Stop Level — Trend signals: ATR-based stop with a configurable multiplier.
TP1 Target: Dynamic RSI TP band that updates each bar, adapting to market conditions rather than using a fixed-distance level.
After TP1 is reached:
Confluence Trading System
OVERVIEW
NEXUS Signal Engine (NSE) is a multi-indicator confluence system designed for cryptocurrency and futures markets. It combines six established open-source technical analysis components — credited in full below — into a unified signal framework featuring an original state-machine trade lifecycle, dual signal architecture (Grand + Trend), multi-symbol AutoTrend filtering, automated exit management (Stop / TP1 / TP2 / Breakeven / Trailing Stop), a structured alert system with JSON output, and an on-chart simulation table for historical review.
The core concept: rather than monitoring six separate indicators and manually assessing their agreement, NSE merges them into a single confluence score. When enough components align, the engine generates an entry signal and then tracks that signal from entry to exit through a rule-based state machine — all within one overlay indicator.
CREDITS AND ACKNOWLEDGMENTS
This indicator is built upon the following open-source works from the TradingView community. Full credit and sincere thanks to the original authors:
- Section 1: "Pivot Point SuperTrend" by LonesomeTheBlue
- Section 2: "SuperTrend" by KivancOzbilgic
- Section 3: "Chandelier Exit" by everget
- Section 4: "Twin Range Filter" by colinmck
- Section 5: "RSI Bands, RSI %B and RSI Bandwidth" by LazyBear
- Section 6: "WaveTrend with Crosses" by LazyBear
These six components provide the foundational signal inputs. All additional logic — including the confluence scoring engine, state machine architecture, trade lifecycle management, exit logic (TP1/TP2/Breakeven/Trailing), AutoTrend multi-symbol filter, Symbol EMA filter, dual signal system, alert dispatch architecture, simulation table, and theme/mobile system — represents original work.
RECOMMENDED CHART SETUP
This indicator is designed for use with Heikin Ashi candles for cleaner signal generation and smoother trend visualization.
- Step 1 — Switch to Heikin Ashi candles: Open your chart, click the candle type dropdown in the top toolbar, and select Heikin Ashi.
- Step 2 — Hide the default candle visuals: Double-click on any candle, or click the gear icon next to the symbol name. Go to the "Style" tab. Uncheck all three boxes: Body, Borders, and Wick. Click OK. This allows NSE's own HA overlay to render cleanly.
- Step 3 — Bring NSE to front: Right-click on the indicator on the chart. Select "Visual Order" then "Bring to Front". This ensures NSE's Heikin Ashi candles, RSI bands, and signal labels render above all other elements.
HOW THE SIGNAL ENGINE WORKS
NSE uses a quad-indicator confluence framework. Four independent sub-indicators run simultaneously:
- 1. Pivot Point SuperTrend — Dynamic support/resistance using pivot-centered ATR bands
- 2. Classic SuperTrend — Volatility-based trend detection with configurable ATR multiplier
- 3. Chandelier Exit — Trailing volatility stop for trend confirmation
- 4. Twin Range Filter — Dual-period noise filter using smoothed range calculations
When a configurable minimum number of these four components fire within a signal bar window — combined with additional filters (RSI Band touch, WaveTrend zone visit) — the engine generates a signal.
SIGNAL TYPES
Grand Signals: Higher-confluence signals requiring agreement across all four sub-indicators, RSI band touch, and WaveTrend extreme zone visit. These represent the strongest alignment conditions the engine can detect.
Trend Signals: Macro-trend-aligned entries. Fire when the AutoTrend filter confirms direction, price touches its RSI entry band, and optional Symbol EMA and WaveTrend filters pass. If a Grand signal fires on the same bar, the Trend signal is suppressed.
ENTRY AND EXIT MECHANICS
Entry: Confirmed at bar close when all signal conditions are met. Entry price, stop level, and TP1 target are drawn on the chart immediately.
Stop Level — Grand signals: Lowest low (longs) or highest high (shorts) over the past N bars (configurable lookback).
Stop Level — Trend signals: ATR-based stop with a configurable multiplier.
TP1 Target: Dynamic RSI TP band that updates each bar, adapting to market conditions rather than using a fixed-distance level.
After TP1 is reached:
- TP1 Close Percentage = 100%: Full position closes at TP1. Signal is complete.
- TP1 Close Percentage = 50% or 75%: Partial close at TP1. The remaining portion enters a trailing phase:
Stop moves to breakeven (entry price)
ATR-based trailing stop activates
If trailing stop is hit: TP2 exit (remaining position closes)
If breakeven is hit: position closes at entry price (TP1 gains are preserved)
EFFECT OF AUTOTREND FILTERING
The AutoTrend filter uses an external reference symbol across two configurable timeframes with EMA alignment to determine macro market direction.
Bull condition: Reference symbol's close is above its EMA on both selected timeframes.
Bear condition: Reference symbol's close is below its EMA on both selected timeframes.
The filtering strength parameter controls how strictly this directional condition must be satisfied before signals are allowed through.
Off (No filtering):
AutoTrend filtering is disabled. The engine generates signals in both directions regardless of macro environment. Signal frequency is highest. This mode is suited to short-term or range-bound conditions where macro direction is less relevant, but the risk of counter-trend entries increases.
Low (Mild filtering):
Minor noise and small counter-trend price moves are suppressed while the indicator remains responsive to directional changes. Suitable for intraday timeframes with moderate trend clarity.
Medium (Recommended default):
Balanced filtering. Provides the most practical trade-off between signal reactivity and noise reduction. Works well across most instruments and timeframes. Trend reversals are captured with reasonable lag and improved reliability compared to lower settings.
High (Strict filtering):
Only clearly established trend conditions generate signals. Signal frequency decreases while the conditions for each signal become more stringent. Suited to higher timeframes, swing trading approaches, or periods of elevated volatility where avoiding false reversals takes priority.
High– Grand Only
Common reference symbol options:
Alt. Referans (ETH.D – Medium)
BTCUSDT, BTC.D, USDT.D, TOTAL, TOTAL2, TOTAL3, OTHERS.D, SPX500, DXY, NDX, US100, XU100, XU30
Alt. Referans (ETH.D – High EMA)
Recommended timeframe combinations based on your chart: - 15-minute charts: TF1 = 60 (1H), TF2 = 240 (4H)
- 1-hour charts: TF1 = 240 (4H), TF2 = D (Daily)
- 4-hour charts: TF1 = D (Daily), TF2 = D (Daily) with a longer EMA period
The AutoTrend filter can be applied to Grand signals only, Trend signals only, or both — configurable via the "Apply AutoTrend Filter to Grand Signals" toggle.
SYMBOL EMA FILTER
Independent of the AutoTrend system. Applies a local EMA directly to the current symbol's price. When active:
*Trend Buy signals require: close > Symbol EMA
*Trend Sell signals require: close < Symbol EMA
This provides an additional fast local trend confirmation layered on top of the macro AutoTrend direction.
ALERT SYSTEM
NSE includes a structured alert system covering all signal events: - Entry alerts: LONG / SHORT (separate for Grand and Trend signals)
- Exit alerts: TP1 Partial, TP1 Full, TP2 Trailing, Stop Loss, Breakeven
All alerts output structured JSON, making them compatible with webhook-based automation. Each alert type has independent enable/disable toggles and frequency settings (Once Per Bar / Once Per Bar Close).
Setup: Add the indicator to your chart, click "Create Alert", select "Any alert() function call" as the condition, and configure your webhook URL if using external automation.
SIGNAL SIMULATION TABLE
The on-chart table displays a historical signal review based on past bar data. All values are expressed in units (u) based on the configurable Risk Unit parameter.
How units work: Each stop hit equals the negative value of the risk unit (e.g., -100u at default settings). TP1 and TP2 outcomes vary based on the actual distance between entry and the RSI TP band at that time. This unit-based framework allows signal quality to be assessed independently of position sizing.
The table includes: - TP1 Rate: percentage of signals that reached the TP1 level
- TP1 / TP2 / Stop / Breakeven counts with unit-based outcomes
- Average R-Multiple across completed signals
- Grand vs Trend breakdown with separate metrics for each signal type
- Maximum consecutive win and loss streaks
- Lookback window: Last 10, 20, 50, 100, or All signals
Parameters that meaningfully affect simulation characteristics include RSI OB/OS levels, Stop Lookback, WT Lookback, Trend ATR Multiplier, and Symbol EMA Period. Small adjustments to these can shift signal behavior for specific instruments and timeframes.
CUSTOMIZATION OPTIONS
Visual: 5 color presets (Classic, Aqua, Cosmic, Ember, Neon) with Dark/Light theme support. Mobile/Tablet mode for smaller screens.
Parameters: Every sub-indicator period, multiplier, and threshold is individually configurable. Default values provide a general starting point; optimal settings vary by symbol and timeframe.
Stop and TP: Configurable trigger modes (Wick vs Close) for stop loss, TP1, and trailing stop independently. TP1 close percentage (50% / 75% / 100%). Trailing ATR multiplier.
Lines: Entry, Stop, TP1, Breakeven, and Trailing stop line colors and widths are all adjustable.
TECHNICAL NOTES - Uses request.security() with close[1] and lookahead_on for confirmed higher-timeframe data to avoid repainting.
- State machine with 5 states: 0 = flat, 1 = long TP1 phase, -1 = short TP1 phase, 2 = long trailing, -2 = short trailing.
- The TP1 level follows the RSI TP band dynamically each bar.
- Stop levels are fixed at entry and do not move (Grand: swing-based, Trend: ATR-based).
- Heikin Ashi candles are calculated internally and are not derived from chart HA values.
DISCLAIMER
This indicator is published for educational and analytical purposes only. It does not constitute financial advice. - The signal simulation table uses a simplified fixed-risk model expressed in abstract units (u). It does not account for slippage, commissions, spreads, liquidity, funding rates, or real-world execution conditions.
- Simulation results are shown in units (u), not real currency.
- Historical signal behavior does not predict or guarantee future results.
- This is an indicator, not a strategy — it identifies historical confluence conditions based on past price data.
- All trading involves substantial risk of loss.
- Conduct your own independent analysis before making any trading decisions.
- The author assumes no responsibility for financial decisions made using this tool.
Use this indicator as one analytical input among others, not as a standalone decision-making system.
릴리즈 노트
NEXUS Signal Engine 🅰🅻🅿 — Update Notes🔧 PnL Calculation Fix & Dashboard Improvements
This update addresses a critical PnL calculation bug that affected all users running the indicator in "Close" Stop Loss Trigger mode, along with several dashboard enhancements.
🐛 Bug Fix: Stop Loss PnL Calculation (Close Mode)
Problem: When "Stop Loss Trigger" was set to Close (instead of Wick), the stop loss PnL was always recorded as a fixed -100u (equal to the Risk Unit), regardless of the actual bar close price. This happened because the exit price in Close mode is the candle's close — which can be significantly below (for longs) or above (for shorts) the stop level — but the code was writing a hardcoded -tbl_risk value instead of computing the real loss.
Impact: All stats table metrics were affected: Net Result, Stop Hits PnL, Grand/Trend Net, Avg R-Multiple, Best/Worst Signal, and Win/Loss streaks. The on-chart SL labels also displayed incorrect values.
Fix: Stop loss PnL is now calculated dynamically using the actual exit price (close in Close mode, stopLvl in Wick mode) through the standard f_calc_pnl() function. In Wick mode the result remains exactly -1R as before. In Close mode, the result now reflects the true slippage — losses can be larger or smaller than 1R depending on where the bar actually closed.
🐛 Bug Fix: Breakeven Exit PnL (Close Mode)
Problem: When a position reached TP1 partial close and then hit the Breakeven level, the remaining portion's PnL (TP2 slice) was not being calculated. The dashboard only showed the TP1 partial profit, ignoring any loss on the remaining position in Close mode (where the bar close can be below the entry/BE level).
Fix: The TP2 portion PnL is now properly calculated at breakeven exits. The BE label and dashboard now show the accurate combined result (TP1 profit + TP2 portion gain/loss). This makes the breakeven row in the stats table reflect reality.
📊 Dashboard Improvements
Stop Loss Labels: SL labels on the chart now display the actual calculated loss (e.g., "SL -127.45u" or "SL -83.20u") instead of the previous hardcoded "SL -100u".
Breakeven Labels: BE labels now show the true combined PnL (TP1 partial + TP2 portion) instead of only the TP1 partial amount.
TP2 Hits Row Color: The TP2 Hits value in the stats table now changes color dynamically — green when positive, red/orange when negative — instead of being always green.
Breakeven Row in Table: The BE row now correctly includes the TP2 portion PnL in its total, giving an accurate representation of breakeven trade outcomes.
New:Worst Signal Row: A new "Worst Signal" row has been added to the Simulation Analytics section, showing the largest single-trade loss. This helps users assess worst-case drawdown per signal — especially important in Close mode where stop losses can exceed 1R.
⚠️ Important Notes
- Wick mode users: No change in behavior. In Wick mode, stop losses still exit exactly at the stop level, so PnL remains -1R as before.
- Close mode users: Your stats will now look different (and more accurate). If your previous Net Result seemed unusually high, it was likely because stop losses were being underreported.
- All other features (entries, TP1, TP2 trailing, alerts, AutoTrend, WaveTrend, RSI Bands) remain unchanged.
📋 Summary of Changes
Area Before. After
Stop Loss PnL (Close mode) Always -100u (fixed) Real PnL based on close price
SL Chart Label "SL -100u" (hardcoded) Actual loss value
BE Exit PnL TP1 portion only TP1 + TP2 portion combined
BE Chart Label TP1 profit only True combined result
TP2 Hits color Always green Dynamic (green/red)
Worst Signal row Not available Shows largest loss
Table rows 41 43
Simulation for educational purposes only. Not financial advice. Past signals do not predict future results.
릴리즈 노트
Fix Minor Bugs오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.