OPEN-SOURCE SCRIPT
ที่อัปเดต:

Multi-Oscillator Consensus Engine [AGPro Series]

1 007
Multi-Oscillator Consensus Engine [AGPro Series]

🔹 Overview

Multi-Oscillator Consensus Engine aggregates ten independent momentum
oscillators into a single regime classifier with overlay Consensus Zones,
flip event labels, and agreement persistence tracking. Instead of watching
ten charts separately, traders see one unified answer: are the oscillators
in agreement, and what is the consensus saying right now?

The script monitors RSI, Stochastic, CCI, MFI, Williams %R, ROC, Ultimate
Oscillator, MACD, DMI balance, and Aroon balance. Each oscillator is
normalized to a 0–100 scale and votes bullish, bearish, or neutral against
configurable thresholds. The aggregated vote determines the market regime
and drives everything else on the chart.


🔹 Unique Edge

Most multi-oscillator tools stop at a dashboard or a simple agreement
percentage. This engine goes further:

- Regime Classification — four distinct states (Consensus Bull, Consensus
Bear, Divergent, Transition) instead of a binary signal.
- Consensus Zones — a horizontal price zone is born at every regime flip
and stays alive while the regime holds. When the regime ends, the zone
becomes historical structure.
- Flip Event Labels — regime transitions are marked directly on price
with merged flip + extreme agreement tags.
- Persistence Tracking — streak bars, last flip distance, and historical
extreme rate tell you how trustworthy the current consensus is.
- Label Discipline — cooldown, horizontal stagger, and flip+extreme merge
logic keep the chart readable even in choppy regimes.


🔹 Methodology

Step 1. Ten oscillators are computed with their classic defaults and
normalized to a 0–100 range. Indicators with native 0–100 output (RSI,
Stochastic, MFI, Ultimate) pass through directly. Others (CCI, ROC, MACD
histogram) are rescaled against their own recent range. Williams %R is
flipped from its native -100..0 scale.

Step 2. Each normalized oscillator casts a vote. Values above the bullish
threshold vote +1, values below the bearish threshold vote -1, everything
else is neutral. Vote counts and agreement percentage are computed bar by bar.

Step 3. Regime is assigned from the vote distribution. Seven or more votes
in one direction triggers Consensus Bull or Consensus Bear. A tight spread
(bull-bear difference ≤ 2) triggers Divergent. Everything else is a
Transition state.

Step 4. On every bull↔bear regime entry, a new Consensus Zone is born at
the current close ± a configurable ATR multiple. The zone extends forward
while the regime is active and locks in place when the regime ends. A
maximum of five active zones keeps the chart clean.

Step 5. Labels are rendered only when cooldown and merge rules allow.
Extreme agreement events (80%+ by default) are either merged into the flip
label or drawn separately with larger offset.


🔹 Signals & Alerts

Seven alert conditions ship with the script:

- Consensus Bull Entry — regime has just entered Consensus Bull
- Consensus Bear Entry — regime has just entered Consensus Bear
- Consensus Bull Flip — direct Bear → Bull transition
- Consensus Bear Flip — direct Bull → Bear transition
- Extreme Bullish Agreement — agreement crosses the extreme threshold up
- Extreme Bearish Agreement — same, on the bearish side
- Consensus Streak 20+ — current regime has held for twenty bars


🔹 Key Inputs

- Oscillator Periods — individual length settings for all ten oscillators
- Bullish / Bearish Thresholds — the normalized levels that define a vote
- Consensus Threshold — how many oscillators must agree for a regime (default 7/10)
- Extreme Agreement — agreement percentage for extreme events (default 80%)
- Consensus Zones — show/hide, ATR length and multiplier, max active count,
closed zone trail
- Label Cooldown — minimum bars between flip labels, prevents clutter
- Merge Flip + Extreme — combine same-bar events into one label
- Panel — six location options, Dark/Light theme, font sizes


🔹 How to Use

Trend traders: wait for a Consensus Bull or Consensus Bear regime to
establish (streak > 5 bars), then use pullbacks into the active Consensus
Zone as entries in the regime direction. Exit on opposite regime flip.

Reversion traders: Extreme Agreement events mark moments where all
oscillators are stretched in the same direction. These are classic mean
reversion setups. Wait for a regime flip against the extreme, confirmed on
the next bar.

Regime filter: overlay the panel on any chart and use the Regime and
Agreement readings as a binary filter for your primary system. Only take
longs when regime is Bull, only take shorts when regime is Bear.

Works on all timeframes from 1m to 1W. Higher timeframes produce fewer
but higher-conviction signals.


🔹 Limitations & Transparency

- The oscillator votes use normalized thresholds. On extremely narrow
ranges, the normalization may produce unstable votes. Raising the
Bullish/Bearish Thresholds reduces this sensitivity.
- Consensus Zones are drawn from close price at the flip bar. Large wick
bars may place the zone slightly away from the visual pivot.
- The script is not a standalone trading system. It is a confluence and
regime tool to combine with your own structure, volume, or price action
analysis.
- All signals repaint only within the current forming bar. Once a bar
closes and barstate.isconfirmed is true, flip labels and zones are final.


🔹 Risk Disclosure

