OPEN-SOURCE SCRIPT
Momentum Variance Oscillator

What MVO measures:
-PV (Price-Volume) Oscillator – how far price is from a volatility-scaled basis, then weighted by relative volume.
- > 0 = bullish pressure; < 0 = bearish pressure.
-|PV| larger ⇒ stronger momentum.
-Signal line (EMA of PV) – a smoother track of PV; crossings flag momentum shifts.
-Zero line gradient – instantly shows direction (greenish bull / reddish bear) and strength (paler → stronger).
-Extreme bands (±obLevel) – “hot zone” thresholds; being beyond them = exceptional push.
-Variance histogram – MACD-like view (PV minus slower PV-EMA) to see thrust building vs. fading.
-(Optional) Bar coloring & background tint – paints price bars and/or the panel on key events so you can read the regime at a glance.
-Auto-Tune – searches a grid of (obLevel, weakLvl) pairs and (optionally) auto-applies the best, ranked by CAGR vs. drawdown.
Core signals & how to trade them:
1) Define the regime:
-Bullish regime: PV above 0 and/or PV above Signal; zero line is in bull gradient.
-Bearish regime: PV below 0 and/or PV below Signal; zero line is in bear gradient.
-Action: Prefer trades with the regime (avoid fading strong color/strength unless you have a clear reversal setup).
2) Entries:
Momentum entry:
-Long: PV crosses above Signal while PV > 0.
-Short: PV crosses below Signal while PV < 0.
Breakout/acceleration:
-Long add-on: PV crosses above +obLevel (extreme top) and holds.
-Short add-on: PV crosses below −obLevel (extreme bottom) and holds.
-Histogram confirm: Growing bars in your direction = thrust improving; shrinking/flip = thrust stalling.
3) Exits / risk:
-Soft exit / tighten stops: PV loses the extreme and re-enters inside, or histogram fades/turns against you.
-Hard exit / reverse: Opposite PV↔Signal crossover and PV crosses the zero line.
-Weak zone filter: If |PV| < weakLvl, treat signals as lower quality (smaller size or skip).
4) Practical setup - Suggested defaults (good starting point):
-Signal length: 26
-Volume power: 0.50
-obLevel (extreme): 2.00
-weakLvl: 0.75
-Show histogram & dots: On
-Auto-Tune (recommended)
-Turn Auto-Select Best ON. MVO will scan obLevel 1.50→3.00 (step 0.05) and weakLvl 0.50→1.00 (step 0.05), then use the top-ranked pair (CAGR/(1+MDD)).
-If you want to see the top combos, enable the Optimizer Table (Top-3).
5) Visual options
-Bar Colors: Regime+Strength – bars follow the zero-line gradient (great for quick read).
-Extremes – paint only when beyond ±obLevel.
-Cross Signals – paint only on the bar that crosses an extreme.
-Background on breach: A one-bar tint when PV crosses an extreme.
6) Example playbook:
Long setup:
-Zero line shows bull gradient and PV > 0.
-PV crosses above Signal (entry).
-If PV drives above +obLevel, consider add-on; trail under the last minor swing or use ATR.
-Exit/trim on PV crossing below Signal or histogram turning negative; flatten on a drop through 0.
Short setup mirrors the above on the bear side.
7) Tips to avoid common traps:
-Don’t fade strong extremes without clear confirmation (e.g., PV re-entering inside + histogram flip).
-Respect the weak zone: if |PV| < weakLvl, signals are fragile—size down or wait.
-Align with structure: higher-timeframe trend and SR improve expectancy.
-Instrument personality matters: use Auto-Tune or re-calibrate obLevel/weakLvl across assets/timeframes.
8) Alerts you can set:
-Bull Signal X – PV crossed above Signal
-Bear Signal X – PV crossed below Signal
-Bull Baseline X – PV crossed above 0
-Bear Baseline X – PV crossed below 0
-PV (Price-Volume) Oscillator – how far price is from a volatility-scaled basis, then weighted by relative volume.
- > 0 = bullish pressure; < 0 = bearish pressure.
-|PV| larger ⇒ stronger momentum.
-Signal line (EMA of PV) – a smoother track of PV; crossings flag momentum shifts.
-Zero line gradient – instantly shows direction (greenish bull / reddish bear) and strength (paler → stronger).
-Extreme bands (±obLevel) – “hot zone” thresholds; being beyond them = exceptional push.
-Variance histogram – MACD-like view (PV minus slower PV-EMA) to see thrust building vs. fading.
-(Optional) Bar coloring & background tint – paints price bars and/or the panel on key events so you can read the regime at a glance.
-Auto-Tune – searches a grid of (obLevel, weakLvl) pairs and (optionally) auto-applies the best, ranked by CAGR vs. drawdown.
Core signals & how to trade them:
1) Define the regime:
-Bullish regime: PV above 0 and/or PV above Signal; zero line is in bull gradient.
-Bearish regime: PV below 0 and/or PV below Signal; zero line is in bear gradient.
-Action: Prefer trades with the regime (avoid fading strong color/strength unless you have a clear reversal setup).
2) Entries:
Momentum entry:
-Long: PV crosses above Signal while PV > 0.
-Short: PV crosses below Signal while PV < 0.
Breakout/acceleration:
-Long add-on: PV crosses above +obLevel (extreme top) and holds.
-Short add-on: PV crosses below −obLevel (extreme bottom) and holds.
-Histogram confirm: Growing bars in your direction = thrust improving; shrinking/flip = thrust stalling.
3) Exits / risk:
-Soft exit / tighten stops: PV loses the extreme and re-enters inside, or histogram fades/turns against you.
-Hard exit / reverse: Opposite PV↔Signal crossover and PV crosses the zero line.
-Weak zone filter: If |PV| < weakLvl, treat signals as lower quality (smaller size or skip).
4) Practical setup - Suggested defaults (good starting point):
-Signal length: 26
-Volume power: 0.50
-obLevel (extreme): 2.00
-weakLvl: 0.75
-Show histogram & dots: On
-Auto-Tune (recommended)
-Turn Auto-Select Best ON. MVO will scan obLevel 1.50→3.00 (step 0.05) and weakLvl 0.50→1.00 (step 0.05), then use the top-ranked pair (CAGR/(1+MDD)).
-If you want to see the top combos, enable the Optimizer Table (Top-3).
5) Visual options
-Bar Colors: Regime+Strength – bars follow the zero-line gradient (great for quick read).
-Extremes – paint only when beyond ±obLevel.
-Cross Signals – paint only on the bar that crosses an extreme.
-Background on breach: A one-bar tint when PV crosses an extreme.
6) Example playbook:
Long setup:
-Zero line shows bull gradient and PV > 0.
-PV crosses above Signal (entry).
-If PV drives above +obLevel, consider add-on; trail under the last minor swing or use ATR.
-Exit/trim on PV crossing below Signal or histogram turning negative; flatten on a drop through 0.
Short setup mirrors the above on the bear side.
7) Tips to avoid common traps:
-Don’t fade strong extremes without clear confirmation (e.g., PV re-entering inside + histogram flip).
-Respect the weak zone: if |PV| < weakLvl, signals are fragile—size down or wait.
-Align with structure: higher-timeframe trend and SR improve expectancy.
-Instrument personality matters: use Auto-Tune or re-calibrate obLevel/weakLvl across assets/timeframes.
8) Alerts you can set:
-Bull Signal X – PV crossed above Signal
-Bear Signal X – PV crossed below Signal
-Bull Baseline X – PV crossed above 0
-Bear Baseline X – PV crossed below 0
Mã nguồn mở
Theo đúng tinh thần TradingView, người tạo ra tập lệnh này đã biến tập lệnh thành mã nguồn mở để các nhà giao dịch có thể xem xét và xác minh công năng. Xin dành lời khen tặng cho tác giả! Mặc dù bạn có thể sử dụng miễn phí, nhưng lưu ý nếu đăng lại mã, bạn phải tuân theo Quy tắc nội bộ của chúng tôi.
Thông báo miễn trừ trách nhiệm
Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.
Mã nguồn mở
Theo đúng tinh thần TradingView, người tạo ra tập lệnh này đã biến tập lệnh thành mã nguồn mở để các nhà giao dịch có thể xem xét và xác minh công năng. Xin dành lời khen tặng cho tác giả! Mặc dù bạn có thể sử dụng miễn phí, nhưng lưu ý nếu đăng lại mã, bạn phải tuân theo Quy tắc nội bộ của chúng tôi.
Thông báo miễn trừ trách nhiệm
Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.