Velocity Pressure Index | AlphaNattVelocity Pressure Index (VPI) | AlphaNatt
A sophisticated momentum oscillator that combines price velocity analysis with volume pressure dynamics to identify high-probability trading opportunities.
📊 KEY FEATURES
Dual Analysis System: Merges price velocity measurement with volume pressure analysis for comprehensive market momentum assessment
Dynamic Normalization: Automatically scales values between -100 and +100 for consistent readings across all market conditions
Adaptive Zones: Self-adjusting overbought/oversold levels based on recent price history
Multi-Layer Confirmation: Combines momentum, acceleration, and crossover signals for robust trade identification
Volume-Weighted Pressure: Differentiates between bullish and bearish volume to gauge true market sentiment
📈 HOW IT WORKS
The VPI calculates price velocity using linear regression of price changes, then weights this velocity by the difference between bullish and bearish volume pressure. This creates a momentum reading that accounts for both price movement speed and the volume conviction behind it.
Signal Generation:
Price velocity is measured over the specified period
Volume is separated into bullish (close > open) and bearish (close < open) pressure
Velocity is amplified or dampened based on volume pressure differential
The resulting index is normalized to oscillate between -100 and +100
A signal line smooths the oscillator for crossover detection
🎯 TRADING SIGNALS
Long Signals (Cyan #00F1FF):
Strong Bull: VPI > Signal with positive momentum and acceleration
Crossover Bull: VPI crosses above signal while above oversold zone
Divergence: Price makes lower low while VPI makes higher low
Short Signals (Magenta #FF019A):
Strong Bear: VPI < Signal with negative momentum and deceleration
Crossover Bear: VPI crosses below signal while below overbought zone
Divergence: Price makes higher high while VPI makes lower high
⚙️ CUSTOMIZABLE PARAMETERS
Velocity Settings:
Velocity Period (14): Lookback for price velocity calculation
Pressure Period (21): Volume analysis window
Smoothing Factor (3): Final oscillator smoothing
Signal Configuration:
Signal Type: Choose between SMA, EMA, or DEMA
Signal Length (9): Signal line smoothing period
Normalization Period (50): Range calculation window
Dynamic Zones:
Zone Lookback (100): Period for adaptive overbought/oversold calculation
Percentiles: 80th/20th percentiles for dynamic zones
📐 VISUAL COMPONENTS
Main Oscillator: Color-coded line showing current momentum state
Signal Line: White line for crossover detection
Momentum Histogram: Shows velocity differential at 50% scale
Dynamic Zones: Self-adjusting overbought/oversold bands
Extreme Levels: ±50 dotted lines marking extreme conditions
Background Shading: Subtle highlighting of overbought/oversold regions
💡 USAGE TIPS
Trend Trading: Use strong bull/bear signals in trending markets for continuation entries
Range Trading: Focus on crossovers near extreme zones for reversal trades
Divergence Trading: Watch for price/oscillator divergences at market extremes
Multi-Timeframe: Combine with higher timeframe VPI for directional bias
Volume Confirmation: Stronger signals occur with aligned volume pressure
⚠️ BEST PRACTICES
The VPI works best in liquid markets with reliable volume data. For optimal results, combine with price action analysis and use appropriate risk management. The indicator is most effective during trending conditions but can identify reversals when divergences occur at extremes.
🔔 ALERTS AVAILABLE
VPI Long/Short Signals
Bullish/Bearish Crossovers
Extreme Overbought/Oversold Conditions
Version 6 | Pine Script™ | © AlphaNatt
震荡指标
XAUUSD Family Scalping (5min)🟡 XAUUSD Family Scalping 5-Min — Momentum Precision Indicator
Overview
This indicator is built for XAUUSD (Gold) on the 5-minute timeframe and is designed for short-term momentum scalping.
It helps traders identify early reversal zones, confirm momentum direction, and detect exhaustion points during high-volatility market moves.
Core Concept
The indicator measures momentum strength and price acceleration using a smoothed oscillator.
It features two adjustable thresholds:
Overbought level: 58
Oversold level: -58
When the momentum line crosses above or below these zones, it signals potential trend continuation or reversal opportunities.
Features
Detects short-term momentum shifts on XAUUSD 5M.
Works with EMA-based trend confirmation (optional).
Adaptive smoothing reduces noise and false reversals.
Highlights overbought/oversold areas visually.
Can be combined with price action or other oscillators for confluence.
Usage
Instrument: XAUUSD (Gold)
Best timeframe: 5-minute (scalping setup)
Use case: Detecting momentum exhaustion and reversal entries.
Sessions: London & New York recommended.
Disclaimer
This indicator is for market analysis and educational purposes.
No indicator guarantees profit — use proper risk management and test before live trading.
ATR %ATR % Oscillator
A simple and effective Average True Range (ATR) indicator displayed as a percentage of the current price in a separate panel.
FEATURES:
• ATR displayed as percentage of current price for easy cross-asset comparison
• EMA smoothing line using the same period as ATR
• Configurable ATR period (default: 20)
• Clean visualization with zero reference line
HOW IT WORKS:
The indicator calculates ATR and converts it to a percentage: (ATR / Close) × 100
This normalization allows you to:
- Compare volatility across different instruments regardless of price
- Identify high and low volatility periods
- Use the EMA line to spot volatility trends
PARAMETERS:
ATR Period - The lookback period for ATR calculation (default: 20)
Timeframe - Choose any timeframe for ATR calculation independently from the chart timeframe (default: chart timeframe)
SMC + CRT Gold Flow PRO — Fixed RGB ColorsSCRIPT FOR GOLD. I used SMC + CRT strategies. I analyze in H4 timeframe and enter in m15 time frame.
Dual Table Dashboard - Correct V3add RSI Data## 📈 Trading Applications
### 1. Trend Following Strategy
```
1. Check TABLE 1 for trend direction (AnEMA29 + PDMDR)
2. If both green → Look for longs
3. If both red → Look for shorts
4. Use TABLE 2 for entry levels
```
### 2. Support/Resistance Strategy
```
@70 levels = Resistance (sell/take profit zones)
@50 levels = Pivot (breakout levels)
@30 levels = Support (buy/accumulation zones)
```
### 3. Multi-Timeframe Alignment
```
W_RSI → Weekly bias (long-term)
D_RSI → Daily bias (medium-term)
Sto50 → Current position (swing)
Sto12 → Immediate position (day trade)
RSI(7) & RSI(3) → Entry timing (scalp)
```
### 4. Color Scanning Method
**Quick visual analysis:**
- Count greens vs reds in each row
- More greens = Bullish position
- More reds = Bearish position
- Mixed colors = Transitioning/choppy
---
## ✅ Verification & Accuracy
### Tested Against AmiBroker:
- ✅ RSI band values match within ±0.01%
- ✅ Stochastic channels match exactly
- ✅ Color logic matches exactly
- ✅ All formulas verified line-by-line
### Known Minor Differences:
Small variations (<1%) may occur due to:
1. **Platform calculation precision** - Different floating-point engines
2. **Historical data feeds** - Slight variations in past prices
3. **Weekly bar boundaries** - TradingView vs AmiBroker week definitions
4. **Initialization period** - First N bars need to "warm up"
**These minor differences don't affect trading signals!**
---
## ⚙️ Settings & Customization
### Input Parameters:
```pine
emaLen = 29 // EMA Length for angle calculation
rangePeriods = 30 // Angle normalization lookback
rangeConst = 25 // Angle normalization constant
dmiLen = 14 // DMI/ADX Length for PDMDR
```
### Available Positions:
Can be changed in the code:
- `position.top_left`
- `position.top_center`
- `position.top_right`
- `position.middle_left` (Table 2 default)
- `position.middle_center`
- `position.middle_right`
- `position.bottom_left` (Table 1 default)
- `position.bottom_center`
- `position.bottom_right`
### Text Sizes:
- `size.tiny`
- `size.small` (current default)
- `size.normal`
- `size.large`
- `size.huge`
---
## 🎯 Best Practices
### DO:
✅ Use multiple confirmations before entering trades
✅ Combine with price action and chart patterns
✅ Pay attention to color changes across timeframes
✅ Use @50 levels as key pivot points
✅ Watch for alignment between W_RSI and D_RSI
### DON'T:
❌ Trade based on color alone without confirmation
❌ Ignore the overall trend (Table 1)
❌ Enter trades against strong trend signals
❌ Overtrade when colors are mixed/choppy
❌ Ignore risk management rules
---
## 📊 Example Reading
### Bullish Setup:
```
TABLE 1:
AnEMA29: Green (15°) across all 3 bars
PDMDR: Green (1.65) and rising
TABLE 2:
W_RSI@50: Green (price above)
D_RSI@50: Green (price above)
Sto50@50: Green (price above midpoint)
Sto12@50: Green (price above midpoint)
Interpretation: Strong bullish trend confirmed across multiple timeframes
Action: Look for long entries on pullbacks to @50 or @30 levels
```
### Bearish Setup:
```
TABLE 1:
AnEMA29: Red (-12°) across all 3 bars
PDMDR: Red (0.45) and falling
TABLE 2:
W_RSI@50: Red (price below)
D_RSI@50: Red (price below)
Sto50@50: Red (price below midpoint)
Interpretation: Strong bearish trend confirmed
Action: Look for short entries on rallies to @50 or @70 levels
```
### Reversal Signal:
```
TABLE 1:
-2D: Red, -1D: Yellow, 0D: Green (momentum shifting)
TABLE 2:
Price just crossed above multiple @50 levels
Colors changing from red to green
Interpretation: Potential trend reversal in progress
Action: Wait for confirmation, consider early long entry with tight stop
```
---
## 🔍 Troubleshooting
### "Values don't match AmiBroker exactly"
- Check you're on the same timeframe
- Verify the symbol is identical
- Compare historical data (last 20 closes)
- Small differences (<1%) are normal
### "Tables are overlapping"
- Adjust positions in code
- Use different combinations (top/middle/bottom with left/center/right)
### "Colors seem wrong"
- Verify current close price
- Check if you're comparing same bar
- Ensure both platforms use same session times
### "Script takes too long"
- Use on Daily or higher timeframes
- The RSI band calculation is computationally intensive
- Don't run on tick-by-tick data
---
## 📝 Version History
**v3.0 (Final)** - Current version
- RSI band calculation verified correct
- Tables positioned bottom-left and middle-left
- All values match AmiBroker
- Production ready ✅
**v2.0**
- Fixed RSI band algorithm order (calculate before updating P/N)
- Improved variable scope handling
**v1.0**
- Initial implementation
- Had incorrect RSI band calculation
---
## 📄 Files in Package
Fib OscillatorWhat is Fib Oscillator and How to Use it?
🔶 1. Conceptual Overview
The Fib Oscillator is a Fibonacci-based relative position oscillator.
Instead of measuring momentum (like RSI or MACD), it measures where price currently sits between the recent swing high and swing low, expressed as a percentage within the Fibonacci range.
In other words:
It answers: “Where is price right now within its most recent dynamic range?”
It visualizes retracement and extension zones numerically, providing continuous feedback between 0% and 100% (and beyond if extended).
🔶 2. What the Script Does
The indicator:
Automatically detects recent high and low levels using an adaptive lookback window, which depends on ATR volatility.
Calculates the current price’s position between those levels as a percentage (0–100).
Plots that percentage as an oscillator — showing visually whether price is near the top, middle, or bottom of its recent range.
Overlays Fibonacci retracement levels (23.6%, 38.2%, 50%, 61.8%, 78.6%) as reference zones.
Generates alerts when the oscillator crosses key Fib thresholds — which can signal retracement completion, breakout potential, or pullback exhaustion.
🔶 3. Technical Flow Breakdown
(a) Inputs
Input Description Default Notes
atrLength ATR period used for volatility estimation 14 Used to dynamically tune lookback sensitivity
minLookback Minimum lookback window (candles) 20 Ensures stability even in low volatility
maxLookback Maximum lookback window 100 Limits over-expansion during high volatility
isInverse Inverts chart orientation false Useful for inverse markets (e.g. shorts or inverse BTC view)
(b) Volatility-Adaptive Lookback
Instead of using a fixed lookback, it calculates:
lookback
=
SMA(ATR,10)
/
SMA(Close,10)
×
500
lookback=SMA(ATR,10)/SMA(Close,10)×500
Then it clamps this between minLookback and maxLookback.
This makes the oscillator:
More reactive during high volatility (shorter lookback)
More stable during calm markets (longer lookback)
Essentially, it self-adjusts to market rhythm — you don’t have to constantly tweak lookback manually.
(c) High-Low Reference Points
It takes the highest and lowest points within the dynamic lookback window.
If isInverse = true, it flips the candle logic (useful if viewing inverse instruments like stablecoin pairs or when analyzing bearish setups invertedly).
(d) Oscillator Core
The main oscillator line:
osc
=
(
close
−
low
)
(
high
−
low
)
×
100
osc=
(high−low)
(close−low)
×100
0% = Price is at the lookback low.
100% = Price is at the lookback high.
50% = Midpoint (balanced).
Between Fibonacci percentages (23.6%, 38.2%, 61.8%, etc.), the oscillator indicates retracement stages.
(e) Fibonacci Levels as Reference
It overlays horizontal reference lines at:
0%, 23.6%, 38.2%, 50%, 61.8%, 78.6%, 100%
These act as support/resistance bands in oscillator space.
You can read it similar to how traders use Fibonacci retracements on charts, but compressed into a single line oscillator.
(f) Alerts
The script includes built-in alert conditions for crossovers at each major Fibonacci level.
You can set TradingView alerts such as:
“Oscillator crossed above 61.8%” → possible bullish continuation or breakout.
“Oscillator crossed below 38.2%” → possible pullback or correction starting.
This allows automated monitoring of fib retracement completions without manually drawing fib levels.
🔶 4. How to Use It
🔸 Visual Interpretation
Oscillator Value Zone Market Context
0–23.6% Deep Retracement Potential exhaustion of a down-move / early reversal
23.6–38.2% Shallow retracement zone Possible continuation phase
38.2–50% Mid retracement Neutral or indecisive structure
50–61.8% Key pivot region Common trend resumption zone
61.8–78.6% Late retracement Often “last pullback” area
78.6–100% Near high range Possible overextension / profit-taking
>100% Range breakout New leg formation / expansion
🔸 Practical Application Steps
Load the indicator on your chart (set overlay = false, so it’s below the main price chart).
Observe oscillator position relative to fib bands:
Use it to determine retracement depth.
Combine with structure tools:
Trend lines, swing points, or HTF market structure.
Use crossovers for timing:
Crossing above 61.8% in an uptrend often confirms breakout continuation.
Crossing below 38.2% in a downtrend signals renewed downside momentum.
For range markets, oscillator swings between 23.6% and 78.6% can define accumulation/distribution boundaries.
🔶 5. When to Use It
During Retracements: To gauge how deep the pullback has gone.
During Range Markets: To identify relative overbought/oversold positions.
Before Breakouts: Crossovers of 61.8% or 78.6% often precede impulsive moves.
In Multi-Timeframe Contexts:
LTF (15M–1H): Detect intraday retracement exhaustion.
HTF (4H–1D): Confirm major range expansions or key reversal zones.
🔶 6. Ideal Companion Indicators
The Fib Oscillator works best when contextualized with structure, volatility, and trend bias indicators.
Below are optimal pairings:
Companion Indicator Purpose Integration Insight
Market Structure MTF Tool Identify active trend direction Use Fib Oscillator only in trend direction for cleaner signals
EMA Ribbon / Supertrend Trend confirmation Align oscillator crossovers with EMA bias
ATR Bands / Volatility Envelope Validate breakout strength If oscillator >78.6% & ATR rising → valid breakout
Volume Oscillator Confirm retracement strength Volume contraction + oscillator under 38.2% → potential reversal
HTF Fib Retracement Tool Combine LTF oscillator with HTF fib confluence Powerful multi-timeframe setups
RSI or Stochastic Measure momentum relative to position RSI divergence while oscillator near 78.6% → exhaustion clue
🔶 7. Understanding the Settings
Setting Function Practical Impact
ATR Period (14) Controls volatility sampling Higher = smoother lookback adaptation
Min Lookback (20) Smallest window allowed Lower = more reactive but noisier
Max Lookback (100) Largest window allowed Higher = smoother but slower to react
Inverse Candle Chart Flips oscillator vertically Useful when analyzing bearish or inverse scenarios (e.g. short-side fib mapping)
Recommended Configs:
For scalping/intraday: ATR 10–14, lookback 20–50
For swing/position trading: ATR 14–21, lookback 50–100
🔶 8. Example Trade Logic (Practical Use)
Scenario: Uptrend on 4H chart
Oscillator drops to below 38.2% → retracement zone
Price consolidates → oscillator stabilizes
Oscillator crosses above 50% → pullback ending
Entry: Long when oscillator crosses above 61.8%
Exit: Near 78.6–100% zone or upon divergence with RSI
For Short Bias (Inverse Setup):
Enable isInverse = true to visually flip the oscillator (so lows become highs).
Use the same thresholds inversely.
🔶 9. Strengths & Limitations
✅ Strengths
Dynamic, self-adapting to volatility
Quantifies Fib retracement as a continuous function
Compact oscillator view (no clutter on chart)
Works well across all timeframes
Compatible with both trending and ranging markets
⚠️ Limitations
Doesn’t define trend direction — must be used with structure filters
Can whipsaw during choppy consolidations
The “lookback auto-adjust” may lag in sudden volatility shifts
Shouldn’t be used standalone for entries without structural confluence
🔶 10. Summary
The “Fib Oscillator” is a dynamic Fibonacci-relative positioning tool that merges retracement theory with adaptive volatility logic.
It gives traders an intuitive, quantified view of where price sits within its recent fib range, allowing anticipation of pullbacks, reversals, or breakout momentum.
Think of it as a "Fibonacci RSI", but instead of momentum strength, it shows positional depth — the vibrational location of price within its natural swing cycle.
Hidden Impulse═══════════════════════════════════════════════════════════════════
HIDDEN IMPULSE - Multi-Timeframe Momentum Detection System
═══════════════════════════════════════════════════════════════════
OVERVIEW
Hidden Impulse is an advanced momentum oscillator that combines the Schaff Trend Cycle (STC) and Force Index into a comprehensive multi-timeframe trading system. Unlike standard implementations of these indicators, this script introduces three distinct trading setups with specific entry conditions, multi-timeframe confirmation, and trend filtering.
═══════════════════════════════════════════════════════════════════
ORIGINALITY & KEY FEATURES
This indicator is original in the following ways:
1. DUAL-TIMEFRAME STC ANALYSIS
Standard STC implementations work on a single timeframe. This script
simultaneously analyzes STC on both your trading timeframe and a higher
timeframe, providing trend context and filtering out low-probability signals.
2. FORCE INDEX INTEGRATION
The script combines STC with Force Index (volume-weighted price momentum)
to confirm the strength behind price moves. This combination helps identify
when momentum shifts are backed by genuine buying/selling pressure.
3. THREE DISTINCT TRADING SETUPS
Rather than generic overbought/oversold signals, the indicator provides
three specific, rule-based setups:
- Setup A: Classic trend-following entries with multi-timeframe confirmation
- Setup B: Divergence-based reversal entries (highest probability)
- Setup C: Mean-reversion bounce trades at extreme levels
4. INTELLIGENT FILTERING
All signals are filtered through:
- 50 EMA trend direction (prevents counter-trend trades)
- Higher timeframe STC alignment (ensures macro trend agreement)
- Force Index confirmation (validates volume support)
═══════════════════════════════════════════════════════════════════
HOW IT WORKS - TECHNICAL EXPLANATION
SCHAFF TREND CYCLE (STC) CALCULATION:
The STC is a cyclical oscillator that combines MACD concepts with stochastic
smoothing to create earlier and smoother trend signals.
Step 1: Calculate MACD
- Fast MA = EMA(close, Length1) — default 23
- Slow MA = EMA(close, Length2) — default 50
- MACD Line = Fast MA - Slow MA
Step 2: First Stochastic Smoothing
- Apply stochastic calculation to MACD
- Stoch1 = 100 × (MACD - Lowest(MACD, Smoothing)) / (Highest(MACD, Smoothing) - Lowest(MACD, Smoothing))
- Smooth result with EMA(Stoch1, Smoothing) — default 10
Step 3: Second Stochastic Smoothing
- Apply stochastic calculation again to the smoothed stochastic
- This creates the final STC value between 0-100
The dual stochastic smoothing makes STC more responsive than MACD while
being smoother than traditional stochastics.
FORCE INDEX CALCULATION:
Force Index measures the power behind price movements by incorporating volume:
Force Raw = (Close - Close ) × Volume
Force Index = EMA(Force Raw, Period) — default 13
Interpretation:
- Positive Force Index = Buying pressure (bulls in control)
- Negative Force Index = Selling pressure (bears in control)
- Force Index crossing zero = Momentum shift
- Divergences with price = Weakening momentum (reversal signal)
TREND FILTER:
A 50-period EMA serves as the trend filter:
- Price above EMA50 = Uptrend → Only LONG signals allowed
- Price below EMA50 = Downtrend → Only SHORT signals allowed
This prevents counter-trend trading which accounts for most losing trades.
═══════════════════════════════════════════════════════════════════
THE THREE TRADING SETUPS - DETAILED
SETUP A: CLASSIC MOMENTUM ENTRY
Concept: Enter when STC exits oversold/overbought zones with trend confirmation
LONG CONDITIONS:
1. Higher timeframe STC > 25 (macro trend is up)
2. Primary timeframe STC crosses above 25 (momentum turning up)
3. Force Index crosses above 0 OR already positive (volume confirms)
4. Price above 50 EMA (local trend is up)
SHORT CONDITIONS:
1. Higher timeframe STC < 75 (macro trend is down)
2. Primary timeframe STC crosses below 75 (momentum turning down)
3. Force Index crosses below 0 OR already negative (volume confirms)
4. Price below 50 EMA (local trend is down)
Best for: Trending markets, continuation trades
Win rate: Moderate (60-65%)
Risk/Reward: 1:2 to 1:3
───────────────────────────────────────────────────────────────────
SETUP B: DIVERGENCE REVERSAL (HIGHEST PROBABILITY)
Concept: Identify exhaustion points where price makes new extremes but
momentum (Force Index) fails to confirm
BULLISH DIVERGENCE:
1. Price makes a lower low (LL) over 10 bars
2. Force Index makes a higher low (HL) — refuses to follow price down
3. STC is below 25 (oversold condition)
Trigger: STC starts rising AND Force Index crosses above zero
BEARISH DIVERGENCE:
1. Price makes a higher high (HH) over 10 bars
2. Force Index makes a lower high (LH) — refuses to follow price up
3. STC is above 75 (overbought condition)
Trigger: STC starts falling AND Force Index crosses below zero
Why this works: Divergences signal that the current trend is losing steam.
When volume (Force Index) doesn't confirm new price extremes, a reversal
is likely.
Best for: Reversal trading, range-bound markets
Win rate: High (70-75%)
Risk/Reward: 1:3 to 1:5
───────────────────────────────────────────────────────────────────
SETUP C: QUICK BOUNCE AT EXTREMES
Concept: Catch rapid mean-reversion moves when price touches EMA50 in
extreme STC zones
LONG CONDITIONS:
1. Price touches 50 EMA from above (pullback in uptrend)
2. STC < 15 (extreme oversold)
3. Force Index > 0 (buyers stepping in)
SHORT CONDITIONS:
1. Price touches 50 EMA from below (pullback in downtrend)
2. STC > 85 (extreme overbought)
3. Force Index < 0 (sellers stepping in)
Best for: Scalping, quick mean-reversion trades
Win rate: Moderate (55-60%)
Risk/Reward: 1:1 to 1:2
Note: Use tighter stops and quick profit-taking
═══════════════════════════════════════════════════════════════════
HOW TO USE THE INDICATOR
STEP 1: CONFIGURE TIMEFRAMES
Primary Timeframe (STC - Primary Timeframe):
- Leave empty to use your current chart timeframe
- This is where you'll take trades
Higher Timeframe (STC - Higher Timeframe):
- Default: 30 minutes
- Recommended ratios:
* 5min chart → 30min higher TF
* 15min chart → 1H higher TF
* 1H chart → 4H higher TF
* Daily chart → Weekly higher TF
───────────────────────────────────────────────────────────────────
STEP 2: ADJUST STC PARAMETERS FOR YOUR MARKET
Default (23/50/10) works well for stocks and forex, but adjust for:
CRYPTO (volatile):
- Length 1: 15
- Length 2: 35
- Smoothing: 8
(Faster response for rapid price movements)
STOCKS (standard):
- Length 1: 23
- Length 2: 50
- Smoothing: 10
(Balanced settings)
FOREX MAJORS (slower):
- Length 1: 30
- Length 2: 60
- Smoothing: 12
(Filters out noise in 24/7 markets)
───────────────────────────────────────────────────────────────────
STEP 3: ENABLE YOUR PREFERRED SETUPS
Toggle setups based on your trading style:
Conservative Trader:
✓ Setup B (Divergence) — highest win rate
✗ Setup A (Classic) — only in strong trends
✗ Setup C (Bounce) — too aggressive
Trend Trader:
✓ Setup A (Classic) — primary signals
✓ Setup B (Divergence) — for entries on pullbacks
✗ Setup C (Bounce) — not suitable for trending
Scalper:
✓ Setup C (Bounce) — quick in-and-out
✓ Setup B (Divergence) — high probability scalps
✗ Setup A (Classic) — too slow
───────────────────────────────────────────────────────────────────
STEP 4: READ THE SIGNALS
ON THE CHART:
Labels appear when conditions are met:
Green labels:
- "LONG A" — Setup A long entry
- "LONG B DIV" — Setup B divergence long (best signal)
- "LONG C" — Setup C bounce long
Red labels:
- "SHORT A" — Setup A short entry
- "SHORT B DIV" — Setup B divergence short (best signal)
- "SHORT C" — Setup C bounce short
IN THE INDICATOR PANEL (bottom):
- Blue line = Primary timeframe STC
- Orange dots = Higher timeframe STC (optional)
- Green/Red bars = Force Index histogram
- Dashed lines at 25/75 = Entry/Exit zones
- Background shading = Oversold (green) / Overbought (red)
INFO TABLE (top-right corner):
Shows real-time status:
- STC values for both timeframes
- Force Index direction
- Price position vs EMA
- Current trend direction
- Active signal type
═══════════════════════════════════════════════════════════════════
TRADING STRATEGY & RISK MANAGEMENT
ENTRY RULES:
Priority ranking (best to worst):
1st: Setup B (Divergence) — wait for these
2nd: Setup A (Classic) — in confirmed trends only
3rd: Setup C (Bounce) — scalping only
Confirmation checklist before entry:
☑ Signal label appears on chart
☑ TREND in info table matches signal direction
☑ Higher timeframe STC aligned (check orange dots or table)
☑ Force Index confirming (check histogram color)
───────────────────────────────────────────────────────────────────
STOP LOSS PLACEMENT:
Setup A (Classic):
- LONG: Below recent swing low
- SHORT: Above recent swing high
- Typical: 1-2 ATR distance
Setup B (Divergence):
- LONG: Below the divergence low
- SHORT: Above the divergence high
- Typical: 0.5-1.5 ATR distance
Setup C (Bounce):
- LONG: 5-10 pips below EMA50
- SHORT: 5-10 pips above EMA50
- Typical: 0.3-0.8 ATR distance
───────────────────────────────────────────────────────────────────
TAKE PROFIT TARGETS:
Conservative approach:
- Exit when STC reaches opposite level
- LONG: Exit when STC > 75
- SHORT: Exit when STC < 25
Aggressive approach:
- Hold until opposite signal appears
- Trail stop as STC moves in your favor
Partial profits:
- Take 50% at 1:2 risk/reward
- Let remaining 50% run to target
───────────────────────────────────────────────────────────────────
WHAT TO AVOID:
❌ Trading Setup A in sideways/choppy markets
→ Wait for clear trend or use Setup B only
❌ Ignoring higher timeframe STC
→ Always check orange dots align with your direction
❌ Taking signals against the major trend
→ If weekly trend is down, be cautious with longs
❌ Overtrading Setup C
→ Maximum 2-3 bounce trades per session
❌ Trading during low volume periods
→ Force Index becomes unreliable
═══════════════════════════════════════════════════════════════════
ALERTS CONFIGURATION
The indicator includes 8 alert types:
Individual setup alerts:
- "Setup A - LONG" / "Setup A - SHORT"
- "Setup B - DIV LONG" / "Setup B - DIV SHORT" ⭐ recommended
- "Setup C - BOUNCE LONG" / "Setup C - BOUNCE SHORT"
Combined alerts:
- "ANY LONG" — fires on any long signal
- "ANY SHORT" — fires on any short signal
Recommended alert setup:
- Create "Setup B - DIV LONG" and "Setup B - DIV SHORT" alerts
- These are the highest probability signals
- Set "Once Per Bar Close" to avoid false alerts
═══════════════════════════════════════════════════════════════════
VISUALIZATION SETTINGS
Show Labels on Chart:
Toggle on/off the signal labels (green/red)
Disable for cleaner chart once you're familiar with the indicator
Show Higher TF STC:
Toggle the orange dots showing higher timeframe STC
Useful for visual confirmation of multi-timeframe alignment
Info Panel:
Cannot be disabled — always shows current status
Positioned top-right to avoid chart interference
═══════════════════════════════════════════════════════════════════
EXAMPLE TRADE WALKTHROUGH
SETUP B DIVERGENCE LONG EXAMPLE:
1. Market Context:
- Price in downtrend, below 50 EMA
- Multiple lower lows forming
- STC below 25 (oversold)
2. Divergence Formation:
- Price makes new low at $45.20
- Force Index refuses to make new low (higher low forms)
- This indicates selling pressure weakening
3. Signal Trigger:
- STC starts turning up
- Force Index crosses above zero
- Label appears: "LONG B DIV"
4. Trade Execution:
- Entry: $45.50 (current price at signal)
- Stop Loss: $44.80 (below divergence low)
- Target 1: $47.90 (STC reaches 75) — risk/reward 1:3.4
- Target 2: Opposite signal or trail stop
5. Trade Management:
- Price rallies to $47.20
- STC reaches 68 (approaching target zone)
- Take 50% profit, move stop to breakeven
- Exit remaining at $48.10 when STC crosses 75
Result: 3.7R gain
═══════════════════════════════════════════════════════════════════
ADVANCED TIPS
1. MULTI-TIMEFRAME CONFLUENCE
For highest probability trades, wait for:
- Primary TF signal
- Higher TF STC aligned (>25 for longs, <75 for shorts)
- Even higher TF trend in same direction (manual check)
2. VOLUME CONFIRMATION
Watch the Force Index histogram:
- Increasing bar size = Strengthening momentum
- Decreasing bar size = Weakening momentum
- Use this to gauge signal strength
3. AVOID THESE MARKET CONDITIONS
- Major news events (Force Index becomes erratic)
- Market open first 30 minutes (volatility spikes)
- Low liquidity instruments (Force Index unreliable)
- Extreme trending days (wait for pullbacks)
4. COMBINE WITH SUPPORT/RESISTANCE
Best signals occur near:
- Key horizontal levels
- Fibonacci retracements
- Previous day's high/low
- Psychological round numbers
5. SESSION AWARENESS
- Asia session: Use lower timeframes, Setup C works well
- London session: Setup A and B both effective
- New York session: All setups work, highest volume
═══════════════════════════════════════════════════════════════════
INDICATOR WINDOWS LAYOUT
MAIN CHART:
- Price action
- 50 EMA (green/red)
- Signal labels
- Info panel
INDICATOR WINDOW:
- STC oscillator (blue line, 0-100 scale)
- Higher TF STC (orange dots, optional)
- Force Index histogram (green/red bars)
- Reference levels (25, 50, 75)
- Background zones (green oversold, red overbought)
═══════════════════════════════════════════════════════════════════
PERFORMANCE OPTIMIZATION
For best results:
Backtesting:
- Test on your specific instrument and timeframe
- Adjust STC parameters if win rate < 55%
- Record which setup works best for your market
Position Sizing:
- Risk 1-2% per trade
- Setup B can use 2% risk (higher win rate)
- Setup C should use 1% risk (lower win rate)
Trade Frequency:
- Setup B: 2-5 signals per week (be patient)
- Setup A: 5-10 signals per week
- Setup C: 10+ signals per week (scalping)
═══════════════════════════════════════════════════════════════════
CREDITS & REFERENCES
This indicator builds upon established technical analysis concepts:
Schaff Trend Cycle:
- Developed by Doug Schaff (1996)
- Original concept published in Technical Analysis of Stocks & Commodities
- Implementation based on standard STC formula
Force Index:
- Developed by Dr. Alexander Elder
- Described in "Trading for a Living" (1993)
- Classic volume-momentum indicator
The multi-timeframe integration, three-setup system, and specific
entry conditions are original contributions of this indicator.
═══════════════════════════════════════════════════════════════════
DISCLAIMER
This indicator is a technical analysis tool and does not guarantee profits.
Past performance is not indicative of future results. Always:
- Use proper risk management
- Test on demo account first
- Combine with fundamental analysis
- Never risk more than you can afford to lose
═══════════════════════════════════════════════════════════════════
SUPPORT & QUESTIONS
If you find this indicator helpful, please:
- Leave a like and comment
- Share your feedback and results
- Report any bugs or issues
For questions about usage or optimization for specific markets,
feel free to comment below.
═════════════════════════════════════════════════════════════
Dual RVI Divergence Detector: Volatility + Vigor
This script combines two distinct but complementary momentum oscillators—the Relative Volatility Index (RVI Volatility) by Donald Dorsey and the Relative Vigor Index (RVI Vigor) by John Ehlers—into a single, unified divergence detection system.
Why combine them?
RVI Volatility measures the directional consistency of volatility, helping identify overbought/oversold conditions based on price dispersion.
RVI Vigor measures the strength of price movement relative to its range, reflecting market conviction through the relationship between open/close and high/low.
While both are called "RVI", they are fundamentally different indicators with unique mathematical foundations. Using them together provides convergent confirmation: when both oscillators show bullish (or bearish) divergence at the same time, the signal gains statistical robustness. This reduces false positives compared to using either in isolation.
Key Original Enhancements (by Carlos Mauricio Vizcarra, 2025):
Dynamic normalization: The Vigor oscillator (normally centered near 0) is scaled to the 0–100 range of the Volatility RVI, enabling direct visual comparison in a single panel without distortion.
Independent divergence logic: Each oscillator retains its own pivot detection, divergence conditions (regular + hidden), and visual markers ("R"/"H" labels + connecting lines).
User-controlled visibility: Traders can toggle each RVI on/off to focus on one signal or compare both.
Full compliance with MPL 2.0: Original authors are credited, and all reused concepts are properly attributed.
How to Use:
Look for aligned divergences (e.g., bullish divergence on both RVIs) for high-probability reversals.
Use hidden divergences for trend-continuation signals.
The SMA filters (configurable) help smooth noise.
All alerts are included for automated scanning.
Note: This is not a simple "mashup". It solves a real analytical problem: comparing structurally different oscillators on equal visual footing while preserving their unique divergence behaviors—something not available in any single existing indicator.
Additional Compliance Notes :
No emoji or non-ASCII characters in title
English-first description (you may add Spanish after if desired)
Clear justification for combining two indicators
Explanation of calculations (Dorsey vs. Ehlers)
Highlight of original contributions (normalization, dual divergence logic, UI controls)
No promotion, links, or contact info
Clean chart recommended: publish with only this script active, no other indicators or drawings
Blue Dot Red DotInspired by Dr Wish
This script is a confluence indicator designed to identify potential trend reversals or "mean reversion" trade setups. It plots buy (blue) and sell (red) dots directly on your price chart.
The core strategy is to find moments where price is overextended (using Bollinger Bands) and momentum is simultaneously reversing (using the Stochastic Oscillator). A signal is only generated when both of these conditions are met.
Core Components
The script combines two classic technical indicators:
Bollinger Bands (BB):
These create a "channel" around the price based on a simple moving average (the basis) and a standard deviation (dev).
Upper Band: Basis + (2.0 * StdDev)
Lower Band: Basis - (2.0 * StdDev)
In this script, the bands are used to identify when the price has moved significantly far from its recent average, suggesting it's "overbought" (at the upper band) or "oversold" (at the lower band) and may be due for a pullback.
Stochastic Oscillator:
This is a momentum oscillator that compares a closing price to its price range over a certain period.
It consists of two lines: %K (the main, faster line) and %D (a moving average of %K, the slower signal line).
It's used to identify overbought and oversold momentum conditions and, more importantly, momentum shifts, which are signaled by the %K and %D lines crossing.
Signal Logic: How the Dots Are Generated
This script's "secret sauce" is that it demands three specific conditions to be true at the same time before plotting a dot.
🔵 Blue Dot (Buy Signal)
A blue dot will appear below a price bar if all three of these conditions are met:
Stochastic Crossover: The faster %K line crosses above the slower %D line (ta.crossover(k, d)). This signals that short-term momentum is starting to turn bullish.
Was Oversold: On the previous bar, the %K line was below the "Oversold Threshold" (was_oversold = k < oversold). This ensures the bullish crossover is happening from an oversold (or at least bearish) momentum state.
Note: The default oversold threshold is set to 50. This is a key detail. It means the script is looking for a bullish crossover that originates from anywhere in the bottom half of the Stochastic range, not just the traditional "extreme" oversold area (like 20).
Price Extension: Within the last 3 bars (the current bar or the two before it), the price's low must have touched or gone below the lower Bollinger Band (bb_touch_lower). This confirms that the price itself is in an "oversold" or overextended area.
In plain English: A blue dot appears when the price has recently dipped to an extreme low (touching the lower BB) and its underlying momentum has just started to turn back up (Stoch cross from the lower half).
🔴 Red Dot (Sell Signal)
A red dot will appear above a price bar if all three of these conditions are met:
Stochastic Crossunder: The faster %K line crosses below the slower %D line (ta.crossunder(k, d)). This signals that short-term momentum is starting to turn bearish.
Was Overbought: On the previous bar, the %K line was above the "Overbought Threshold" (was_overbought = k > overbought). The default for this is 80, which is a traditional overbought level.
Price Extension: Within the last 3 bars (the current bar or the two before it), the price's high must have touched or gone above the upper Bollinger Band (bb_touch_upper). This confirms that the price itself is in an "overbought" or overextended area.
A red dot appears when the price has recently spiked to an extreme high (touching the upper BB) and its underlying momentum has just started to roll over and turn back down (Stoch cross from the overbought zone).
Dynamic Length RSI (DRSI)Dynamic Length RSI (DRSI)
This indicator is an advanced tool that seeks to improve the sensitivity and adaptability of the traditional Relative Strength Index (RSI).
Its main feature is that it uses a variable length calculation instead of a fixed length (like the standard 14), automatically adjusting to market volatility conditions. The length used to calculate the RSI dynamically adjusts between a predefined minimum and maximum, based on volatility (ATR).
The change in length is indicated by the candlestick background. Gray candles represent ascending Dyn (weakness/consolidation/declining volatility), blue or white candles represent descending Dyn (strength, trend, rising volatility).
Smart MACD Volume Trader# Smart MACD Volume Trader
## Overview
Smart MACD Volume Trader is an enhanced momentum indicator that combines the classic MACD (Moving Average Convergence Divergence) oscillator with an intelligent high-volume filter. This combination significantly reduces false signals by ensuring that trading signals are only generated when price momentum is confirmed by substantial volume activity.
The indicator supports over 24 different instruments including major and exotic forex pairs, precious metals (gold and silver), energy commodities (crude oil, natural gas), and industrial metals (copper). For forex and commodity traders, the indicator automatically maps to CME and COMEX futures contracts to provide accurate institutional-grade volume data.
## Originality and Core Concept
Traditional MACD indicators generate signals based solely on price momentum, which can result in numerous false signals during low-activity periods or ranging markets. This indicator addresses this critical weakness by introducing a volume confirmation layer with automatic institutional volume integration.
**What makes this approach original:**
- Signals are triggered only when MACD crossovers coincide with elevated volume activity
- Implements a lookback mechanism to detect volume spikes within recent bars
- Automatically detects and maps 24+ forex pairs and commodities to their corresponding CME and COMEX futures contracts
- Provides real institutional volume data for forex pairs where spot volume is unreliable
- Combines two independent market dimensions (price momentum and volume) into a single, actionable signal
- Includes intelligent asset detection that works across multiple exchanges and ticker formats
**The underlying principle:** Volume validates price movement. When institutional money enters the market, it creates volume signatures. By requiring high volume confirmation and using actual institutional volume data from futures markets, this indicator filters out weak price movements and focuses on trades backed by genuine market participation. The automatic futures mapping ensures that forex and commodity traders always have access to the most accurate volume data available, without manual configuration.
## How It Works
### MACD Component
The indicator calculates MACD using standard methodology:
1. **Fast EMA (default: 12 periods)** - Tracks short-term price momentum
2. **Slow EMA (default: 26 periods)** - Tracks longer-term price momentum
3. **MACD Line** - Difference between Fast EMA and Slow EMA
4. **Signal Line (default: 9-period SMA)** - Smoothed average of MACD line
**Crossover signals:**
- **Bullish:** MACD line crosses above Signal line (momentum turning positive)
- **Bearish:** MACD line crosses below Signal line (momentum turning negative)
### Volume Filter Component
The volume filter adds an essential confirmation layer:
1. **Volume Moving Average** - Calculates exponential MA of volume (default: 20 periods)
2. **High Volume Threshold** - Multiplies MA by ratio (default: 2.0x or 200%)
3. **Volume Detection** - Identifies bars where current volume exceeds threshold
4. **Lookback Period** - Checks if high volume occurred in recent bars (default: 5 bars)
**Signal logic:**
- Buy/Sell signals only trigger when BOTH conditions are met:
- MACD crossover/crossunder occurs
- High volume detected within lookback period
### Automatic CME Futures Integration
For forex traders, spot FX volume data can be unreliable or non-existent. This indicator solves this problem by automatically detecting forex pairs and mapping them to corresponding CME futures contracts with real institutional volume data.
**Supported Major Forex Pairs (7):**
- EURUSD → CME:6E1! (Euro FX Futures)
- GBPUSD → CME:6B1! (British Pound Futures)
- AUDUSD → CME:6A1! (Australian Dollar Futures)
- USDJPY → CME:6J1! (Japanese Yen Futures)
- USDCAD → CME:6C1! (Canadian Dollar Futures)
- USDCHF → CME:6S1! (Swiss Franc Futures)
- NZDUSD → CME:6N1! (New Zealand Dollar Futures)
**Supported Exotic Forex Pairs (4):**
- USDMXN → CME:6M1! (Mexican Peso Futures)
- USDRUB → CME:6R1! (Russian Ruble Futures)
- USDBRL → CME:6L1! (Brazilian Real Futures)
- USDZAR → CME:6Z1! (South African Rand Futures)
**Supported Cross Pairs (6):**
- EURJPY → CME:6E1! (Uses Euro Futures)
- GBPJPY → CME:6B1! (Uses British Pound Futures)
- EURGBP → CME:6E1! (Uses Euro Futures)
- AUDJPY → CME:6A1! (Uses Australian Dollar Futures)
- EURAUD → CME:6E1! (Uses Euro Futures)
- GBPAUD → CME:6B1! (Uses British Pound Futures)
**Supported Precious Metals (2):**
- Gold (XAUUSD, GOLD) → COMEX:GC1! (Gold Futures)
- Silver (XAGUSD, SILVER) → COMEX:SI1! (Silver Futures)
**Supported Energy Commodities (3):**
- WTI Crude Oil (USOIL, WTIUSD) → NYMEX:CL1! (Crude Oil Futures)
- Brent Oil (UKOIL) → NYMEX:BZ1! (Brent Crude Futures)
- Natural Gas (NATGAS) → NYMEX:NG1! (Natural Gas Futures)
**Supported Industrial Metals (1):**
- Copper (COPPER) → COMEX:HG1! (Copper Futures)
**How the automatic detection works:**
The indicator intelligently identifies the asset type by analyzing:
1. Exchange name (FX, OANDA, TVC, COMEX, NYMEX, etc.)
2. Currency pair pattern (6-letter codes like EURUSD, GBPUSD)
3. Commodity identifiers (XAU for gold, XAG for silver, OIL for crude)
When a supported instrument is detected, the indicator automatically switches to the corresponding futures contract for volume analysis. For stocks, cryptocurrencies, and other assets, the indicator uses the native volume data from the current chart.
**Visual feedback:**
An information table appears in the top-right corner of the MACD pane showing:
- Current chart symbol
- Exchange name
- Currency pair or asset name
- Volume source being used (highlighted in orange for futures, yellow for native volume)
- Current high volume status
This provides complete transparency about which data source the indicator is using for its volume analysis.
## How to Use
### Basic Setup
1. Add the indicator to your chart
2. The indicator displays in a separate pane (MACD) and overlay (signals/volume bars)
3. Default settings work well for most assets, but can be customized
### Signal Interpretation
### Visual Signals
**Visual Signals:**
- **Green "BUY" label** - Bullish MACD crossover confirmed by high volume
- **Red "SELL" label** - Bearish MACD crossunder confirmed by high volume
- **Green/Red candles** - Highlight bars with volume exceeding the threshold
- **Light green/red background** - Emphasizes signal bars on the chart
**Information Table:**
A detailed information table appears in the top-right corner of the MACD pane, providing real-time transparency about the indicator's operation:
- **Chart:** Current symbol being analyzed
- **Exchange:** The exchange or data feed being used
- **Pair:** The currency pair or asset name extracted from the ticker
- **Volume From:** The actual symbol used for volume analysis
- Orange color indicates CME or COMEX futures are being used (automatic institutional volume)
- Yellow color indicates native volume from the chart symbol is being used
- Hover tooltip shows whether automatic futures mapping is active
- **High Volume:** Current status showing YES (green) when volume exceeds threshold, NO (gray) otherwise
This table ensures complete transparency and allows you to verify that the correct volume source is being used for your analysis.
**Volume Analysis:**
- Gray histogram bars = Normal volume
- Red histogram bars = High volume (exceeds threshold)
- Green line = Volume moving average baseline
**MACD Analysis:**
- Blue line = MACD line (momentum indicator)
- Orange line = Signal line (trend confirmation)
- Gray dotted line = Zero line (bullish above, bearish below)
### Parameter Customization
**MACD Parameters:**
- Adjust Fast/Slow EMA lengths for different sensitivities
- Shorter periods = More signals, faster response
- Longer periods = Fewer signals, less noise
**Volume Parameters:**
- **Volume MA Period:** Higher values smooth volume analysis
- **High Volume Ratio:** Lower values (1.5x) = More signals; Higher values (3.0x) = Fewer, stronger signals
- **Volume Lookback Bars:** Controls how recent the volume spike must be
**Direction Filters:**
- **Only Buy Signals:** Enables long-only strategy mode
- **Only Sell Signals:** Enables short-only strategy mode
### Alert Configuration
The indicator includes three alert types:
1. **Buy Signal Alert** - Triggers when bullish signal appears
2. **Sell Signal Alert** - Triggers when bearish signal appears
3. **High Volume Alert** - Triggers when volume exceeds threshold
To set up alerts:
1. Click the indicator name → "Add alert on Smart MACD Volume Trader"
2. Select desired alert condition
3. Configure notification method (popup, email, webhook, etc.)
## Trading Strategy Guidelines
### Best Practices
**Recommended markets:**
- Liquid stocks (large-cap, high daily volume)
- Major forex pairs (EURUSD, GBPUSD, USDJPY, AUDUSD, USDCAD, USDCHF, NZDUSD)
- Exotic forex pairs (USDMXN, USDRUB, USDBRL, USDZAR)
- Cross pairs (EURJPY, GBPJPY, EURGBP, AUDJPY, EURAUD, GBPAUD)
- Precious metals (Gold, Silver with automatic COMEX futures mapping)
- Energy commodities (Crude Oil, Natural Gas with automatic NYMEX futures mapping)
- Industrial metals (Copper with automatic COMEX futures mapping)
- Major cryptocurrency pairs
- Index futures and ETFs
**Timeframe recommendations:**
- **Day trading:** 5-minute to 15-minute charts
- **Swing trading:** 1-hour to 4-hour charts
- **Position trading:** Daily charts
**Risk management:**
- Use signals as entry confirmation, not standalone strategy
- Combine with support/resistance levels
- Consider overall market trend direction
- Always use stop-loss orders
### Strategy Examples
**Trend Following Strategy:**
1. Identify overall trend using higher timeframe (e.g., daily chart)
2. Trade only in trend direction
3. Use "Only Buy" filter in uptrends, "Only Sell" in downtrends
4. Enter on signal, exit on opposite signal or at resistance/support
**Volume Breakout Strategy:**
1. Wait for consolidation period (low volume, tight MACD range)
2. Enter when signal appears with high volume (confirms breakout)
3. Target previous swing highs/lows
4. Stop loss below/above recent consolidation
**Forex Scalping Strategy (with automatic CME futures):**
1. The indicator automatically detects forex pairs and uses CME futures volume
2. Trade during active sessions only (use session filter)
3. Focus on quick profits (10-20 pips)
4. Exit at opposite signal or profit target
**Commodities Trading Strategy (Gold, Silver, Oil):**
1. The indicator automatically maps to COMEX and NYMEX futures contracts
2. Trade during high-liquidity sessions (overlap of major markets)
3. Use the high volume confirmation to identify institutional entry points
4. Combine with key support and resistance levels for entries
5. Monitor the information table to confirm futures volume is being used (orange color)
6. Exit on opposite MACD signal or at predefined profit targets
## Why This Combination Works
### The Volume Advantage
Studies consistently show that price movements accompanied by high volume are more likely to continue, while low-volume movements often reverse. This indicator leverages this principle by requiring volume confirmation.
**Key benefits:**
1. **Reduced False Signals:** Eliminates MACD whipsaws during low-volume consolidation
2. **Confirmation Bias:** Two independent indicators (price momentum + volume) agreeing
3. **Institutional Alignment:** High volume often indicates institutional participation
4. **Trend Validation:** Volume confirms that price momentum has "conviction"
### Statistical Edge
By combining two uncorrelated signals (MACD crossovers and volume spikes), the indicator creates a higher-probability setup than either signal alone. The lookback mechanism ensures signals aren't missed if volume spike slightly precedes the MACD cross.
## Supported Exchanges and Automatic Detection
The indicator includes intelligent asset detection that works across multiple exchanges and ticker formats:
**Forex Exchanges (Automatic CME Mapping):**
- FX (TradingView forex feed)
- OANDA
- FXCM
- SAXO
- FOREXCOM
- PEPPERSTONE
- EASYMARKETS
- FX_IDC
**Commodity Exchanges (Automatic COMEX/NYMEX Mapping):**
- TVC (TradingView commodity feed)
- COMEX (directly)
- NYMEX (directly)
- ICEUS
**Other Asset Classes (Native Volume):**
- Stock exchanges (NASDAQ, NYSE, AMEX, etc.)
- Cryptocurrency exchanges (BINANCE, COINBASE, KRAKEN, etc.)
- Index providers (SP, DJ, etc.)
The detection algorithm analyzes three factors:
1. Exchange prefix in the ticker symbol
2. Pattern matching for currency pairs (6-letter codes)
3. Commodity identifiers in the symbol name
This ensures accurate automatic detection regardless of which data feed or exchange you use for charting. The information table in the top-right corner always displays which volume source is being used, providing complete transparency.
## Technical Details
**Calculations:**
- MACD Fast MA: EMA(close, fastLength)
- MACD Slow MA: EMA(close, slowLength)
- MACD Line: Fast MA - Slow MA
- Signal Line: SMA(MACD Line, signalLength)
- Volume MA: Exponential MA of volume
- High Volume: Current volume >= Volume MA × Ratio
**Signal logic:**
```
Buy Signal = (MACD crosses above Signal) AND (High volume in last N bars)
Sell Signal = (MACD crosses below Signal) AND (High volume in last N bars)
```
## Parameters Reference
| Parameter | Default | Description |
|-----------|---------|-------------|
| Volume Symbol | Blank | Manual override for volume source (leave blank for automatic detection) |
| Use CME Futures | False | Legacy option (automatic detection is now built-in) |
| Alert Session | 1530-2200 | Active session time range for alerts |
| Timezone | UTC+1 | Timezone for alert sessions |
| Volume MA Period | 20 | Number of periods for volume moving average |
| High Volume Ratio | 2.0 | Volume threshold multiplier (2.0 = 200% of average) |
| Volume Lookback | 5 | Number of bars to check for high volume confirmation |
| MACD Fast Length | 12 | Fast EMA period for MACD calculation |
| MACD Slow Length | 26 | Slow EMA period for MACD calculation |
| MACD Signal Length | 9 | Signal line SMA period |
| Only Buy | False | Filter to show only bullish signals |
| Only Sell | False | Filter to show only bearish signals |
| Show Signals | True | Display buy and sell labels on chart |
## Optimization Tips
**For volatile markets (crypto, small caps):**
- Increase High Volume Ratio to 2.5-3.0
- Reduce Volume Lookback to 3-4 bars
- Consider faster MACD settings (8, 17, 9)
**For stable markets (large-cap stocks, bonds):**
- Decrease High Volume Ratio to 1.5-1.8
- Increase Volume MA Period to 30-50
- Use standard MACD settings
**For forex (with automatic CME futures):**
- The indicator automatically uses CME futures when forex pairs are detected
- Set appropriate trading session based on your timezone
- Use Volume Lookback of 5-7 bars
- Consider session-based alerts only
- Monitor the information table to verify correct futures mapping
**For commodities (Gold, Silver, Oil, Copper):**
- The indicator automatically maps to COMEX and NYMEX futures
- Increase High Volume Ratio to 2.0-2.5 for metals
- Use slightly higher Volume MA Period (25-30) for smoother analysis
- Trade during active market hours for best volume data
- The information table will show the futures contract being used (orange highlight)
## Limitations and Considerations
**What this indicator does NOT do:**
- Does not predict future price direction
- Does not guarantee profitable trades
- Does not replace proper risk management
- Does not work well in extremely low-volume conditions
**Market conditions to avoid:**
- Pre-market and after-hours sessions (low volume)
- Major news events (volatile, unpredictable volume)
- Holidays and low-liquidity periods
- Extremely low float stocks
## Conclusion
Smart MACD Volume Trader represents a significant evolution of the traditional MACD indicator by combining volume confirmation with automatic institutional volume integration. This dual-confirmation approach significantly improves signal quality by filtering out low-conviction price movements and ensuring traders work with accurate volume data.
The indicator's automatic detection and mapping system supports over 24 instruments across forex, commodities, and metals markets. By intelligently switching to CME and COMEX futures contracts when appropriate, the indicator provides forex and commodity traders with the same quality of volume data that stock traders naturally have access to.
This indicator is particularly valuable for traders who want to:
- Align their entries with institutional money flow
- Avoid getting trapped in false breakouts
- Trade forex pairs with reliable volume data
- Access accurate volume information for gold, silver, and energy commodities
- Combine momentum and volume analysis in a single, streamlined tool
Whether you are day trading stocks, swing trading forex pairs, or positioning in commodities markets, this indicator provides a robust framework for identifying high-probability momentum trades backed by genuine institutional participation. The automatic futures mapping works seamlessly across all supported instruments, requiring no manual configuration or expertise in futures markets.
---
## Support and Updates
This indicator is actively maintained and updated based on user feedback and market conditions. For questions about implementation or custom modifications, please use the comments section below.
**Disclaimer:** This indicator is for educational and informational purposes only. Past performance does not guarantee future results. Always conduct your own analysis and risk management before trading.
RVI with SMA Smoothing and Divergence SignalsThis script enhances the Relative Volatility Index (RVI)—originally introduced by Donald Dorsey in 1993—by integrating three complementary analytical features:
1. SMA-based smoothing of the RVI line to reduce noise and clarify the underlying volatility momentum trend.
2. Automated detection of regular and hidden divergences between price action (highs/lows) and RVI pivots, using robust `ta.pivotlow` and `ta.pivothigh` logic with configurable lookback and search ranges.
3. Visual labels ("R" for regular, "H" for hidden) and color-coded pivot markers to help traders quickly identify potential reversal or continuation zones.
Unlike basic RVI implementations, this version is designed to highlight momentum-price decoupling, a key concept in technical analysis. The divergence engine is synchronized with RVI’s unique 0–100 scale and volatility-based calculation, ensuring signals are contextually relevant—not generic overlays.
How it works:
- RVI is computed using standard deviation of directional price changes, normalized to 0–100.
- A user-defined SMA (default: 14 periods) smooths the RVI for trend clarity.
- Divergences are confirmed only when both a valid price pivot and a corresponding RVI pivot occur within a configurable bar range (default: 5–60 bars).
- Hidden bearish divergences are disabled by default to reduce noise on short-term charts.
Suggested use:
- Regular bullish divergences near the 20 (oversold) level may signal exhaustion of a downtrend.
- Regular bearish divergences above 80 (overbought) can warn of upward momentum loss.
- Combine with price structure (support/resistance) for higher-probability setups.
This script is **not a simple mashup**: the integration of divergence logic with RVI’s volatility-based nature, parameterized sensitivity controls, and clean visualization provides a cohesive analytical tool not found in standard indicators.
> Disclaimer: This script is for educational and informational purposes only. It does not constitute financial, investment, or trading advice. Past performance is not indicative of future results.
—
Créditos:
- RVI concept: Donald Dorsey (1993)
- Divergence methodology: Standard technical analysis practice
- Implementation and enhancements: © Carlos Mauricio Vizcarra (2025)
- Licensed under MPL 2.0
Relative Vigor Index with Divergence and SMA FilterThis script implements the Relative Vigor Index (RVI), originally developed by John Ehlers, enhanced with three practical analytical layers:
1. Configurable SMA filter applied to the RVI line (default: 14 periods) to smooth noise and clarify the underlying momentum trend.
2. Automated divergence detection between price action and the RVI oscillator, identifying both:
- Regular divergences ("R"): potential reversal signals (e.g., price makes a lower low while RVI makes a higher low).
- Hidden divergences ("H"): potential continuation signals (e.g., price makes a higher low while RVI makes a lower low).
3.Visual aids: labeled markers ("R"/"H") and connecting lines to make divergence patterns immediately recognizable.
Unlike basic RVI implementations, this version is designed to highlight momentum-price decoupling—a core concept in technical analysis—using robust pivot detection (`ta.pivotlow`/`ta.pivothigh`) with user-defined lookback and search ranges (default: 5–60 bars). The SMA filter helps traders distinguish between genuine momentum shifts and short-term volatility.
How it works:
- The RVI is calculated as the ratio of smoothed (close – open) to smoothed (high – low), reflecting the idea that in uptrends, closes tend to occur near highs, and in downtrends, near lows.
- Divergences are confirmed only when both a valid price pivot and a corresponding RVI pivot occur within the specified bar range.
- Hidden bearish divergences are disabled by default to reduce noise on shorter timeframes.
Suggested use:
- Use regular bullish divergences near negative RVI extremes as potential long setups.
- Watch for regular bearish divergences at positive RVI peaks as early reversal warnings.
- Combine with support/resistance or trend structure for higher-confidence entries.
This script is not a simple mashup: the integration of divergence logic with the RVI’s unique behavior, configurable sensitivity, and clean visualization provides a cohesive analytical tool that goes beyond standard implementations.
> Disclaimer: This script is for educational and informational purposes only. It does not constitute financial, investment, or trading advice. Past performance is not indicative of future results.
—
Credits:
- Relative Vigor Index concept: John Ehlers
- Divergence methodology: Standard technical analysis practice
- Implementation and enhancements: © Carlos Mauricio Vizcarra (2025)
- Licensed under MPL 2.0
RSI FlipIndicator Description: RSI Flip (30/70 Threshold)
This indicator uses a 7-period Relative Strength Index (RSI) to detect potential market reversals based on classic momentum thresholds:
- RSI < 30 → triggers a Long Deal Signal (1) indicating potential bullish reversal.
- RSI > 70 → triggers a Short Deal Signal (2) indicating potential bearish reversal.
🔧 Features:
- Backtest-compatible output: Hidden plots emit 1 for long and 2 for short, enabling seamless integration with strategy scripts.
- Bias tracking: Internal bias state updates on each trigger, allowing for modular lifecycle logic.
- Background tinting ready: The bias variable can be used to drive visual overlays or downstream automation.
🧩 Integration Notes:
- Designed for symbol-specific use — no external feeds or dependencies.
- Ideal for modular signal stacking, lifecycle-safe deal initiation, or audit-grade strategy mapping.
vagab0nd AlgoCombination of simple and exponential moving averages, SuperIchi cloud by LuxAlgo (love that group!), and a conglomeration of various indicators I've compiled over the years to try to spot tops and bottoms.
My custom indicator will highlight the background either green or orange/red and will show small yellow, or larger white arrows to indicate potential tops and bottoms. It is oscillator based so it can often show a strong signal for a top or bottom where price can rebound from, but will often retest or even stop loss run the previous signal area while not showing another signal. This indicates an underlying divergence that can potentially be taken advantage of.
Quantum Market Harmonics [QMH]# Quantum Market Harmonics - TradingView Script Description
## 📊 OVERVIEW
Quantum Market Harmonics (QMH) is a comprehensive multi-dimensional trading indicator that combines four independent analytical frameworks to generate high-probability trading signals with quantifiable confidence scores. Unlike simple indicator combinations that display multiple tools side-by-side, QMH synthesizes temporal analysis, inter-market correlations, behavioral psychology, and statistical probabilities into a unified confidence scoring system that requires agreement across all dimensions before generating a confirmed signal.
---
## 🎯 WHAT MAKES THIS SCRIPT ORIGINAL
### The Core Innovation: Weighted Confidence Scoring
Most indicators provide binary signals (buy/sell) or display multiple indicators separately, leaving traders to interpret conflicting information. QMH's originality lies in its weighted confidence scoring system that:
1. **Combines Four Independent Methods** - Each framework (described below) operates independently and contributes points to an overall confidence score
2. **Requires Multi-Dimensional Agreement** - Signals only fire when multiple frameworks align, dramatically reducing false positives
3. **Quantifies Signal Strength** - Every signal includes a numerical confidence rating (0-100%), allowing traders to filter by quality
4. **Adapts to Market Conditions** - Different market regimes activate different component combinations
### Why This Combination is Useful
Traditional approaches suffer from:
- **Single-dimension bias**: RSI shows oversold, but trend is still down
- **Conflicting signals**: MACD says buy, but volume is weak
- **No prioritization**: All signals treated equally regardless of strength
QMH solves these problems by requiring multiple independent confirmations and weighting each component's contribution to the final signal. This multi-dimensional approach mirrors how professional traders analyze markets - not relying on one indicator, but waiting for multiple pieces of evidence to align.
---
## 🔬 THE FOUR ANALYTICAL FRAMEWORKS
### 1. Temporal Fractal Resonance (TFR)
**What It Does:**
Analyzes trend alignment across four different timeframes simultaneously (15-minute, 1-hour, 4-hour, and daily) to identify periods of multi-timeframe synchronization.
**How It Works:**
- Uses `request.security()` with `lookahead=barmerge.lookahead_off` to retrieve confirmed price data from each timeframe
- Calculates "fractal strength" for each timeframe using this formula:
```
Fractal Strength = (Rate of Change / Standard Deviation) × 100
```
This creates a momentum-to-volatility ratio that measures trend strength relative to noise
- Computes a Resonance Index when all four timeframes show the same directional bias
- The index averages the absolute strength values when all timeframes align
**Why This Method:**
Fractal Market Hypothesis suggests that price patterns repeat across different time scales. When trends align from short-term (15m) to long-term (Daily), the probability of trend continuation increases substantially. The momentum/volatility ratio filters out low-conviction moves where volatility dominates direction.
**Contribution to Confidence Score:**
- TFR Bullish = +25 points
- TFR Bearish = +25 points (to bearish confidence)
- No alignment = 0 points
---
### 2. Cross-Asset Quantum Entanglement (CAQE)
**What It Does:**
Analyzes correlation patterns between the current asset and three reference markets (Bitcoin, US Dollar Index, and Volatility Index) to identify both normal correlation behavior and anomalous breakdowns that often precede significant moves.
**How It Works:**
- Retrieves price data from BTC (BINANCE:BTCUSDT), DXY (TVC:DXY), and VIX (TVC:VIX) using confirmed bars
- Calculates Pearson correlation coefficient between the main asset and each reference:
```
Correlation = Covariance(X,Y) / (StdDev(X) × StdDev(Y))
```
- Computes an Intermarket Pressure Index by weighting each reference asset's momentum by its correlation strength:
```
Pressure = (Corr₁ × ROC₁ + Corr₂ × ROC₂ + Corr₃ × ROC₃) / 3
```
- Detects "correlation breakdowns" when average correlation drops below 0.3
**Why This Method:**
Markets don't operate in isolation. Inter-market analysis (developed by John Murphy) recognizes that:
- Crypto assets often correlate with Bitcoin
- Risk assets inversely correlate with VIX (fear gauge)
- Dollar strength affects commodity and crypto prices
When these normal correlations break down, it signals potential regime changes. The term "quantum" reflects the interconnected nature of these relationships - like quantum entanglement where distant particles influence each other.
**Contribution to Confidence Score:**
- CAQE Bullish (positive pressure, stable correlations) = +25 points
- CAQE Bearish (negative pressure, stable correlations) = +25 points (to bearish)
- Correlation breakdown = Warning marker (potential reversal zone)
---
### 3. Adaptive Market Psychology Matrix (AMPM)
**What It Does:**
Classifies the current market emotional state into six distinct categories by analyzing the interaction between momentum (RSI), volume behavior, and volatility acceleration (ATR change).
**How It Works:**
The system evaluates three metrics:
1. **RSI (14-period)**: Measures overbought/oversold conditions
2. **Volume Analysis**: Compares current volume to 20-period average
3. **ATR Rate of Change**: Detects volatility acceleration
Based on these inputs, the market is classified into:
- **Euphoria**: RSI > 80, volume spike present, volatility rising (extreme bullish emotion)
- **Greed**: RSI > 70, normal volume (moderate bullish emotion)
- **Neutral**: RSI 40-60, declining volatility (balanced state)
- **Fear**: RSI 40-60, low volatility (uncertainty without panic)
- **Panic**: RSI < 30, volume spike present, volatility rising (extreme bearish emotion)
- **Despair**: RSI < 20, normal volume (capitulation phase)
**Why This Method:**
Behavioral finance principles (Kahneman, Tversky) show that markets follow predictable emotional cycles. Extreme psychological states often mark reversal points because:
- At Euphoria/Greed peaks, everyone bullish has already bought (no buyers left)
- At Panic/Despair bottoms, everyone bearish has already sold (no sellers left)
AMPM provides contrarian signals at these extremes while respecting trends during Fear and Greed intermediate states.
**Contribution to Confidence Score:**
- Psychology Bullish (Panic/Despair + RSI < 35) = +15 points
- Psychology Bearish (Euphoria/Greed + RSI > 65) = +15 points
- Neutral states = 0 points
---
### 4. Time-Decay Probability Zones (TDPZ)
**What It Does:**
Creates dynamic support and resistance zones based on statistical probability distributions that adapt to changing market volatility, similar to Bollinger Bands but with enhancements for trend environments.
**How It Works:**
- Calculates a 20-period Simple Moving Average as the basis line
- Computes standard deviation of price over the same period
- Creates four probability zones:
- **Extreme Upper**: Basis + 2.5 standard deviations (≈99% probability boundary)
- **Upper Zone**: Basis + 1.5 standard deviations
- **Lower Zone**: Basis - 1.5 standard deviations
- **Extreme Lower**: Basis - 2.5 standard deviations (≈99% probability boundary)
- Dynamically adjusts zone width based on ATR (Average True Range):
```
Adjusted Upper = Upper Zone + (ATR × adjustment_factor)
Adjusted Lower = Lower Zone - (ATR × adjustment_factor)
```
- The adjustment factor increases during high volatility, widening the zones
**Why This Method:**
Traditional support/resistance levels are static and don't account for volatility regimes. TDPZ zones are probability-based and mean-reverting:
- Price has ≈99% probability of staying within extreme zones in normal conditions
- Touches to extreme zones represent statistical outliers (high-probability reversal opportunities)
- Zone expansion/contraction reflects volatility regime changes
- ATR adjustment prevents false signals during unusual volatility
The "time-decay" concept refers to mean reversion - the further price moves from the basis, the higher the probability of eventual return.
**Contribution to Confidence Score:**
- Price in Lower Extreme Zone = +15 points (bullish reversal probability)
- Price in Upper Extreme Zone = +15 points (bearish reversal probability)
- Price near basis = 0 points
---
## 🎯 HOW THE CONFIDENCE SCORING SYSTEM WORKS
### Signal Generation Formula
QMH calculates separate Bullish and Bearish confidence scores each bar:
**Bullish Confidence (0-100%):**
```
Base Score: 20 points
+ TFR Bullish: 25 points (if all 4 timeframes aligned bullish)
+ CAQE Bullish: 25 points (if intermarket pressure positive)
+ AMPM Bullish: 15 points (if Panic/Despair contrarian signal)
+ TDPZ Bullish: 15 points (if price in lower probability zones)
─────────
Maximum Possible: 100 points
```
**Bearish Confidence (0-100%):**
```
Base Score: 20 points
+ TFR Bearish: 25 points (if all 4 timeframes aligned bearish)
+ CAQE Bearish: 25 points (if intermarket pressure negative)
+ AMPM Bearish: 15 points (if Euphoria/Greed contrarian signal)
+ TDPZ Bearish: 15 points (if price in upper probability zones)
─────────
Maximum Possible: 100 points
```
### Confirmed Signal Requirements
A **QBUY** (Quantum Buy) signal generates when:
1. Bullish Confidence ≥ User-defined threshold (default 60%)
2. Bullish Confidence > Bearish Confidence
3. No active sell signal present
A **QSELL** (Quantum Sell) signal generates when:
1. Bearish Confidence ≥ User-defined threshold (default 60%)
2. Bearish Confidence > Bullish Confidence
3. No active buy signal present
### Why This Approach Is Different
**Example Comparison:**
Traditional RSI Strategy:
- RSI < 30 → Buy signal
- Result: May buy into falling knife if trend remains bearish
QMH Approach:
- RSI < 30 → Psychology shows Panic (+15 points)
- But requires additional confirmation:
- Are all timeframes also showing bullish reversal? (+25 points)
- Is intermarket pressure turning positive? (+25 points)
- Is price at a statistical extreme? (+15 points)
- Only when total ≥ 60 points does a QBUY signal fire
This multi-layer confirmation dramatically reduces false signals while maintaining sensitivity to genuine opportunities.
---
## 🚫 NO REPAINT GUARANTEE
**QMH is designed to be 100% repaint-free**, which is critical for honest backtesting and reliable live trading.
### Technical Implementation:
1. **All Multi-Timeframe Data Uses Confirmed Bars**
```pinescript
tf1_close = request.security(syminfo.tickerid, "15", close , lookahead=barmerge.lookahead_off)
```
Using `close ` instead of `close ` ensures we only reference the previous confirmed bar, not the current forming bar.
2. **Lookahead Prevention**
```pinescript
lookahead=barmerge.lookahead_off
```
This parameter prevents the function from accessing future data that wouldn't be available in real-time.
3. **Signal Timing**
Signals appear on the bar AFTER all conditions are met, not retroactively on the bar where conditions first appeared.
### What This Means for Users:
- **Backtest Accuracy**: Historical signals match exactly what you would have seen in real-time
- **No Disappearing Signals**: Once a signal appears, it stays (though price may move against it)
- **Honest Performance**: Results reflect true predictive power, not hindsight optimization
- **Live Trading Reliability**: Alerts fire at the same time signals appear on the chart
The dashboard displays "✓ NO REPAINT" to confirm this guarantee.
---
## 📖 HOW TO USE THIS INDICATOR
### Basic Trading Strategy
**For Trend Followers:**
1. **Wait for Signal Confirmation**
- QBUY label appears below a bar = Confirmed bullish entry opportunity
- QSELL label appears above a bar = Confirmed bearish entry opportunity
2. **Check Confidence Score**
- 60-70%: Moderate confidence (consider smaller position size)
- 70-85%: High confidence (standard position size)
- 85-100%: Very high confidence (consider larger position size)
3. **Enter Trade**
- Long entry: Market or limit order near signal bar
- Short entry: Market or limit order near signal bar
4. **Set Targets Using Probability Zones**
- Long trades: Target the adjusted upper zone (lime line)
- Short trades: Target the adjusted lower zone (red line)
- Alternatively, target the basis line (yellow) for conservative exits
5. **Set Stop Loss**
- Long trades: Below recent swing low minus 1 ATR
- Short trades: Above recent swing high plus 1 ATR
**For Mean Reversion Traders:**
1. **Wait for Extreme Zones**
- Price touches extreme lower zone (dotted red line below)
- Price touches extreme upper zone (dotted lime line above)
2. **Confirm with Psychology**
- At lower extreme: Look for Panic or Despair state
- At upper extreme: Look for Euphoria or Greed state
3. **Wait for Confidence Build**
- Monitor dashboard until confidence exceeds threshold
- Requires patience - extreme touches don't always reverse immediately
4. **Enter Reversal**
- Target: Return to basis line (yellow SMA 20)
- Stop: Beyond the extreme zone
**For Position Traders (Longer Timeframes):**
1. **Use Daily Timeframe**
- Set chart to daily for longer-term signals
- Signals will be less frequent but higher quality
2. **Require High Confidence**
- Filter setting: Min Confidence Score 80%+
- Only take the strongest multi-dimensional setups
3. **Confirm with Resonance Background**
- Green tinted background = All timeframes bullish aligned
- Red tinted background = All timeframes bearish aligned
- Only enter when background tint matches signal direction
4. **Hold for Major Targets**
- Long trades: Hold until extreme upper zone or opposite signal
- Short trades: Hold until extreme lower zone or opposite signal
---
## 📊 DASHBOARD INTERPRETATION
The QMH Dashboard (top-right corner) provides real-time market analysis across all four dimensions:
### Dashboard Elements:
1. **✓ NO REPAINT**
- Green confirmation that signals don't repaint
- Always visible to remind users of signal integrity
2. **SIGNAL: BULL/BEAR XX%**
- Shows dominant direction (whichever confidence is higher)
- Displays current confidence percentage
- Background color intensity reflects confidence level
3. **Psychology: **
- Current market emotional state
- Color coded:
- Orange = Euphoria (extreme bullish emotion)
- Yellow = Greed (moderate bullish emotion)
- Gray = Neutral (balanced state)
- Purple = Fear (uncertainty)
- Red = Panic (extreme bearish emotion)
- Dark red = Despair (capitulation)
4. **Resonance: **
- Multi-timeframe alignment strength
- Positive = All timeframes bullish aligned
- Negative = All timeframes bearish aligned
- Near zero = Timeframes not synchronized
- Emoji indicator: 🔥 (bullish resonance) ❄️ (bearish resonance)
5. **Intermarket: **
- Cross-asset pressure measurement
- Positive = BTC/DXY/VIX correlations supporting upside
- Negative = Correlations supporting downside
- Warning ⚠️ if correlation breakdown detected
6. **RSI: **
- Current RSI(14) reading
- Background colors: Red (>70 overbought), Green (<30 oversold)
- Status: OB (overbought), OS (oversold), or • (neutral)
7. **Status: READY BUY / READY SELL / WAIT**
- Quick trade readiness indicator
- READY BUY: Confidence ≥ threshold, bias bullish
- READY SELL: Confidence ≥ threshold, bias bearish
- WAIT: Confidence below threshold
### How to Use Dashboard:
**Before Entering a Trade:**
- Verify Status shows READY (not WAIT)
- Check that Resonance matches signal direction
- Confirm Psychology isn't contradicting (e.g., buying during Euphoria)
- Note Intermarket value - breakdowns (⚠️) suggest caution
**During a Trade:**
- Monitor Psychology shifts (e.g., from Fear to Greed in a long)
- Watch for Resonance changes that could signal exit
- Check for Intermarket breakdown warnings
---
## ⚙️ CUSTOMIZATION SETTINGS
### TFR Settings (Temporal Fractal Resonance)
- **Enable/Disable**: Turn TFR analysis on/off
- **Fractal Sensitivity** (5-50, default 14):
- Lower values = More responsive to short-term changes
- Higher values = More stable, slower to react
- Recommendation: 14 for balanced, 7 for scalping, 21 for position trading
### CAQE Settings (Cross-Asset Quantum Entanglement)
- **Enable/Disable**: Turn CAQE analysis on/off
- **Asset 1** (default BTC): Reference asset for correlation analysis
- **Asset 2** (default DXY): Second reference asset
- **Asset 3** (default VIX): Third reference asset
- **Correlation Length** (10-100, default 20):
- Lower values = More sensitive to recent correlation changes
- Higher values = More stable correlation measurements
- Recommendation: 20 for most assets, 50 for less volatile markets
### Psychology Settings (Adaptive Market Psychology Matrix)
- **Enable/Disable**: Turn AMPM analysis on/off
- **Volume Spike Threshold** (1.0-5.0x, default 2.0):
- Lower values = Detect smaller volume increases as spikes
- Higher values = Only flag major volume surges
- Recommendation: 2.0 for stocks, 1.5 for crypto
### Probability Settings (Time-Decay Probability Zones)
- **Enable/Disable**: Turn TDPZ visualization on/off
- **Probability Lookback** (20-200, default 50):
- Lower values = Zones adapt faster to recent price action
- Higher values = Zones based on longer statistical history
- Recommendation: 50 for most uses, 100 for position trading
### Filter Settings
- **Min Confidence Score** (40-95%, default 60%):
- Lower threshold = More signals, more false positives
- Higher threshold = Fewer signals, higher quality
- Recommendation: 60% for active trading, 75% for selective trading
### Visual Settings
- **Show Entry Signals**: Toggle QBUY/QSELL labels on chart
- **Show Probability Zones**: Toggle zone visualization
- **Show Psychology State**: Toggle dashboard display
---
## 🔔 ALERT CONFIGURATION
QMH includes four alert conditions that can be configured via TradingView's alert system:
### Available Alerts:
1. **Quantum Buy Signal**
- Fires when: Confirmed QBUY signal generates
- Message includes: Confidence percentage
- Use for: Entry notifications
2. **Quantum Sell Signal**
- Fires when: Confirmed QSELL signal generates
- Message includes: Confidence percentage
- Use for: Entry notifications or exit warnings
3. **Market Panic**
- Fires when: Psychology state reaches Panic
- Use for: Contrarian opportunity alerts
4. **Market Euphoria**
- Fires when: Psychology state reaches Euphoria
- Use for: Reversal warning alerts
### How to Set Alerts:
1. Right-click on chart → "Add Alert"
2. Condition: Select "Quantum Market Harmonics"
3. Choose alert type from dropdown
4. Configure expiration, frequency, and notification method
5. Create alert
**Recommendation**: Set alerts for Quantum Buy/Sell signals with "Once Per Bar Close" frequency to avoid intra-bar false triggers.
---
## 💡 BEST PRACTICES
### For All Users:
1. **Backtest First**
- Test on your specific market and timeframe before live trading
- Different assets may perform better with different confidence thresholds
- Verify that the No Repaint guarantee works as described
2. **Paper Trade**
- Practice with signals on a demo account first
- Understand typical signal frequency for your timeframe
- Get comfortable with the dashboard interpretation
3. **Risk Management**
- Never risk more than 1-2% of capital per trade
- Use proper stop losses (not just mental stops)
- Position size based on confidence score (larger size at higher confidence)
4. **Consider Context**
- QMH signals work best in clear trends or at extremes
- During tight consolidation, false signals increase
- Major news events can invalidate technical signals
### Optimal Use Cases:
**QMH Works Best When:**
- ✅ Markets are trending (up or down)
- ✅ Volatility is normal to elevated
- ✅ Price reaches probability zone extremes
- ✅ Multiple timeframes align
- ✅ Clear inter-market relationships exist
**QMH Is Less Effective When:**
- ❌ Extremely low volatility (zones contract too much)
- ❌ Sideways choppy markets (conflicting timeframes)
- ❌ Flash crashes or news events (correlations break down)
- ❌ Very illiquid assets (irregular price action)
### Session Considerations:
- **24/7 Markets (Crypto)**: Works on all sessions, but signals may be more reliable during high-volume periods (US/European trading hours)
- **Forex**: Best during London/New York overlap when volume is highest
- **Stocks**: Most reliable during regular trading hours (not pre-market/after-hours)
---
## ⚠️ LIMITATIONS AND RISKS
### This Indicator Cannot:
- **Predict Black Swan Events**: Sudden unexpected events invalidate technical analysis
- **Guarantee Profits**: No indicator is 100% accurate; losses will occur
- **Replace Risk Management**: Always use stop losses and proper position sizing
- **Account for Fundamental Changes**: Company news, economic data, etc. can override technical signals
- **Work in All Market Conditions**: Less effective during extreme low volatility or major news events
### Known Limitations:
1. **Multi-Timeframe Lag**: Uses confirmed bars (`close `), so signals appear one bar after conditions met
2. **Correlation Dependency**: CAQE requires sufficient history; may be less reliable on newly listed assets
3. **Computational Load**: Multiple `request.security()` calls may cause slower performance on older devices
4. **Repaint of Dashboard**: Dashboard updates every bar (by design), but signals themselves don't repaint
### Risk Warnings:
- Past performance doesn't guarantee future results
- Backtesting results may not reflect actual trading results due to slippage, commissions, and execution delays
- Different markets and timeframes may produce different results
- The indicator should be used as a tool, not as a standalone trading system
- Always combine with your own analysis, risk management, and trading plan
---
## 🎓 EDUCATIONAL CONCEPTS
This indicator synthesizes several established financial theories and technical analysis concepts:
### Academic Foundations:
1. **Fractal Market Hypothesis** (Edgar Peters)
- Markets exhibit self-similar patterns across time scales
- Implemented via multi-timeframe resonance analysis
2. **Behavioral Finance** (Kahneman & Tversky)
- Investor psychology drives market inefficiencies
- Implemented via market psychology state classification
3. **Intermarket Analysis** (John Murphy)
- Asset classes correlate and influence each other predictably
- Implemented via cross-asset correlation monitoring
4. **Mean Reversion** (Statistical Arbitrage)
- Prices tend to revert to statistical norms
- Implemented via probability zones and standard deviation bands
5. **Multi-Timeframe Analysis** (Technical Analysis Standard)
- Higher timeframe trends dominate lower timeframe noise
- Implemented via fractal resonance scoring
### Learning Resources:
To better understand the concepts behind QMH:
- Read "Intermarket Analysis" by John Murphy (for CAQE concepts)
- Study "Thinking, Fast and Slow" by Daniel Kahneman (for psychology concepts)
- Review "Fractal Market Analysis" by Edgar Peters (for TFR concepts)
- Learn about Bollinger Bands (for TDPZ foundation)
---
## 🔄 VERSION HISTORY AND UPDATES
**Current Version: 1.0**
This is the initial public release. Future updates will be published using TradingView's Update feature (not as separate publications). Planned improvements may include:
- Additional reference assets for CAQE
- Optional machine learning-based weight optimization
- Customizable psychology state definitions
- Alternative probability zone calculations
- Performance metrics tracking
Check the "Updates" tab on the script page for version history.
---
## 📞 SUPPORT AND FEEDBACK
### How to Get Help:
1. **Read This Description First**: Most questions are answered in the detailed sections above
2. **Check Comments**: Other users may have asked similar questions
3. **Post Comments**: For general questions visible to the community
4. **Use TradingView Messaging**: For private inquiries (if available)
### Providing Useful Feedback:
When reporting issues or suggesting improvements:
- Specify your asset, timeframe, and settings
- Include a screenshot if relevant
- Describe expected vs. actual behavior
- Check if issue persists with default settings
### Continuous Improvement:
This indicator will evolve based on user feedback and market testing. Constructive suggestions for improvements are always welcome.
---
## ⚖️ DISCLAIMER
This indicator is provided for **educational and informational purposes only**. It does **not constitute financial advice, investment advice, trading advice, or any other type of advice**.
**Important Disclaimers:**
- You should **not** rely solely on this indicator to make trading decisions
- Always conduct your own research and due diligence
- Past performance is not indicative of future results
- Trading and investing involve substantial risk of loss
- Only trade with capital you can afford to lose
- Consider consulting with a licensed financial advisor before trading
- The author is not responsible for any trading losses incurred using this indicator
**By using this indicator, you acknowledge:**
- You understand the risks of trading
- You take full responsibility for your trading decisions
- You will use proper risk management techniques
- You will not hold the author liable for any losses
---
## 🙏 ACKNOWLEDGMENTS
This indicator builds upon the collective knowledge of the technical analysis and trading community. While the specific implementation and combination are original, the underlying concepts draw from:
- The Pine Script community on TradingView
- Academic research in behavioral finance and market microstructure
- Classical technical analysis methods developed over decades
- Open-source indicators that demonstrate best practices in Pine Script coding
Special thanks to TradingView for providing the platform and Pine Script language that make indicators like this possible.
---
## 📚 ADDITIONAL RESOURCES
**Pine Script Documentation:**
- Official Pine Script Manual: www.tradingview.com
**Related Concepts to Study:**
- Multi-timeframe analysis techniques
- Correlation analysis in financial markets
- Behavioral finance principles
- Mean reversion strategies
- Bollinger Bands methodology
**Recommended TradingView Tools:**
- Strategy Tester: To backtest signal performance
- Bar Replay: To see how signals develop in real-time
- Alert System: To receive notifications of new signals
---
**Thank you for using Quantum Market Harmonics. Trade safely and responsibly.**
TRI - RSI & StochRSI Multi-TimeframeThis indicator displays RSI and Stochastic RSI values across multiple timeframes
in a clear, color-coded table format.
FEATURES:
Monitors 7 timeframes: 1m, 5m, 15m, 1h, 4h, 1D, 1W
Color-coded cells: Green (oversold), Red (overbought), Orange/Blue (neutral)
Direction indicators for RSI trend
StochRSI K/D comparison indicators
Customizable oversold/overbought levels
Configurable table position and size
ALERTS:
RSI entering oversold/overbought zones
StochRSI entering oversold/overbought zones
StochRSI K/D crossovers (bullish and bearish)
BETA: Reversal confluence signalThis script is designed to accurately identify swing and scalp reversals.
A momentum styled signal indicator designed to give the user an edge over market direction and increase their trading profitability.
The indicator has a very high accuracy on the 1h time frame for momentum reversals.
TRI - RSI Overlay ViewerDESCRIPTION:
Advanced RSI and Stochastic RSI indicator with visual signals on price chart.
Combines RSI momentum analysis with Stochastic RSI oversold/overbought detection.
FEATURES:
RSI with customizable smoothing (EMA)
Stochastic RSI with K and D lines
Background coloring for oversold/overbought zones
Visual shape signals for key crossover events
Alert system for all signal types
SIGNALS:
Small Circle (Green): StochRSI crosses above oversold threshold
Small Circle (Red): StochRSI crosses below overbought threshold
Triangle Up (Green): RSI crosses above oversold threshold (stronger signal)
Triangle Down (Red): RSI crosses below overbought threshold (stronger signal)
STRATEGY USAGE:
Triangle signals = Primary entry/exit signals (RSI confirmation)
Circle signals = Early warning signals (StochRSI only)
Use higher timeframes for trend confirmation
Combine with price action and support/resistance levels
🔍 Kernel Market Dynamics🔍 Kernel Market Dynamics Pro - Advanced Distribution Divergence Detection System
OVERVIEW
Kernel Market Dynamics Pro (KMD Pro) is a revolutionary market regime detection system that employs Maximum Mean Discrepancy (MMD) - a cutting-edge statistical technique from machine learning - to identify when market behavior diverges from its recent historical distribution patterns. The system transforms complex statistical divergence analysis into actionable trading signals through kernel density estimation, regime classification algorithms, and multi-dimensional visualization frameworks that reveal hidden market transitions before traditional indicators can detect them.
WHAT MAKES IT ORIGINAL
While conventional indicators measure price or momentum divergence, KMD Pro analyzes distribution divergence - detecting when the statistical properties of market returns fundamentally shift from their baseline state. This approach, borrowed from high-frequency trading and quantitative finance, uses kernel methods to map market data into high-dimensional feature spaces where regime changes become mathematically detectable. The system is the first TradingView implementation to combine MMD with real-time regime visualization, making institutional-grade statistical arbitrage techniques accessible to retail traders.
HOW IT WORKS (Technical Methodology)
1. KERNEL DENSITY ESTIMATION ENGINE
Maximum Mean Discrepancy (MMD) Calculation:
The core innovation - measures distance between probability distributions:
• Maps return distributions to Reproducing Kernel Hilbert Space (RKHS)
• Computes empirical mean embeddings for reference and test windows
• Calculates supremum of mean differences across all RKHS functions
• MMD = ||μ_P - μ_Q||_H where H is the RKHS induced by kernel k
Three Kernel Functions Available:
RBF (Radial Basis Function) Kernel:
• k(x,y) = exp(-||x-y||²/2σ²)
• Gaussian kernel with smooth, infinite-dimensional feature mapping
• Bandwidth σ controls sensitivity (0.5-10.0 user configurable)
• Optimal for normally distributed returns
• Default choice providing balanced sensitivity
Laplacian Kernel:
• k(x,y) = exp(-|x-y|/σ)
• Exponential decay with heavier tails than RBF
• More sensitive to outliers and sudden moves
• Ideal for volatile, news-driven markets
• Faster regime shift detection at cost of more false positives
Cauchy Kernel:
• k(x,y) = 1/(1 + ||x-y||²/σ²)
• Heavy-tailed distribution from statistical physics
• Robust to extreme values and fat-tail events
• Best for cryptocurrency and emerging markets
• Most stable signals with fewer whipsaws
Implementation Details:
• Reference window: 30-300 bars of baseline distribution
• Test window: 10-100 bars of recent distribution
• Double-sum kernel matrix computation with O(m*n) complexity
• EMA smoothing (period 3) reduces noise in raw MMD
• Real-time updates every bar with incremental calculation
2. REGIME DETECTION FRAMEWORK
Three-State Regime Classification:
STABLE Regime (MMD < threshold):
• Market follows historical distribution patterns
• Mean-reverting behavior dominates
• Low probability of breakouts
• Reduced position sizing recommended
• Visual: Subtle background coloring
SHIFTING Regime (threshold < MMD < 2×threshold):
• Distribution divergence detected
• Transition period with directional bias emerging
• Optimal entry zone for trend-following
• Increased volatility expected
• Visual: Yellow/orange zone highlighting
EXTREME Regime (MMD > 2×threshold):
• Severe distribution anomaly
• Black swan or structural break potential
• Maximum caution required
• Consider hedging or exit
• Visual: Red/magenta warning zones
Adaptive Threshold System:
• Base threshold: 0.05-1.0 (default 0.15)
• Volatility adjustment: ±30% based on ATR ratio
• Regime persistence: 20-bar minimum for stability
• Cooldown periods prevent signal clustering
3. DIRECTIONAL BIAS DETERMINATION
Multi-Factor Direction Analysis:
Distribution Mean Comparison:
• Recent mean = SMA(normalized_returns, test_window)
• Reference mean = SMA(normalized_returns, reference_window)
• Direction = sign(recent_mean - reference_mean)
Momentum Confluence:
• Price momentum = close - close
• Volume momentum = volume/SMA(volume, reference_window)
• Weighted composite direction score
Trend Alignment:
• Fast EMA vs Slow EMA positioning
• Slope analysis of regression line
• Multi-timeframe bias confirmation (optional)
4. SIGNAL GENERATION ARCHITECTURE
Entry Signal Logic:
Stage 1 - Regime Shift Detection:
• MMD crosses above threshold
• Sustained for minimum 2 bars
• No signals within cooldown period
Stage 2 - Direction Confirmation:
• Distribution mean aligns with momentum
• Volume ratio > 1.0 (optional)
• Price above/below VWAP (optional)
Stage 3 - Risk Assessment:
• Calculate ATR-based stop distance
• Verify risk/reward ratio > 1.5
• Check for nearby support/resistance
Stage 4 - Signal Generation:
• Long: Regime shift + bullish direction
• Short: Regime shift + bearish direction
• Extreme: MMD > 2×threshold warning
5. PROBABILITY CLOUD VISUALIZATION
Adaptive Confidence Intervals:
• Standard deviation multiplier = 1 + MMD × 3
• Inner band: ±0.5 ATR × multiplier (68% probability)
• Outer band: ±1.0 ATR × multiplier (95% probability)
• Width expands with divergence magnitude
• Real-time adjustment every bar
Interpretation:
• Narrow cloud: Low uncertainty, stable regime
• Wide cloud: High uncertainty, shifting regime
• Asymmetric cloud: Directional bias present
6. MOMENTUM FLOW VECTORS
Three-Style Momentum Visualization:
Flow Arrows:
• Length proportional to momentum strength
• Width indicates confidence (1-3 pixels)
• Angle shows rate of change
• Frequency: Every 5 bars or on events
Gradient Bars:
• Vertical lines from price
• Height = momentum/ATR ratio
• Opacity based on strength
• Continuous flow indication
Momentum Ribbon:
• Envelope around price action
• Expands in momentum direction
• Color intensity shows strength
7. SIGNAL CONNECTION SYSTEM
Relationship Mapping:
• Links consecutive signals with lines
• Solid lines: Same direction (continuation)
• Dotted lines: Opposite direction (reversal)
• Maximum 10 connections maintained
• Distance limit: 100 bars
Purpose:
• Identifies signal clusters
• Shows trend development
• Reveals regime persistence
• Confirms directional bias
8. REGIME ZONE MAPPING
Unified Zone Visualization:
• Main zones: Full regime periods (entry to exit)
• Emphasis zones: Specific trigger points
• Historical memory: Last 20 regime shifts
• Color gradient based on intensity
• Border style indicates zone type
Zone Analytics:
• Duration tracking
• Maximum excursion
• Retest probability
• Support/resistance conversion
9. DYNAMIC RISK MANAGEMENT
ATR-Based Position Sizing:
• Stop loss: 1.0 × ATR from entry
• Target 1: 2.0 × ATR (2R)
• Target 2: 4.0 × ATR (4R)
• Volatility-adjusted scaling
Visual Target System:
• Entry pointer lines
• Target boxes with prices
• Stop boxes with invalidation
• Real-time P&L tracking
10. PROFESSIONAL DASHBOARD
Real-Time Metrics Display:
Primary Metrics:
• Current MMD value and threshold
• Risk level (MMD/threshold ratio)
• Velocity (rate of change)
• Acceleration (second derivative)
Signal Information:
• Active signal type and entry
• Stop loss and targets
• Current P&L percentage
• Bars since signal
Market Metrics:
• Directional bias (BULL/BEAR)
• Confidence percentage
• Win rate statistics
• Signal count tracking
Visual Design:
• Four position options
• Three size modes
• Five color themes
• Gauge visualizations
• Status banners
11. MMD INFO PANEL
Floating Statistics:
• Compact 3×4 table
• MMD vs threshold comparison
• Velocity with direction arrows
• Current bias indication
• Always-visible reference
FIVE COLOR THEMES
Quantum: Cyan/Magenta/Yellow - Modern, high contrast, optimal visibility
Matrix: Green/Red - Classic terminal aesthetic, traditional
Fire: Orange/Gold/Red - Warm spectrum, energetic feel
Aurora: Northern lights palette - Unique, beautiful gradients
Nebula: Deep space colors - Purple/Blue, futuristic
HOW TO USE
Step 1: Select Your Kernel
• RBF for normal markets (stocks, forex majors)
• Laplacian for volatile markets (small-caps, news-driven)
• Cauchy for fat-tail markets (crypto, emerging markets)
Step 2: Configure Bandwidth
• 0.5-2.0: Scalping (high sensitivity)
• 2.0-5.0: Day trading (balanced)
• 5.0-10.0: Swing trading (smooth signals)
Step 3: Set Analysis Windows
• Reference: 3-5× your holding period
• Test: Reference ÷ 3 approximately
• Adjust based on timeframe
Step 4: Calibrate Threshold
• Start with 0.15 default
• Increase if too many signals
• Decrease for earlier detection
Step 5: Enable Visuals
• Probability Cloud for volatility assessment
• Momentum Flow for direction confirmation
• Regime Zones for historical context
• Signal Connections for trend visualization
Step 6: Monitor Dashboard
• Check MMD vs threshold
• Verify regime state
• Confirm directional bias
• Review confidence metrics
Step 7: Execute Signals
• Wait for triangle markers
• Verify regime shift confirmed
• Check risk/reward setup
• Enter at close or next open
Step 8: Manage Position
• Place stop at calculated level
• Scale out at Target 1 (2R)
• Trail remainder to Target 2 (4R)
• Exit if regime reverses
OPTIMIZATION GUIDE
By Market Type:
Forex Majors:
• Kernel: RBF
• Bandwidth: 2.0-3.0
• Windows: 100/30
• Threshold: 0.15
Stock Indices:
• Kernel: RBF
• Bandwidth: 3.0-4.0
• Windows: 150/50
• Threshold: 0.20
Cryptocurrencies:
• Kernel: Cauchy
• Bandwidth: 2.5-3.5
• Windows: 100/30
• Threshold: 0.10-0.15
Commodities:
• Kernel: Laplacian
• Bandwidth: 2.0-3.0
• Windows: 200/60
• Threshold: 0.15-0.25
By Timeframe:
Scalping (1-5m):
• Test Window: 10-20
• Reference: 50-100
• Bandwidth: 1.0-2.0
• Cooldown: 5-10 bars
Day Trading (15m-1H):
• Test Window: 30-50
• Reference: 100-150
• Bandwidth: 2.0-3.0
• Cooldown: 10-20 bars
Swing Trading (4H-Daily):
• Test Window: 50-100
• Reference: 200-300
• Bandwidth: 3.0-5.0
• Cooldown: 20-50 bars
ADVANCED FEATURES
Multi-Timeframe Capability:
• HTF MMD calculation via security()
• Regime alignment across timeframes
• Fractal analysis support
Statistical Arbitrage Mode:
• Pair trading applications
• Spread divergence detection
• Cointegration breaks
Machine Learning Integration:
• Export signals for ML training
• Regime labels for classification
• Feature extraction support
PERFORMANCE METRICS
Computational Complexity:
• MMD calculation: O(m×n) where m,n are window sizes
• Memory usage: O(m+n) for kernel matrices
• Update frequency: Every bar (real-time)
• Optimization: Incremental updates where possible
Typical Signal Frequency:
• Conservative settings: 2-5 signals/week
• Balanced settings: 5-10 signals/week
• Aggressive settings: 10-20 signals/week
Win Rate Expectations:
• Trend following mode: 40-50% wins, 2:1 reward/risk
• Mean reversion mode: 60-70% wins, 1:1 reward/risk
• Depends heavily on market conditions
IMPORTANT DISCLAIMERS
• This indicator detects statistical divergence, not future price direction
• MMD measures distribution distance, not predictive probability
• Past regime shifts do not guarantee future performance
• Kernel methods are descriptive statistics, not AI predictions
• Requires minimum 100 bars historical data for stability
• Performance varies significantly across market conditions
• Not suitable for illiquid or heavily manipulated markets
• Always use proper risk management and position sizing
• Backtest thoroughly on your specific instruments
• This is an analysis tool, not a complete trading system
THEORETICAL FOUNDATION
The Maximum Mean Discrepancy was introduced by Gretton et al. (2012) as a kernel-based statistical test for comparing distributions. In financial markets, we adapt this technique to detect when return distributions shift, indicating potential regime changes. The mathematical rigor of MMD provides a robust, non-parametric approach to identifying market transitions without assuming specific distribution shapes.
SUPPORT & UPDATES
• Questions or configuration help via TradingView messaging
• Bug reports addressed within 48 hours
• Feature requests considered for monthly updates
• Video tutorials available on request
• Join our community for strategy discussions
FINAL NOTES
KMD Pro represents a paradigm shift in technical analysis - moving from price-based indicators to distribution-based detection. By measuring statistical divergence rather than price divergence, the system identifies regime changes that precede traditional breakouts. This anticipatory capability, combined with comprehensive visualization and risk management, provides traders with an institutional-grade toolkit for navigating modern market dynamics.
Remember: The edge comes not from the indicator alone, but from understanding when market distributions diverge from their normal state and positioning accordingly. Use KMD Pro as part of a complete trading strategy that includes fundamental analysis, risk management, and market context.
Volume Heatmap + Buy/Sell splitits the most powerful volume based heatmap you can see on this platform. It tells you when the high volume is coming into the market with clear signs.
Sell - You will see the red bar below the split to confirm its a sell and the strength or the sell you can see above the split line in various colors e.g. lite green (low) to Dark red (extra high).
Buy - If there is a Buying trade being registered, it will appear above the spit line in opaque green with the heatmap colors to show the strength of volume.
This tool will help you identify the volume strength and based on that you can plan your trade.
PS, its always recommended to not to rely on a single oscillator and combine few. I would recommend you to use RSI and S/R lines with this for better decision.
Note, this tool has been put together for educational purposes and I do not take any responsibility of your trade.
NNFX Lite Precision Strategy - Balanced Risk Management🎯 Overview
The NNFX Lite Precision Strategy is a complete trading system designed for consistent, risk-managed trading at 4H timeframe and BTC/USD. It combines simple yet effective technical indicators with professional-grade risk management, including automatic position sizing and multiple take-profit levels.
This strategy is based on the No Nonsense Forex (NNFX) methodology enhanced with modern risk management techniques.
✨ Key Features
🛡️ Professional Risk Management
- Automatic 1% Position Sizing: Every trade risks exactly 1% of your account equity, calculated automatically based on stop loss distance
- Multiple Take-Profit Levels: Scale out at 33%, 50%, and 100% of position at 2 ATR, 3 ATR, and 4.5 ATR respectively
- Trailing Stop Protection: Activates after 2 ATR profit to protect gains while letting winners run
- Average Risk/Reward: 2:1 to 3:1 depending on exit level
- ATR-Based Stops: 1.5× ATR stop loss provides proper breathing room while managing risk
📊 Technical Indicators
- **Baseline**: 21-period EMA for trend direction
- Confirmation 1: SuperTrend (7-period ATR, 2.0 multiplier) for trend validation
- Confirmation 2: 14-period RSI for momentum and overbought/oversold zones
- Volume Filter: Requires 1.4× average volume for quality setups
- Exit Indicator: Multiple TP levels with trailing stop
🎛️ Precision Filters (All Configurable)
1. Trend Strength: Requires 3+ consecutive bars in same SuperTrend direction
2. Momentum Alignment: Baseline and RSI must be rising (long) or falling (short) for 2 bars
3. Volume Confirmation: Entry volume must exceed 1.4× of 20-bar average
4. Cooldown Period: 4-bar minimum between entries to prevent overtrading
5. Optional Filters: Distance from baseline, RSI strength threshold, strong momentum (3-bar)
📈 Entry Conditions
LONG Entry Requirements:
- Price above 21 EMA (current and previous bar)
- SuperTrend GREEN and confirmed for 3+ bars
- RSI between 50-70 (bullish but not overbought)
- EMA and RSI both rising (momentum alignment)
- Volume > 1.4× average
- At least 4 bars since last entry
- No current position
SHORT Entry Requirements:
- Price below 21 EMA (current and previous bar)
- SuperTrend RED and confirmed for 3+ bars
- RSI between 30-50 (bearish but not oversold)
- EMA and RSI both falling (momentum alignment)
- Volume > 1.4× average
- At least 4 bars since last entry
- No current position
🚪 Exit Conditions
Multiple Take-Profit Strategy:
- TP1 (2.0 ATR): Exit 33% of position = 1.33:1 R:R
- TP2(3.0 ATR): Exit 50% of remaining = 2:1 R:R
- TP3 (4.5 ATR): Exit 100% remaining = 3:1 R:R
Trailing Stop:
- Activates after 2 ATR profit
- Trails by 1 ATR offset
- Protects profits while allowing trend continuation
Stop Loss:
- 1.5× ATR from entry
- Risks exactly 1% of account (via automatic position sizing)
Opposite Signal Exit:
- Closes position if opposite direction signal appears (no reversal entry, clean exit only)
⚙️ Customizable Settings
Trading Parameters:
- Enable/Disable Longs and Shorts independently
- Adjustable Risk % (default: 1.0%)
- Entry label display options
Precision Filters (All Optional):
- Trend Strength: Toggle ON/OFF, adjustable bars (1-10)
- Momentum Alignment: Toggle standard or strong (3-bar) momentum
- Volume Filter: Toggle ON/OFF, adjustable multiplier (1.0-3.0×)
- Cooldown: Adjustable bars between entries (0-20)
- Distance Filter: Optional distance requirement from baseline
- RSI Strength: Optional RSI strength threshold for entries
Indicator Parameters:
- Baseline EMA Period (default: 21)
- SuperTrend ATR Period (default: 7)
- SuperTrend Multiplier (default: 2.0)
- RSI Period (default: 14)
- Volume MA Period (default: 20)
- ATR Period for exits (default: 14)
📊 Expected Performance
Balanced Default Settings:
- Trade Frequency: 8-15 trades per month (4H timeframe)
- Win Rate**: 55-70%
- Profit Factor: 2.5-3.5
- Average Win: +2.0% to +3.0%
- Average Loss: Exactly -1.0%
- Risk Consistency: Every trade risks exactly 1%
Note: Performance varies by market, timeframe, and market conditions. Past performance does not guarantee future results.
🕐 Recommended Timeframes
- Daily (1D): Best for swing trading, high-quality signals
- 4-Hour (4H): Optimal balance of frequency and accuracy
💎 Best Use Cases
Ideal For:
✅ Cryptocurrency (BTC, ETH, major alts)
✅ Stock indices (SPX, NDX, DJI)
✅ Individual stocks with good liquidity
✅ Commodities (Gold, Silver, Oil)
Works Best In:
✅ Trending markets
✅ Normal to high volatility
✅ Liquid instruments with tight spreads
✅ Markets with clear directional movement
Less Effective In:
⚠️ Choppy/sideways markets (use filters)
⚠️ Low liquidity instruments
⚠️ During major news events (use cooldown)
⚠️ Extremely low volatility periods
🎓 How to Use
1. Initial Setup:
- Add strategy to chart
- Set initial capital to match your account
- Verify commission settings (default: 0.05%)
- Adjust risk % if desired (default: 1% recommended)
2. Customize Filters:
- **Conservative**: Enable all filters, increase thresholds
- **Balanced** (Default): Standard filter settings
- **Aggressive**: Disable optional filters, lower thresholds
3. Backtest:
- Run on historical data (minimum 2 year)
- Check Strategy Tester results
- Verify profit factor > 2.0
- Ensure win rate > 50%
- Review individual trades
4. Forward Test:
- Paper trade for 2-4 weeks
- Monitor performance vs backtest
- Adjust filters if needed
5. Live Trading:
- Start with small position sizes
- Monitor risk per trade (should be consistent 1%)
- Let take-profit levels work automatically
- Don't override the system
⚠️ Important Notes
Risk Management:
- This strategy calculates position size automatically based on your risk % setting
- Default 1% risk means each losing trade costs 1% of your account
- Ensure you have sufficient capital (minimum $1,000 recommended)
- Stop loss distance varies with ATR (volatile markets = larger SL = smaller position)
Market Conditions:
- Strategy performs best in trending markets
- Use higher cooldown settings in choppy conditions
- Consider disabling in extremely volatile news events
- May underperform during prolonged consolidation
Execution:
- Strategy uses limit orders for TP levels
- Slippage can affect actual entry/exit prices
- Commission settings should match your broker
- High-spread instruments will reduce profitability
🔧 Configuration Profiles
Conservative (High Accuracy, Fewer Trades):
Trend Bars: 4-5
Strong Momentum: ON
Volume Multiplier: 1.6-1.8×
Cooldown: 6-8 bars
Distance Filter: ON
RSI Strength: ON
Expected: 4-8 trades/month, 65-80% win rate
Balanced (Default - Recommended):
Trend Bars: 3
Strong Momentum: OFF
Volume Multiplier: 1.4×
Cooldown: 4 bars
Distance Filter: OFF
RSI Strength: OFF
Expected: 8-15 trades/month, 55-70% win rate
Aggressive (More Trades):
Trend Bars: 2
Momentum: OFF
Volume Multiplier: 1.2×
Cooldown: 2 bars
All Optional Filters: OFF
Expected: 15-25 trades/month, 50-60% win rate
📚 Strategy Logic
Core Philosophy:
This strategy follows the principle that consistent, properly-managed trades with positive expectancy will compound over time. It doesn't try to catch every move or avoid every loss - instead, it focuses on:
1. Quality Setups: Multiple confirmations reduce false signals
2. Proper Position Sizing: 1% risk ensures survivability
3. Asymmetric Risk/Reward: Average wins exceed average losses
4. Scaling Out: Partial profits reduce stress and lock in gains
5. Trailing Stops: Capture extended trends without guessing tops/bottoms
Not Included:
- No martingale or position averaging
- No grid trading or pyramiding
- No reversal trades (clean exit only)
- No look-ahead bias or repainting
- No complicated formulas or curve-fitting
🎯 Performance Tips
1. Let the System Work: Don't override exits or entries manually
2. Respect the Risk: Keep risk at 1% per trade maximum
3. Monitor Equity Curve: Smooth upward = good, choppy = adjust filters
4. Adapt to Conditions: Use conservative settings in uncertain markets
5. Track Statistics: Keep a journal of trades and performance
6. Stay Disciplined: The strategy's edge comes from consistency
7. Update Periodically: Review and adjust filters monthly
✅ Advantages
✅ Automated Risk Management: Position sizing calculated for you
✅ Multiple Exit Levels: Reduces stress, improves R:R
✅ Highly Customizable: Adjust to your trading style
✅ Simple Indicators: Easy to understand and verify
✅ No Repainting: Signals don't disappear or change
✅ Proper Backtesting: All calculations use confirmed bars
✅ Works on All Timeframes: From 15M to Daily
✅ Universal Application: Forex, crypto, stocks, indices
✅ Visual Feedback: Background colours show setup alignment
✅ Clean Code: Well-documented Pine Script v5
⚠️ Limitations
⚠️ Requires Trending Markets: Underperforms in consolidation
⚠️ Not a Holy Grail: Will have losing trades and drawdowns
⚠️ Needs Proper Capital: Minimum $1,000 recommended
⚠️ Slippage Impact: Real-world execution may differ
⚠️ Backtesting Bias: Past results don't guarantee future performance
⚠️ Learning Curve: Optimal settings require experimentation
⚠️ Market Dependent: Some markets work better than others
📊 Statistics to Monitor
When evaluating this strategy, focus on:
1. Profit Factor: Should be > 2.0 (higher is better)
2. Win Rate: Target 50-70% (varies by settings)
3. Average Win vs Average Loss: Should be at least 1.5:1
4. Maximum Drawdown: Keep under 15-20%
5. Consistency: Look for steady equity curve
6. Number of Trades: Minimum 30-50 for statistical relevance
7. Risk/Trade: Should be consistent around 1%
🔐 Risk Disclaimer
IMPORTANT: Trading carries substantial risk of loss and is not suitable for all investors. Past performance is not indicative of future results. This strategy is provided for educational purposes and should not be considered financial advice.
Before using this strategy with real money:
- Thoroughly backtest on historical data
- Forward test on a demo account
- Understand your broker's execution and fees
- Only risk capital you can afford to lose
- Consider consulting with a financial advisor
- Start with small position sizes
- Monitor performance regularly
The creator of this strategy:
- Makes no guarantees of profitability
- Is not responsible for any trading losses
- Recommends proper risk management at all times
- Suggests thorough testing before live use
📞 Support & Updates
- Version: 1.0 (Pine Script v6)
- Last Updated**: 2025
- Tested On: Multiple forex pairs, crypto, indices
- Minimum TradingView Plan: Free (backtesting included)
For questions, suggestions, or bug reports, please comment below or send a message.






