This indicator is provided for educational and analytical purposes only.
It is not financial advice. Trading involves substantial risk. Past
behavior of regime transitions does not guarantee future performance.
Always use proper risk management and never risk more than you can afford
to lose.
Release Note
UPDATE NOTES - V1.3

This update focuses on signal-confirmation control, alert consistency, and clearer workflow options for users who want current-bar monitoring.

The core purpose of the script remains unchanged.
This release improves how the existing consensus logic is presented, confirmed, and interpreted on the chart.

This script continues to function as an analytical and visualization tool.
It does not attempt to predict price direction or provide guaranteed outcomes.


------------------------
What Changed
------------------------

• Added Confirmation Mode
The script now includes a dedicated Signal Confirmation setting:

Bar Close Confirmed
Early Preview

Bar Close Confirmed remains the default mode.

• Added optional Early Preview behavior
Early Preview allows consensus entries, extreme agreement events, labels, zones, and alerts to respond during the current forming candle.

This mode is designed for users who want earlier monitoring context.
Because it can update before the candle closes, it should be treated as preview behavior.

• Preserved bar-close safety by default
The default mode continues to wait for bar close before finalizing labels, zones, and alerts.

This keeps the public default stable and consistent with the original design.

• Improved alert consistency
Alert conditions now follow the same confirmation mode used by the visual outputs.

This makes alerts, labels, and zones easier to understand as one unified workflow.

• Added Signal Mode panel row
The panel now displays whether the script is running in Bar Close mode or Early Preview mode.


------------------------
Visual Improvements
------------------------

• Preview-mode labels are marked with PREVIEW while the current bar is still open.

• Preview zones use a slightly stronger border while they are created during the current candle.

• Panel readability is preserved with the same merged AGPro blue header row.

• The visual structure remains familiar for existing users.


------------------------
Interface & Usability
------------------------

• Added a dedicated Signal Confirmation input group.

• Added Confirmation Mode:
Bar Close Confirmed / Early Preview.

• Added Show Preview Mode In Panel toggle.

• Kept oscillator settings, thresholds, zone settings, label settings, panel settings, and alert names stable.


------------------------
Behavior Notes
------------------------

This update does not change the core oscillator logic.

The ten oscillator votes, consensus threshold, regime classification, agreement percentage, extreme agreement logic, and zone concept remain the same.

Bar Close Confirmed mode is the recommended default for stable chart output.

Early Preview mode is optional and can change before the current candle closes.


------------------------
Limitations Reminder
------------------------

The script remains a rule-based analytical tool.

Oscillator agreement can change during fast markets, low-liquidity periods, and unfinished candles.

Early Preview mode should be interpreted as current-bar monitoring, not final confirmation.

Outputs should always be interpreted within broader market context.


------------------------
Risk Reminder
------------------------

This script is for educational and analytical purposes only.

It does not provide financial advice or guaranteed trading outcomes.

Users remain responsible for their own decisions.
Release Note
🔧 UPDATE NOTES - v1.4

This update focuses on label contrast and on-chart label spacing.

The core purpose of the script remains unchanged. It still aggregates ten
independent momentum oscillators into a single consensus regime — Consensus
Bull, Consensus Bear, Divergent or Transition — with agreement percentage,
consensus zones, flip and extreme-agreement events, and persistence tracking.

This script continues to function as an analytical and visualization tool.
It does not attempt to predict price direction or provide guaranteed outcomes.


------------------------
What Changed
------------------------

• Non-overlapping consensus labels
Flip and extreme-agreement labels (Consensus Bull / Bear, Extreme Bull / Bear)
now check against recent labels and shift vertically when several land close
together. Previously, busy or compressed periods could stack multiple labels on
top of each other. They now step apart cleanly while keeping their leader line
back to the candle, so density stays informative without becoming cluttered.

• Contrast-aware label text
Every consensus label now derives its text color from its own background
luminance. The pink (bearish) labels in particular now read crisply, where the
previous fixed light text was faint.

• Header text contrast
The panel header text color was aligned to the same contrast standard.


------------------------
Visual Improvements
------------------------

• Eliminated consensus-label stacking on busy and compressed views.

• Higher-contrast bullish and bearish labels.


------------------------
Interface & Usability
------------------------

• The panel (Regime, Signal Mode, Agreement, Bull / Bear, Neutral, Streak, Last
Flip, Extreme Rate) is unchanged in layout and content.

• Consensus zones, flip logic and alerts are unchanged.


------------------------
Behavior Notes
------------------------

This update does not change any oscillator, voting, consensus, zone or alert
logic. Only label text color and the on-chart vertical placement of labels were
adjusted. The number and meaning of events is unchanged; they are simply spaced
so they no longer overlap. Interpretation of all outputs is the same as before.


------------------------
Limitations Reminder
------------------------

The script remains a rule-based analytical tool. Market conditions such as
volatility, liquidity and timeframe differences may affect how the consensus
regime, zones and agreement readings appear. Outputs should always be
interpreted within broader market context.


------------------------
Risk Reminder
------------------------

This script is for educational and analytical purposes only. It does not provide
financial advice or guaranteed trading outcomes. Users remain responsible for
their own decisions.

คำจำกัดสิทธิ์ความรับผิดชอบ

ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน