OPEN-SOURCE SCRIPT

FVG MTF Consensus Oscillator

111
FVG MTF Consensus Oscillator
A multi-timeframe, multi-component oscillator that combines momentum, deviation, and slope analysis across multiple timeframes using Zeiierman's Chebyshev-filtered trend calculation. This indicator identifies potential turning points with zone-based signal classification and timeframe consensus filtering.
Backed by ML/Deep Learning evaluation on ES Futures data from 2015-2024.

🎯 Concept
Traditional oscillators suffer from two major weaknesses:

Single measurement - relying on one metric makes them susceptible to noise
Single timeframe - missing the bigger picture leads to fighting the trend

The FVG MTF Consensus Oscillator addresses both issues by combining three independent measurements across three timeframes into a weighted consensus signal.
The Three Components

Momentum - How fast is the trend moving?
Deviation - How far has price stretched from the trend?
Slope - What is the short-term directional bias?

The Three Timeframes

TF1 (Chart) - Your current chart timeframe (lowest weight)
TF2 (Medium) - Typically 1H or 4H (medium weight)
TF3 (High) - Typically 4H or Daily (highest weight)

By requiring agreement across multiple components AND multiple timeframes, the oscillator filters out noise while capturing meaningful, high-probability market movements.

🔧 How It Works
The Core: Chebyshev Type 1 Filter
At its heart, this indicator uses a Chebyshev Type 1 low-pass filter (inspired by Zeiierman's FVG Trend) to extract a clean trend line from price action. Unlike simple moving averages, the Chebyshev filter offers:

Sharper cutoff between trend and noise
Minimal lag for a given smoothness level
Controlled overshoot via the ripple parameter

Three Oscillator Components
1. Momentum Component
Momentum = Current Trend Value - Previous Trend Value
Measures the velocity of the trend. High positive values indicate strong upward acceleration, while high negative values show downward acceleration.
2. Deviation Component
Deviation = Close Price - Trend Value
Measures how far price has stretched away from the trend line. Useful for identifying overextended conditions and mean reversion opportunities.
3. Slope Component
Slope = Change in Trend over 3 bars
Captures the short-term directional bias of the trend itself, helping confirm trend changes.
Normalization & Component Consensus
Each component is individually normalized to a -100 to +100 scale using adaptive scaling. The oscillator output is a weighted average of all three components, allowing you to emphasize different aspects based on your trading style.
Multi-Timeframe Weighting
The final oscillator value combines all three timeframes using configurable weights:
Combined = (TF1 × Weight1 + TF2 × Weight2 + TF3 × Weight3) / Total Weight
Default weights (1, 2, 3) ensure higher timeframes have more influence, keeping you aligned with the dominant trend while timing entries on lower timeframes.

📊 Zone System
The oscillator uses a fuzzy zone system to classify market conditions:
ZoneRangeInterpretationSignal ColorNeutral-5 to +5No clear bias, avoid tradingGrayContinuation±5 to ±25Trend pullback, continuation setupsAquaDeep Swing±25 to ±50Extended move, stronger setupsGreenReversalBeyond ±50Extreme extension, reversal potentialOrange
When "Show Zone Background" is enabled, the background shading darkens as the oscillator moves into more extreme zones, providing instant visual feedback.

📈 Signal Interpretation
Turn Signals
The indicator plots triangular markers when the oscillator changes direction:

▲ Triangle Up (bottom): Oscillator turning up from a low
▼ Triangle Down (top): Oscillator turning down from a high

Signal Quality by Zone
Not all signals are equal. The signal color indicates which zone the turn occurred in:
ColorZoneProbabilityBest UseGrayNeutralLowAvoid or use very tight stopsAquaContinuationModerateTrend continuation entriesGreenDeep SwingHigherSwing trade entriesOrangeReversalHighestCounter-trend with caution
Timeframe Consensus Filter
Signals only fire when the required number of timeframes agree on direction. With default settings (TF Consensus = 2), at least 2 of 3 timeframes must be moving in the same direction for a signal to trigger.
This prevents:

Taking longs when higher timeframes are bearish
Taking shorts when higher timeframes are bullish
Whipsaws during timeframe disagreement

Trend Coloring
The combined oscillator line changes color based on trend direction:

Light purple (RGB 240, 174, 252): Majority of timeframes trending up
Dark purple (RGB 84, 19, 95): Majority of timeframes trending down

Info Table
When MTF is enabled, a table in the top-right corner displays:

Current oscillator values for each timeframe (TF1, TF2, TF3)
Combined value (CMB)
Color coding: Green = rising, Red = falling


⚙️ Settings Guide
Timeframe Settings
SettingDefaultDescriptionEnable Multi-TimeframeOnMaster switch for MTF functionalityTF1 (Chart)"" (current)First timeframe, typically your chart TFTF2 (Medium)60Second timeframe, typically 1HTF3 (High)240Third timeframe, typically 4HTF1/TF2/TF3 Weight1 / 2 / 3Influence of each TF on combined signal
Timeframe Tips:

Keep TF1 ≤ TF2 ≤ TF3 (ascending order)
For day trading: 5m / 15m / 1H
For swing trading: 1H / 4H / Daily
For position trading: 4H / Daily / Weekly

Display Settings
SettingDefaultDescriptionShow All TimeframesOffDisplay individual TF oscillator linesShow Combined LineOnDisplay the weighted combined oscillatorShow Zone BackgroundOffShade background based on current zone
Trend Filter Settings
SettingDefaultDescriptionTrend Ripple4.0Filter responsiveness (1-10). Higher = faster but more overshootTrend Cutoff0.1Cutoff frequency (0.01-0.5). Lower = smoother trendNormalization Length50Lookback for scaling. Longer = more stable
Component Weights
SettingDefaultDescriptionMomentum Weight1.0Emphasis on trend speedDeviation Weight1.0Emphasis on price stretch from trendSlope Weight1.0Emphasis on short-term trend direction
Component Tips:

For trend-following: Increase Momentum and Slope weights
For mean reversion: Increase Deviation weight
Set any weight to 0 to disable that component

Zone Thresholds
SettingDefaultDescriptionNeutral Zone5Inner boundary (±5 = neutral)Continuation Zone25Middle boundary for continuation setupsDeep Swing Zone50Outer boundary for reversal zone
Adjust based on instrument volatility. More volatile instruments may need wider zones.
Signal Filters
SettingDefaultDescriptionSignal Cooldown3Minimum bars between signalsMin Turn Size2.0Minimum oscillator change for valid turnTF Consensus Required2Minimum TFs agreeing for signal (1-3)

💡 Usage Examples
Example 1: Trend Continuation (Dip Buying)
Setup: Uptrend confirmed by higher timeframes

Check the info table - TF2 and TF3 should show green (rising)
Wait for TF1 to pull back, oscillator enters Continuation zone
Enter on Aqua ▲ signal (turn up with TF consensus)
Stop below recent swing low
Target: Previous high or next resistance

Why it works: You're buying a dip in an established uptrend with multi-timeframe confirmation.
Example 2: Deep Swing Entry
Setup: Extended move showing exhaustion

Oscillator reaches Deep Swing zone (±25 to ±50)
At least 2 TFs start showing the same direction
Enter on Green signal indicating momentum exhaustion
Use tighter stop as the move is already extended
Target: Return to Continuation zone or trend line

Why it works: Extended moves tend to mean-revert. The zone system identifies these opportunities.
Example 3: Reversal Setup (Advanced)
Setup: Extreme extension with diverging timeframes

Oscillator reaches Reversal zone (beyond ±50)
Watch for TF1 to turn while TF3 is still extended
Enter on Orange signal - this is counter-trend!
Use smaller position size and wider stops
Target: Return to Deep Swing or Continuation zone

Why it works: Extreme extensions eventually correct. The orange signal marks high-probability reversal points.
Example 4: Avoiding Bad Trades
What to avoid:

Gray signals in Neutral zone - No edge, random noise
Signals against TF3 direction - Fighting the dominant trend
Signals without TF consensus - Timeframe disagreement = choppy market
Multiple signals in quick succession - Let cooldown filter work


🔬 Multi-Timeframe Analysis Tips
Reading the Info Table
The info table shows real-time oscillator values:
| TF1 | TF2 | TF3 | CMB |
| 23.5 | 45.2 | 67.8 | 52.1 |

All green: Strong uptrend across all timeframes
All red: Strong downtrend across all timeframes
Mixed colors: Potential transition or consolidation

Timeframe Alignment States
TF1TF2TF3Interpretation↑↑↑Strong bull - look for long entries↓↓↓Strong bear - look for short entries↑↑↓Pullback in downtrend - caution on longs↓↓↑Pullback in uptrend - caution on shorts↑↓↑Choppy - reduce position size↓↑↓Choppy - reduce position size
The Power of Consensus
With TF Consensus = 2, signals only fire when 2+ timeframes agree. This single filter eliminates most whipsaws and keeps you aligned with the dominant trend.
For more conservative trading, set TF Consensus = 3 (all timeframes must agree).

⚠️ Important Notes

This indicator does not predict the future. It measures current market conditions and momentum across multiple timeframes.
Always use proper risk management. No indicator is 100% accurate.
Combine with price action. The oscillator works best when confirmed by support/resistance, candlestick patterns, or other confluence factors.
Respect the higher timeframe. When TF3 disagrees, trade smaller or sit out.
Zone signals are probabilistic. Orange (reversal) signals have higher probability but aren't guaranteed reversals.
Adjust settings per instrument. Default settings are optimized for ES Futures but may need tuning for other markets.


🧪 ML/Deep Learning Background
The default parameters and zone thresholds were evaluated using machine learning techniques on ES Futures data spanning 2015-2024. This included:

Optimization of component weights
Zone threshold calibration
Timeframe weight balancing
Signal filter tuning

While past performance doesn't guarantee future results, the parameters represent a data-driven starting point rather than arbitrary defaults.

🙏 Credits
This indicator is inspired by Zeiierman's Multitimeframe Fair Value Gap (FVG) indicator, specifically utilizing concepts from his Chebyshev Type 1 filter implementation for trend calculation.
Original indicator: Multitimeframe Fair Value Gap – FVG (Zeiierman)

📝 Changelog
v1.0

Initial release
Three-component consensus oscillator (Momentum, Deviation, Slope)
Multi-timeframe support with weighted combination
Fuzzy zone classification system
Configurable component and timeframe weights
TF consensus filter for signal quality
Signal cooldown and minimum turn size filters
Real-time info table with TF values
Optional zone background shading

Exención de responsabilidad

La información y las publicaciones no constituyen, ni deben considerarse como asesoramiento o recomendaciones financieras, de inversión, de trading o de otro tipo proporcionadas o respaldadas por TradingView. Más información en Condiciones de uso.