Confluence Engine PRO [EXCAVO]

993
Multi-Factor Confluence Detection with Per-Signal Outcome Verification and Historical Hit-Rate Statistics

The Confluence Engine PRO is a two-component system. The first component
detects bullish and bearish conditions when ten technical factors align beyond
a configurable threshold. The second component is the outcome verification
engine: every fired detection is tracked from inception until its stop-loss is
hit, recording exactly which reference levels (R1, R2, R3, R4) were reached
along the way. Aggregate hit rates across the chart history are displayed in
the dashboard, providing live historical evidence about how this indicator
has performed on the current instrument and timeframe.

This is not a flat confluence-only indicator. The outcome engine layered on
top transforms the detection stream into a self-evidencing system - each new
detection arrives accompanied by historical context about how the same condition
class has resolved before.

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
▸ HOW TO USE

Step 1 → Add the indicator. The EMA ribbon (fast / slow) and trend EMA
appear on the chart. The dashboard begins computing the
confluence score and showing historical hit rates from any
prior detections visible in the chart history.
Step 2 → When the score exceeds the threshold, a numeric label appears
on the bar (e.g. 7.5). Reference levels - orange entry, red
lower (risk), and four blue dashed R-multiple targets (R1-R4)
- extend to the right of the bar.
Step 3 → Track the detection as price evolves. Each time price reaches a
ratio level (R1, R2, R3, R4), the outcome engine records the
hit bar. When the detection completes and at least one ratio
level was reached, a small outcome marker appears at the
detection bar showing its grade and the highest R-level
reached (e.g. "A+ ▲ R3"). Detections that closed at SL
before any R level remain in the dashboard stats but are
not marked on the chart.
Step 4 → Read the dashboard. The Confluence row shows current score.
Detections shows total completed past records. R1/R2 Hit and
R3/R4 Hit show the historical hit rates - what proportion of
past detections reached each level before SL.
Step 5 → Use the Profile selector for quick adaptation: Auto picks
Fast (intraday), Balanced (1H-4H), or Smooth (Daily+). Custom
exposes all parameters individually.
Step 6 → Combine the live confluence score with the historical hit
rates for context. A detection at score 7.5 on an instrument
where R1 hit rate is 67% carries different implications than
the same detection where the R1 rate is 30%.

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
▸ HOW IT CALCULATES

The indicator pairs a confluence detector with an outcome tracking engine.
The detector emits events. Tracking measures what happens after each event.
The two components share state - each detection triggered by the detector
becomes a record in the outcome engine, and the engine's aggregate stats
are visible when the next detection fires.

◆ 10-Factor Confluence Score (Detection)
The detector evaluates ten conditions on every bar, each contributing
points to a composite score capped at 10:

1. EMA Fast above/below Slow (1.0 pt)
2. Close above/below Trend EMA (1.0 pt)
3. RSI in momentum zone (50-75 bull, 25-50 bear) (1.0 pt)
4. MACD histogram positive/negative (1.0 pt)
5. MACD line above/below signal (1.0 pt)
6. Close above/below VWAP (1.0 pt)
7. Volume above 20-bar SMA x 1.2 (1.0 pt)
8. ADX above 20 with directional alignment (1.0 pt)
9. HTF EMA trend agreement (1.5 pt - weighted)
10. Close on correct side of Fast EMA (0.5 pt)

A condition fires when the EMA Fast crosses the Slow, momentum aligns
(close on the correct side of both EMAs), RSI is not in an extreme zone,
and the composite score meets the minimum threshold.

◆ Adaptive Profile Engine
In Auto mode the indicator selects parameters by chart timeframe:
Fast (15m and below) uses shorter EMA/RSI/ATR lengths and a lower minimum
score; Balanced (1H-4H) uses standard lengths; Smooth (Daily+) uses longer
lengths and a higher minimum score. The profile also adjusts the SL
distance multiplier so reference levels match the timeframe's volatility
characteristics.

◆ Reference Levels (per Detection)
On each fired detection the indicator places six lines extending right from
the detection bar:
- Entry line at the bar's close (orange).
- Lower (risk) line either at pure ATR distance or at the recent swing
low/high (configurable Structure-Based Lower).
- R1-R4 ratio lines at multiples of the entry-to-lower distance (default
1x, 2x, 3x, 5x).
These six prices are committed at detection time and never move - they are
the contract used by the outcome engine to measure what happened next.

◆ Outcome Tracking (Per-Signal State Machine)
When a detection fires, a record is pushed to the outcome history with
fields: bar, direction, score, grade, entry, lower, r1-r4, plus initially
empty hit_bar fields. On every subsequent bar, the engine scans active
records and updates them:

if high crosses r_n (bull) or low crosses r_n (bear): r_n_bar := bar_index
if low <= lower (bull) or high >= lower (bear): sl_bar := bar_index

A detection is considered complete when sl_bar is set or when the maximum
age (200 bars) is exceeded. Up to 50 detections are kept in the rolling
history pool.

◆ Historical Hit-Rate Aggregation
On every bar the engine recomputes aggregate statistics across all
completed detections visible in chart history:

hit_rate(R_n) = count(records where r_n_bar is set) / count(completed) x 100

These rates are shown in the dashboard with color coding (green when R1
hit rate >= 60%, yellow >= 40%, red < 40%). They are also included in
the JSON alert payload so a downstream bot can use the historical
evidence as a confidence input alongside the live score.

◆ Outcome Markers on Chart
When a detection completes and at least one ratio level (R1+) was reached
before SL, a small marker label is drawn at the detection bar showing the
grade, direction, and the highest R-level reached. Detections where SL
hit before any R is reached do not produce a chart marker - the chart
stays uncluttered, while the dashboard hit-rate stats still include
those records in their denominators for honest reporting. Examples:
"A+ ▲ R3" A+ bullish detection, reached R3 before SL.
"B ▼ R1" B bearish detection, reached R1 before SL.
"A ▲ R4" A bullish detection, reached the furthest R4 target.

◆ HTF Context (Factor F9)
The indicator fetches EMA Fast and Slow from a configurable higher
timeframe via request.security() with [1] offset and lookahead_on for
non-repainting behavior. When the HTF trend agrees with the local
detection direction, factor F9 contributes its 1.5 points. When it
disagrees, F9 contributes zero.

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
▸ WHAT MAKES IT DIFFERENT

Detection plus measurement is fundamentally different from detection alone.
Most confluence indicators stop at producing detections. This implementation
treats every detection as a hypothesis to be verified by what price actually
does next, and the verification is visible on chart and aggregated into
hit-rate statistics that feed back into the next decision.

◆ Outcome Verification Engine
Every detection produces six fixed price levels (entry, lower, R1-R4) and
the engine watches these levels until SL is hit. The state machine for
each detection records exactly which targets were reached, in which order,
and at which bars. No other confluence indicator we are aware of tracks
per-detection multi-target outcomes.

◆ Per-Signal Multi-Target State Machine
Each detection has independent tracking state - r1_bar, r2_bar, r3_bar,
r4_bar, sl_bar - and these are populated as price evolves bar by bar.
A retroactive scan at chart load reconstructs outcomes for all
historical detections so the hit-rate stats are immediately useful.

◆ Live Historical Hit-Rate Statistics
The dashboard shows the percentage of past detections that reached R1, R2,
R3, and R4 before SL. These rates update as the chart loads more history
and as new detections complete. A trader looking at a fresh detection sees
not only the score and grade but also the empirical record of how this
detection class has resolved on this exact instrument and timeframe.

◆ Visual Outcome Markers
Past detections carry a small label at their detection bar showing the grade,
direction, and the highest R-level reached before SL. The chart becomes
a self-explaining record of indicator performance - no separate journal
or backtest required to see the historical outcomes.

◆ 10-Factor Confluence Composite Score
The detection layer combines ten independent technical conditions into
a single composite measure (0-10), preventing false positives from any
isolated factor. The grade system (A+ / A / B / C) surfaces detection
quality at a glance.

◆ Adaptive Profile Selection
The Profile engine adjusts EMA / RSI / ATR lengths and the minimum score
threshold based on chart timeframe. A 5-minute chart and a daily chart
use fundamentally different parameter sets, and the profile system
handles this automatically.

◆ Structure-Aware Reference Levels
The lower (risk) reference level optionally accounts for recent swing
structure rather than pure ATR distance. This produces structurally
relevant stop placement that respects visible chart structure.

◆ Non-Repainting Detection and Tracking
Detections require bar-close confirmation (barstate.isconfirmed) by
default. HTF data uses the previous closed bar via [1] + lookahead_on.
Outcome markers are drawn only when a detection completes, not while it is
still in flight.

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
▸ DASHBOARD

Real-time panel (configurable position) with live state and historical stats:
  • Trend Direction - BULLISH / BEARISH / NEUTRAL based on EMA alignment
  • Confluence - current score out of 10 (how many factors aligned)
  • Higher TF - higher timeframe trend direction
  • Volatility - market volatility regime (High / Normal / Low)
  • Momentum - current RSI momentum value
  • Trend Strength - ADX trend strength (dot when ADX above 20)
  • Profile - active profile (Auto shows resolved selection)
  • Detections - total completed past detections visible in chart history
  • R1 / R2 Hit - historical hit rate for R1 and R2 levels (% of completed records that reached the level before SL)
  • R3 / R4 Hit - historical hit rate for R3 and R4 levels


Legend table (bottom left) explains every visual element.

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
▸ SETTINGS

Profile
  • Profile - Auto (selects Fast/Balanced/Smooth by chart timeframe; Custom exposes manual settings)


Scoring
  • Fast / Slow / Trend EMA - 9 / 21 / 55 (Custom mode only)
  • RSI Length - 14 (Custom mode only)
  • ATR Length - 14 (Custom mode only)
  • Min Score - 5 (threshold for condition detection; Custom mode)


Reference Levels
  • Show Reference Levels - ON
  • Lower Level - 1.5 xATR
  • R1 / R2 / R3 / R4 Ratio - 1.0 / 2.0 / 3.0 / 5.0
  • Structure-Based Lower - ON (use swing low/high in addition to ATR)
  • Swing Lookback - 10 bars


HTF Context
  • Enable HTF Context - ON
  • HTF Timeframe - empty (current TF, or specify higher)


Visualization
  • Bullish / Bearish / Signal Color - customizable
  • Show EMA Ribbon - ON
  • Trend Background - OFF
  • Show Score Label - ON (numeric score on detection bars)


Dashboard
  • Show Dashboard - ON
  • Dashboard Position - Top Right (4 corners)
  • Show Legend - ON


Alert Settings
  • Allow Repainting - OFF (detections confirm only on bar close)
  • JSON Alerts - OFF (structured payload with score, grade, ticker, price, timeframe, plus historical hit rates)


━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
▸ ALERTS

  • Bullish Confluence - bullish condition with score above threshold
  • Bearish Confluence - bearish condition with score above threshold
  • Any Confluence - either direction


When JSON Alerts are enabled, the payload includes the score, grade, ticker,
price, timeframe, plus historical hit rates (hist_n, hist_r1, hist_r2,
hist_r3, hist_r4) so a downstream bot can weight the new detection against
the indicator's empirical performance on this instrument and timeframe.

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

The protected source contains the outcome-history tracking engine with
retroactive scan, the per-detection multi-target state machine that records
which R-level is reached and at which bar, the live hit-rate aggregation
pipeline that drives the dashboard statistics, and the visual outcome
marker system that annotates each completed detection on the chart.
Exposing these would let any developer rebuild the tracking layer
identically, eliminating the engineering effort that distinguishes this
implementation from a basic confluence indicator that stops at the
detection stream.

Best regards,
EXCAVO


Disclaimer
Trading involves significant risk. This indicator is a technical analysis tool
and does not constitute financial advice, investment recommendations, or a
guarantee of future results. Past indicator behavior does not guarantee future
performance. Always use proper risk management and your own judgment.

Feragatname

Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, alım satım veya diğer türden tavsiye veya öneriler anlamına gelmez ve teşkil etmez. Kullanım Koşulları bölümünde daha fazlasını okuyun.