PROTECTED SOURCE SCRIPT
Updated

QCO - "Science" Based OSC

29
This indicator, called QCO - Quantum Confluence OSC, combines three different types of information into one oscillator: trend, momentum, and volume-based order flow. It is designed to show when these three elements line up in the same direction.

Here is how it actually works, step by step, in simple terms.
////triangle disabled///
First, it calculates three separate components:

1. Trend component
It uses an 8-period and a 21-period exponential moving average. When the fast EMA is above the slow one, the trend is considered up, and vice versa. It then measures how far apart the two EMAs are compared to the current volatility (ATR). This distance is turned into a number between -1 and +1.

2. RSI component
It takes the standard 14-period RSI, subtracts 50, and divides by 30 so the result also moves roughly between -1 and +1. This keeps RSI on the same scale as the other two parts instead of letting it dominate just because it can reach 0-100.

3. Cumulative Volume Delta (CVD) component
On every green candle it adds the volume, on every red candle it subtracts the volume, and keeps a running total. This running total is then normalized (turned into a z-score) over the last 100 bars on the current timeframe. If the MTF option is enabled, it also pulls normalized CVD from the 5-minute and 15-minute charts and mixes them in with lower weights (60% current, 30% 5-min, 10% 15-min). The final CVD value is again clamped between -1 and +1.

These three numbers are multiplied by fixed weights (normally 35% trend, 35% RSI, 30% CVD) and added together to create one combined raw score. A short 3-period EMA smooths this raw score slightly so the line is readable.

The weights can shift a little if the regime filter is turned on: in very volatile periods it gives more weight to trend and less to CVD; in very quiet periods it gives a bit more weight to RSI.

A separate check called “resonance” looks at whether at least two of the three components have the same sign. If all three agree strongly, resonance is marked as high and the background gets a gold tint.

Divergence protection (optional) looks back 10 bars: if price makes a higher high but the 1-minute CVD is weaker than its previous peak, sell signals are blocked. The same idea works in reverse for bullish divergence on lows.

Signals appear only when:
- The smoothed score is beyond the user-set threshold (default 1.0, adjustable)
- The basic trend (8/21 EMA) agrees with the direction
- RSI is not already overbought for buys or oversold for sells
- Divergence protection (if enabled) does not block the signal

Strong signals (gold triangles) require high resonance. Regular signals (green/red triangles) fire even with lower agreement.

The oscillator itself plots between roughly -1.5 and +1.5, with zero as the center line. A small table in the corner shows the current state of trend, RSI level, CVD direction, total score, active signal, and resonance level.

That is the complete mechanism. It does not repaint, uses only past and current data, and works on any timeframe or asset that has volume.


What actually makes this oscillator different from the thousands of others on TradingView comes down to a few practical choices that most scripts ignore:

- It forces real confluence. Most oscillators only look at one thing (price or momentum). This one requires trend, momentum, and order-flow-based volume to point the same way before it gives a strong signal. Weak or conflicting readings produce no gold signal or no signal at all.

- It uses properly normalized inputs. Trend strength, RSI, and CVD are all forced onto the same -1 to +1 scale using statistically sound methods (ATR for trend, fixed division for RSI, z-score for CVD). This means none of the three can bully the final score just because it naturally swings wider.

- It brings in higher-timeframe order flow without repainting. Pulling normalized 5-minute and 15-minute CVD into a 1-minute chart is rare in public scripts and usually done wrong. Here it is coded cleanly with request.security and blended with sensible weights.

- It adapts the weighting to the market regime. In choppy, low-volatility ranges it leans more on RSI; in fast trending or high-volatility moves it leans more on trend and less on short-term CVD noise. Very few free indicators do this automatically.

- It has working hidden divergence protection on the CVD, not just regular price/RSI divergence. Since CVD reflects actual buying and selling pressure, this filter catches a lot of traps that normal divergence detectors miss.

- Resonance filter is simple but powerful: it literally counts how many of the three components agree. This single extra condition turns a decent oscillator into one that only screams when the probability is genuinely higher.

- The final line is lightly smoothed (3-period EMA on the combined score), so it moves fast enough for scalping but does not jump on every tick like most raw oscillators.

Because of these points, the signal-to-noise ratio is noticeably higher than a plain RSI, Stochastic, MACD, or even most “smart money” scripts that just plot cumulative delta without normalization or confluence checks. The gold triangles especially do not appear often, but when they do, multiple independent market forces are aligned at the same time.

\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

### Colors and what they mean

The indicator uses color in three places: the line, the background, and the signal triangles. Each one tells you something specific.

**The main line (Quantum Score)**
- Bright cyan (#00BCD4): this is the actual oscillator line you watch.
- Above zero = overall bullish pressure.
- Below zero = overall bearish pressure.
- The farther from zero, the stronger the combined pressure.
Typical range is roughly -1.5 to +1.5. Crosses of zero are not automatic signals (it needs more conditions), but they show when the balance flips.

**Background color**
- Light gold with transparency: High Resonance. All three components (trend, RSI, CVD) are clearly agreeing. This is the highest-conviction state.
- Very light green: trend is up but resonance is only medium or low.
- Very light red: trend is down but resonance is only medium or low.
- Grayish when flat: no clear trend or everything is mixed.

**Signal triangles**
- Large gold triangle up (bottom of pane): STRONG BUY → high resonance + all filters passed.
- Large gold triangle down (top of pane): STRONG SELL → same but bearish.
- Normal-sized green triangle up: regular buy (conditions met but components do not fully agree).
- Normal-sized red triangle down: regular sell (same, weaker agreement).

**The small table (top-right corner)**
- Trend: UP (green) or DN (red)
- RSI: number + color (red if >70, blue if <30)
- CVD: BUY (green) / SELL (red) / NEUT (gray)
- Score: current value of the cyan line
- Signal: BUY / SELL / WAIT
- Resonance: HIGH (gold) or LOW (gray)

### How to read it in practice

1. Wait for the cyan line to be clearly above or below zero. Close to zero usually means indecision.

2. Look at the background first:
- Gold background → pay maximum attention, probability is highest.
- Green or red background → direction is still valid, but not as powerful.

3. When a triangle appears: [disabled]
- Gold large triangles: enter aggressively if your higher-timeframe bias agrees. These are the cleanest moves.
- Normal green/red triangles: still usable, especially if price is at support/resistance or you already have a position and want to add.

4. No triangle at all, even if the line is far from zero? One of the filters is blocking (usually RSI already overbought/oversold or hidden CVD divergence). It is deliberately staying quiet.

5. Quick checklist before taking a gold signal:
- Cyan line on the correct side of zero
- Background gold
- Gold triangle just printed [disabled]
- Table shows “BUY” or “SELL” and “HIGH” resonance
That combination happens only a few times per day on most pairs, sometimes less.

In short: ignore everything until you see gold background + line up/down. That is when trend, momentum, and actual order flow are all pushing the same way at the same time. Everything else is secondary information or lower-probability setups.

BUY condition (table turns to BUY + line usually turns yellow)
All five must be true on the same bar:

finalScore > baseSensitivity
(default threshold = 1.0, you can lower it to 0.6–0.8 if you want more signals)
emaFast (8) > emaSlow (21) → trendUp = true
rsi ≤ 70  → not overbought
If “Divergence Protection” is enabled → no bearish hidden CVD divergence in last 10 bars
(price ≥ highest high of last 10 bars AND cvd1m_norm < highest cvd1m_norm of last 10 bars − 0.3)
Internally the rawScore is positive and rising (because finalScore is a 3-period EMA of it)

When all of the above are true → the table shows “BUY” in green and the oscillator line usually (but not always) turns yellow because resonance is high.
SELL condition (table turns to SELL + line usually turns yellow)
All five must be true:

finalScore < −baseSensitivity
emaFast (8) < emaSlow (21) → trendDown = true
rsi ≥ 30  → not oversold
If “Divergence Protection” is enabled → no bullish hidden CVD divergence in last 10 bars
(price ≤ lowest low of last 10 bars AND cvd1m_norm > lowest cvd1m_norm of last 10 bars + 0.3)
rawScore negative and falling

When all are true → table shows “SELL”.


///////////////////////////////////////////////////////////////////

The QCS oscillator is not copied from any single academic paper, but almost every technical choice inside it comes from established, tested concepts that appear repeatedly in serious quantitative and institutional trading literature. Here are the real scientific or evidence-based roots for each major part:

1. **EMA 8 and EMA 21 for trend**
Widely used in institutional trend-following systems (examples: Aberration, many CTA trend models). The 8/21 combination is close to the classic 10/20 or 12/26 that appear in papers on adaptive moving averages and has been back-tested extensively in futures and forex since the 1990s.

2. **Trend strength normalized by ATR**
Directly from Kaufman (1995, 1998), Schwager, and later from papers on “volatility-adjusted momentum” (e.g., “Normalized Momentum” studies). Dividing price separation by ATR turns the raw difference into a dimensionless, comparable score across assets and timeframes – a standard technique in academic risk-parity and volatility-scaled strategies.

3. **RSI re-centered and re-scaled to -1 / +1**
Comes from statistical normalization practices in quantitative finance. Raw RSI is bounded 0-100, so it distorts weighted combinations. Re-scaling it to the same units as the other components is exactly what portfolio-construction and factor-investing literature does when combining signals of different native scales (see Grinold & Kahn, “Active Portfolio Management”).

4. **Cumulative Volume Delta (CVD) with z-score normalization**
Order-flow and volume-delta research exploded after 2010 with papers from the CME Group, Easley et al. (VPIN, 2012), and many microstructure studies. Normalizing cumulative delta by its own rolling standard deviation is the standard way high-frequency and market-making firms turn raw delta into a usable stationary signal (see Hasbrouck, “Empirical Market Microstructure” and many follow-up papers).

5. **Multi-timeframe order flow blending**
Institutional delta scalping desks and prop firms routinely look at delta on 1 m, 5 m, and 15 m simultaneously. Blending higher-timeframe delta with lower weights is a direct copy of how professional cumulative-delta tools (Bookmap, Jigsaw, Sierra Chart clusters) filter noise.

6. **Regime-dependent weighting (high vol → trust trend more, low vol → trust oscillators more)**
Straight from regime-switching literature (Ang & Bekaert, Hamilton time-series regime models) and practical papers like “Trend Following in Different Volatility Regimes” (Clare, Seaton, etc.). The exact thresholds (1.3× and 0.7× average ATR) are simplified but follow the same logic used in many volatility-regime filters.

7. **Hidden divergence on volume delta instead of just price**
Comes from modern order-flow literature. Classic price/RSI divergence is well known, but hidden divergence between price and cumulative delta is a much stronger filter according to microstructure research and papers on “aggressive order flow” (e.g., studies using TAQ data and signed volume).

8. **Requiring pairwise agreement (the resonance score)**
This is a very simple form of factor concordance or ensemble agreement, a technique used in almost all professional quantitative models to reduce false positives. Academic factor-timing papers (Asness, Frazzini, etc.) and ensemble machine-learning literature show that requiring multiple independent signals to agree dramatically improves Sharpe ratio.

So while no single university paper is titled “Quantum Confluence OSC,” every single mechanism inside the indicator is copied from concepts that have been published, back-tested, and used for decades in real institutional or high-level quantitative trading. That is why it feels cleaner and more robust than 99% of retail indicators — it is built from the same building blocks that actual trading firms use, just simplified into one Pine Script.
Release Notes
visual signaling improved and bars extend from 0 up/down to support a trend

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.