Up vs Down Volume Compared to PriceHi team,
I’ve put together a simple TradingView indicator that breaks down the last N candles into up-moves and down-moves, showing how much volume supported each side. It helps you quickly see whether the market is rallying on strong participation or just drifting higher on weak volume.
The tool tracks total up-volume versus down-volume, compares their ratios, and flags when pullbacks are happening with noticeably lower volume than the prior push up — a setup that often signals a healthy continuation rather than a reversal.
It also shows key metrics like total volume, price change, and up/down ratios directly on the chart for quick assessment. You’ll instantly know if you’re looking at a light-volume pullback or a heavy-volume sell-off.
Let’s test it out across a few symbols and discuss any tweaks we’d like — maybe layering an EMA or VWAP filter for cleaner trend confirmation.
스크립트에서 "神户胜利+VS+磐田喜悦"에 대해 찾기
Double Weighted Moving Average (DWMA)# DWMA: Double Weighted Moving Average
## Overview and Purpose
The Double Weighted Moving Average (DWMA) is a technical indicator that applies weighted averaging twice in sequence to create a smoother signal with enhanced noise reduction. Developed in the late 1990s as an evolution of traditional weighted moving averages, the DWMA was created by quantitative analysts seeking enhanced smoothing without the excessive lag typically associated with longer period averages. By applying a weighted moving average calculation to the results of an initial weighted moving average, DWMA achieves more effective filtering while preserving important trend characteristics.
## Core Concepts
* **Cascaded filtering:** DWMA applies weighted averaging twice in sequence for enhanced smoothing and superior noise reduction
* **Linear weighting:** Uses progressively increasing weights for more recent data in both calculation passes
* **Market application:** Particularly effective for trend following strategies where noise reduction is prioritized over rapid signal response
* **Timeframe flexibility:** Works across multiple timeframes but particularly valuable on daily and weekly charts for identifying significant trends
The core innovation of DWMA is its two-stage approach that creates more effective noise filtering while minimizing the additional lag typically associated with longer-period or higher-order filters. This sequential processing creates a more refined output that balances noise reduction and signal preservation better than simply increasing the length of a standard weighted moving average.
## Common Settings and Parameters
| Parameter | Default | Function | When to Adjust |
|-----------|---------|----------|---------------|
| Length | 14 | Controls the lookback period for both WMA calculations | Increase for smoother signals in volatile markets, decrease for more responsiveness |
| Source | close | Price data used for calculation | Consider using hlc3 for a more balanced price representation |
**Pro Tip:** For trend following, use a length of 10-14 with DWMA instead of a single WMA with double the period - this provides better smoothing with less lag than simply increasing the period of a standard WMA.
## Calculation and Mathematical Foundation
**Simplified explanation:**
DWMA first calculates a weighted moving average where recent prices have more importance than older prices. Then, it applies the same weighted calculation again to the results of the first calculation, creating a smoother line that reduces market noise more effectively.
**Technical formula:**
```
DWMA is calculated by applying WMA twice:
1. First WMA calculation:
WMA₁ = (P₁ × w₁ + P₂ × w₂ + ... + Pₙ × wₙ) / (w₁ + w₂ + ... + wₙ)
2. Second WMA calculation applied to WMA₁:
DWMA = (WMA₁₁ × w₁ + WMA₁₂ × w₂ + ... + WMA₁ₙ × wₙ) / (w₁ + w₂ + ... + wₙ)
```
Where:
- Linear weights: most recent value has weight = n, second most recent has weight = n-1, etc.
- n is the period length
- Sum of weights = n(n+1)/2
**O(1) Optimization - Inline Dual WMA Architecture:**
This implementation uses an advanced O(1) algorithm with two complete inline WMA calculations. Each WMA uses the dual running sums technique:
1. **First WMA (source → wma1)**:
- Maintains buffer1, sum1, weighted_sum1
- Recurrence: `W₁_new = W₁_old - S₁_old + (n × P_new)`
- Cached denominator norm1 after warmup
2. **Second WMA (wma1 → dwma)**:
- Maintains buffer2, sum2, weighted_sum2
- Recurrence: `W₂_new = W₂_old - S₂_old + (n × WMA₁_new)`
- Cached denominator norm2 after warmup
**Implementation details:**
- Both WMAs fully integrated inline (no helper functions)
- Each maintains independent state: buffers, sums, counters, norms
- Both warm up independently from bar 1
- Performance: ~16 operations per bar regardless of period (vs ~10,000 for naive O(n²) implementation)
**Why inline architecture:**
Unlike helper functions, the inline approach makes all state variables and calculations visible in a single scope, eliminating function call overhead and making the dual-pass nature explicit. This is ideal for educational purposes and when debugging complex cascaded filters.
> 🔍 **Technical Note:** The dual-pass O(1) approach creates a filter that effectively increases smoothing without the quadratic increase in computational cost. Original O(n²) implementations required ~10,000 operations for period=100; this optimized version requires only ~16 operations, achieving a 625x speedup while maintaining exact mathematical equivalence.
## Interpretation Details
DWMA can be used in various trading strategies:
* **Trend identification:** The direction of DWMA indicates the prevailing trend
* **Signal generation:** Crossovers between price and DWMA generate trade signals, though they occur later than with single WMA
* **Support/resistance levels:** DWMA can act as dynamic support during uptrends and resistance during downtrends
* **Trend strength assessment:** Distance between price and DWMA can indicate trend strength
* **Noise filtering:** Using DWMA to filter noisy price data before applying other indicators
## Limitations and Considerations
* **Market conditions:** Less effective in choppy, sideways markets where its lag becomes a disadvantage
* **Lag factor:** More lag than single WMA due to double calculation process
* **Initialization requirement:** Requires more data points for full calculation, showing more NA values at chart start
* **Short-term trading:** May miss short-term trading opportunities due to increased smoothing
* **Complementary tools:** Best used with momentum oscillators or volume indicators for confirmation
## References
* Jurik, M. "Double Weighted Moving Averages: Theory and Applications in Algorithmic Trading Systems", Jurik Research Papers, 2004
* Ehlers, J.F. "Cycle Analytics for Traders," Wiley, 2013
Weighted Moving Average (WMA)This implementation uses O(1) algorithm that eliminates the need to loop through all period values on each bar. It also generates valid WMA values from the first bar and is not returning NA when number of bars is less than period.
## Overview and Purpose
The Weighted Moving Average (WMA) is a technical indicator that applies progressively increasing weights to more recent price data. Emerging in the early 1950s during the formative years of technical analysis, WMA gained significant adoption among professional traders through the 1970s as computational methods became more accessible. The approach was formalized in Robert Colby's 1988 "Encyclopedia of Technical Market Indicators," establishing it as a staple in technical analysis software. Unlike the Simple Moving Average (SMA) which gives equal weight to all prices, WMA assigns greater importance to recent prices, creating a more responsive indicator that reacts faster to price changes while still providing effective noise filtering.
## Core Concepts
* **Linear weighting:** WMA applies progressively increasing weights to more recent price data, creating a recency bias that improves responsiveness
* **Market application:** Particularly effective for identifying trend changes earlier than SMA while maintaining better noise filtering than faster-responding averages like EMA
* **Timeframe flexibility:** Works effectively across all timeframes, with appropriate period adjustments for different trading horizons
The core innovation of WMA is its linear weighting scheme, which strikes a balance between the equal-weight approach of SMA and the exponential decay of EMA. This creates an intuitive and effective compromise that prioritizes recent data while maintaining a finite lookback period, making it particularly valuable for traders seeking to reduce lag without excessive sensitivity to price fluctuations.
## Common Settings and Parameters
| Parameter | Default | Function | When to Adjust |
|-----------|---------|----------|---------------|
| Length | 14 | Controls the lookback period | Increase for smoother signals in volatile markets, decrease for responsiveness |
| Source | close | Price data used for calculation | Consider using hlc3 for a more balanced price representation |
**Pro Tip:** For most trading applications, using a WMA with period N provides better responsiveness than an SMA with the same period, while generating fewer whipsaws than an EMA with comparable responsiveness.
## Calculation and Mathematical Foundation
**Simplified explanation:**
WMA calculates a weighted average of prices where the most recent price receives the highest weight, and each progressively older price receives one unit less weight. For example, in a 5-period WMA, the most recent price gets a weight of 5, the next most recent a weight of 4, and so on, with the oldest price getting a weight of 1.
**Technical formula:**
```
WMA = (P₁ × w₁ + P₂ × w₂ + ... + Pₙ × wₙ) / (w₁ + w₂ + ... + wₙ)
```
Where:
- Linear weights: most recent value has weight = n, second most recent has weight = n-1, etc.
- The sum of weights for a period n is calculated as: n(n+1)/2
- For example, for a 5-period WMA, the sum of weights is 5(5+1)/2 = 15
**O(1) Optimization - Dual Running Sums:**
The key insight is maintaining two running sums:
1. **Unweighted sum (S)**: Simple sum of all values in the window
2. **Weighted sum (W)**: Sum of all weighted values
The recurrence relation for a full window is:
```
W_new = W_old - S_old + (n × P_new)
```
This works because when all weights decrement by 1 (as the window slides), it's mathematically equivalent to subtracting the entire unweighted sum. The implementation:
- **During warmup**: Accumulates both sums as the window fills, computing denominator each bar
- **After warmup**: Uses cached denominator (constant at n(n+1)/2), updates both sums in constant time
- **Performance**: ~8 operations per bar regardless of period, vs ~100+ for naive O(n) implementation
> 🔍 **Technical Note:** Unlike EMA which theoretically considers all historical data (with diminishing influence), WMA has a finite memory, completely dropping prices that fall outside its lookback window. This creates a cleaner break from outdated market conditions. The O(1) optimization achieves 12-25x speedup over naive implementations while maintaining exact mathematical equivalence.
## Interpretation Details
WMA can be used in various trading strategies:
* **Trend identification:** The direction of WMA indicates the prevailing trend with greater responsiveness than SMA
* **Signal generation:** Crossovers between price and WMA generate trade signals earlier than with SMA
* **Support/resistance levels:** WMA can act as dynamic support during uptrends and resistance during downtrends
* **Moving average crossovers:** When a shorter-period WMA crosses above a longer-period WMA, it signals a potential uptrend (and vice versa)
* **Trend strength assessment:** Distance between price and WMA can indicate trend strength
## Limitations and Considerations
* **Market conditions:** Still suboptimal in highly volatile or sideways markets where enhanced responsiveness may generate false signals
* **Lag factor:** While less than SMA, still introduces some lag in signal generation
* **Abrupt window exit:** The oldest price suddenly drops out of calculation when leaving the window, potentially causing small jumps
* **Step changes:** Linear weighting creates discrete steps in influence rather than a smooth decay
* **Complementary tools:** Best used with volume indicators and momentum oscillators for confirmation
## References
* Colby, Robert W. "The Encyclopedia of Technical Market Indicators." McGraw-Hill, 2002
* Murphy, John J. "Technical Analysis of the Financial Markets." New York Institute of Finance, 1999
* Kaufman, Perry J. "Trading Systems and Methods." Wiley, 2013
Quantum Portfolio vs S&P 500 (Base: May 2, 2021)This script compares the performance of a custom Quantum Portfolio — a weighted basket of quantum computing, semiconductor, and cybersecurity stocks — against the S&P 500 Index, with both series rebased to 100 on May 2 2021.
It provides a clear, normalized view of cumulative returns, allowing you to visualize portfolio outperformance or underperformance relative to the broader market benchmark.
Auto Chart PatternsAuto Chart Patterns automatically scans the chart for major technical patterns and marks them directly on price action. It detects:
• Head & Shoulders (bearish reversal)
• Inverse Head & Shoulders (bullish reversal)
• Rising and Falling Wedges
• Double / Triple Tops and Bottoms
• Cup & Handle (bullish continuation)
For each pattern, the script draws the structure (trendlines / neckline), shades the pattern zone, and places a label with the pattern name.
It also generates optional trade signals:
• “BUY” when a bullish pattern breaks out with confirmation
• “SELL” when a bearish pattern breaks down with confirmation
Confirmations can include:
• Follow-through candle in the breakout direction
• Volume spike vs recent average
• RSI momentum agreement
Inputs let you control:
• Pivot sensitivity (left/right bars)
• Pattern types to display
• Cup & Handle depth rules
• Confirmation rules for entry/exit signals
This tool is designed to help you visually spot reversal and continuation setups, highlight potential breakout levels (necklines / wedge boundaries), and time trades with clearer confirmation instead of guessing.
Disclaimer: This script is for educational/technical analysis purposes only. It does not guarantee future performance, does not execute trades, and is not financial advice. Always confirm signals with your own analysis and risk management before entering any position.
Quantum Portfolio vs NASDAQ (Base: May 2, 2021)This custom Pine Script indicator tracks and compares the cumulative performance of a multi-asset “Quantum Portfolio” against the NASDAQ 100 benchmark, rebased to a common starting point on May 2, 2021.
Both series are normalized to a base value of 100 on that date, allowing direct visual comparison of percentage growth or decline over time.
Volume Profile Area [BigBeluga]🔵 OVERVIEW
The Volume Profile Area is an advanced profiling tool that calculates and visualizes the value area within a chosen period’s volume distribution. It first builds a main profile of the entire range, then constructs a secondary profile inside the defined value area, allowing traders to examine market balance and key trading zones in greater detail.
🔵 CONCEPTS
Volume Profile – Distributes traded volume across price levels to highlight areas of market activity.
Value Area (VA) – The price range containing a chosen percentage of total volume (commonly 50–70%).
Point of Control (PoC) – The price level with the highest traded volume, often acting as a magnet for price.
Nested Profiles – A profile inside the VA adds a second layer of precision, showing where liquidity clusters within the “fair value” zone.
🔵 FEATURES
Main Profile – Full distribution of volume over the selected lookback period.
Secondary Profile – Built only inside the VA of the main profile, highlighting intrabalance structure.
Customizable PoC Selection – Choose between showing the PoC of the
Main Profile ,
the Area Profile ,
their Average ,
or None .
Dynamic Value Area Levels – Automatically plots VAL (Value Area Low) and VAH (Value Area High) with labels.
Overlay Toggles – Show/hide range extremes, VA lines, or PoCs for a cleaner chart view.
Visual Profiles – Main profile shaded in darker blue; the VA profile inside is lighter for clear separation.
Automatic Scaling – Profiles adapt to period highs/lows and auto-adjust bins for consistent resolution.
Volume Labels – PoCs can display traded volume, giving numeric confirmation of liquidity concentration.
🔵 HOW TO USE
Set the Period to define how many bars to include in the main profile.
Adjust the Value Area % to control how much volume defines the VA (e.g., 50% by default).
Pick your PoC option: Main , Area , or Average , depending on focus.
Use VAH/VAL lines as support/resistance levels where most trading occurred.
Compare reactions at Main vs VA PoC levels to spot potential breakouts or mean reversions.
🔵 CONCLUSION
The Volume Profile Area extends traditional profiling by nesting a secondary VA profile inside the main distribution. This dual-layer approach reveals not just where the market was active overall, but where liquidity concentrated within the “fair value” zone—powerful for refining entries, exits, and risk placement across intraday and swing horizons.
Momentum Breakout Filter + ATR ZonesMomentum Breakout Filter + ATR Zones - User Guide
What This Indicator Does
This indicator helps you with your MACD + volume momentum strategy by:
Filtering out fake breakouts - Shows ⚠️ warnings when breakouts lack confirmation
Showing clear entry signals - 🚀 LONG and 🔻 SHORT labels when all conditions align
Automatic stop loss & profit targets - Based on ATR (Average True Range)
Visual trend confirmation - Background color + EMA alignment
Signal Types
🚀 LONG Entry Signal (Green Label)
Appears when ALL conditions met:
✅ MACD crosses above signal line
✅ Volume > 1.5× average
✅ Price > EMA 9 > EMA 21 > EMA 200 (bullish trend)
✅ Price closes above recent 20-bar high
🔻 SHORT Entry Signal (Red Label)
Appears when ALL conditions met:
✅ MACD crosses below signal line
✅ Volume > 1.5× average
✅ Price < EMA 9 < EMA 21 < EMA 200 (bearish trend)
✅ Price closes below recent 20-bar low
⚠️ FAKE Breakout Warning (Orange Label)
Appears when price breaks high/low BUT lacks confirmation:
❌ Low volume (below 1.5× average), OR
❌ Wick break only (didn't close through level), OR
❌ MACD not aligned with direction
Hover over the warning label to see what's missing!
ATR Stop Loss & Targets
When you get a signal, colored lines automatically appear:
Long Position
Red solid line = Stop Loss (Entry - 1.5×ATR)
Green dashed lines = Profit Targets:
Target 1: Entry + 2×ATR
Target 2: Entry + 3×ATR
Target 3: Entry + 4×ATR
Short Position
Red solid line = Stop Loss (Entry + 1.5×ATR)
Green dashed lines = Profit Targets:
Target 1: Entry - 2×ATR
Target 2: Entry - 3×ATR
Target 3: Entry - 4×ATR
The lines move with each bar until you exit the position.
Chart Elements
Moving Averages
Blue line = EMA 9 (fast)
Orange line = EMA 21 (medium)
White line = EMA 200 (trend filter)
Volume
Yellow bars = High volume (above threshold)
Gray bars = Normal volume
Background Color
Light green = Bullish trend (all EMAs aligned up)
Light red = Bearish trend (all EMAs aligned down)
No color = Neutral/mixed
MACD (Bottom Pane)
Green/Red columns = MACD Histogram
Blue line = MACD Line
Orange line = Signal Line
Info Dashboard (Bottom Right)
ItemWhat It ShowsVolumeCurrent volume vs average (✓ HIGH or ✗ Low)MACDDirection (BULLISH or BEARISH)TrendEMA alignment (BULL, BEAR, or NEUTRAL)ATRCurrent ATR value in dollarsPositionCurrent position (LONG, SHORT, or NONE)R:RRisk-to-Reward ratio (shows when in position)
How To Use It
Basic Workflow
Wait for setup
Watch for MACD to approach signal line
Volume should be building
Price should be near EMA structure
Get confirmation
Wait for 🚀 LONG or 🔻 SHORT label
Check dashboard shows "✓ HIGH" volume
Verify trend is aligned (green or red background)
Enter the trade
Enter when signal appears
Note your stop loss (red line)
Note your targets (green dashed lines)
Manage the trade
Exit at first target for partial profit
Move stop to breakeven
Trail remaining position
What To Avoid
❌ Don't trade when you see:
⚠️ FAKE labels (wait for confirmation)
Neutral background (no clear trend)
"✗ Low" volume in dashboard
MACD and Trend not aligned
Settings You Can Adjust
Volume Sensitivity
High Volume Threshold: Default 1.5×
Increase to 2.0× for cleaner signals (fewer trades)
Decrease to 1.2× for more signals (more trades)
Fake Breakout Filters
You can toggle these ON/OFF:
Volume Confirmation: Requires high volume
Close Through: Requires candle close, not just wick
MACD Alignment: Requires MACD direction match
Tip: Turn all three ON for highest quality signals
ATR Stop/Target Multipliers
Default settings (conservative):
Stop Loss: 1.5×ATR
Target 1: 2×ATR (1.33:1 R:R)
Target 2: 3×ATR (2:1 R:R)
Target 3: 4×ATR (2.67:1 R:R)
Aggressive traders might use:
Stop Loss: 1.0×ATR
Target 1: 2×ATR (2:1 R:R)
Target 2: 4×ATR (4:1 R:R)
Conservative traders might use:
Stop Loss: 2.0×ATR
Target 1: 3×ATR (1.5:1 R:R)
Target 2: 5×ATR (2.5:1 R:R)
Example Trade Scenarios
Scenario 1: Perfect Long Setup ✅
Stock consolidating near EMA 21
MACD curling up toward signal line
Volume bar turns yellow (high volume)
🚀 LONG label appears
Red stop line and green target lines appear
Result: High probability trade
Scenario 2: Fake Breakout Avoided ✅
Price breaks above resistance
Volume is normal (gray bar)
⚠️ FAKE label appears (hover shows "Low volume")
No entry signal
Price falls back below breakout level
Result: Avoided losing trade
Scenario 3: Premature Entry ❌
MACD crosses up
Volume is high
BUT trend is NEUTRAL (no background color)
No signal appears (trend filter blocks it)
Result: Avoided choppy/sideways market
Quick Reference
Entry Checklist
🚀 or 🔻 label on chart
Dashboard shows "✓ HIGH" volume
Dashboard shows aligned MACD + Trend
Colored background (green or red)
ATR lines visible
No ⚠️ FAKE warning
Exit Strategy
Target 1 (2×ATR): Take 50% profit, move stop to breakeven
Target 2 (3×ATR): Take 25% profit, trail stop
Target 3 (4×ATR): Take remaining profit or trail aggressively
Stop Loss: Exit entire position if hit
Alerts
Set up these alerts:
Long Entry: Fires when 🚀 LONG signal appears
Short Entry: Fires when 🔻 SHORT signal appears
Fake Breakout Warning: Fires when ⚠️ appears (optional)
Tips for Success
Use on 5-minute charts for day trading momentum plays
Only trade high volume stocks ($5-20 range works best)
Wait for full confirmation - don't jump early
Respect the stop loss - it's calculated based on volatility
Scale out at targets - don't hold for home runs
Avoid trading first 15 minutes - let market settle
Best during 10am-11am and 2pm-3pm - peak momentum times
Common Questions
Q: Why didn't I get a signal even though MACD crossed?
A: All conditions must be met - check dashboard for what's missing (likely volume or trend alignment)
Q: Can I use this on any timeframe?
A: Yes, but it's designed for 5-15 minute charts. On daily charts, adjust ATR multipliers higher.
Q: The stop loss seems too tight, can I widen it?
A: Yes, increase "Stop Loss (×ATR)" from 1.5 to 2.0 or 2.5 in settings.
Q: I keep seeing FAKE warnings but price keeps going - what gives?
A: The filter is conservative. You can disable some filters in settings, but expect more false signals.
Q: Can I use this for swing trading?
A: Yes, but use larger timeframes (1H or 4H) and adjust ATR multipliers up (3× for stops, 6-9× for targets).
Smart Money Concept: FVG Block Filter Smart Money Concept: FVG Block Filter (FVG Block Range vs N Range) with Candle Highlighter
Summary:
Smart Money Concept (SMC): An advanced indicator designed to visualize and filter Fair Value Gaps (FVG) blocks based on their size (Range) compared to the preceding N Range candle movement. It also includes a customizable Candle Highlighter function that marks the specific candle responsible for creating the FVG. The indicator allows full color customization for both blocks and the highlighter, and features clean, label-free charts by default.
Key Features:
FVG Block Detection: Automatically identifies and groups sequential FVG imbalances to form consolidated FVG blocks.
FVG Block Filtering (N Range): Filters blocks based on a user-defined rule, comparing the block's size (Range) to the range of the preceding N candles (e.g., requiring the FVG block to be larger than the range of the previous 6 candles).
Customizable Candle Highlighter: Marks the central candle (B) within the FVG structure (A-B-C) to highlight the source of the price imbalance. Highlighter colors are fully adjustable via inputs.
Visualization Control: Labels are turned OFF by default to keep the chart clean but can be easily enabled via the indicator settings.
Full Color Customization: Allows independent customization of Bullish and Bearish FVG Block colors, Block Transparency, and Bullish/Bearish Highlighter colors.
Keywords:
Smart Money Concept, SMC, Fair Value Gap, FVG, Imbalance, Block Filter, Candle Highlighter, Range.
High Zone MapperHigh Zone and Low Zone Mapper — Quick Manual (Short-Term Trading)
Author: hkpress | Script date: 2025-10-26
This indicator draws: PDH/PDL (Prior Day High/Low), PWH/PWL (Prior Week High/Low), ORH/ORL (Opening Range High/Low), IDH/IDL (Intraday High/Low), plus a shaded Opening Range box.
I built this script after watching an interview on TradingLion with a Hong Kong trader who uses prior-day, opening-range, intraday, and prior-week levels to plan entries and exits. The approach is especially useful for traders who run tight stops (about 1.5%–3%) while aiming to size up into bigger positions. (Youtube: www.youtube.com)
1) Quick Start (15-minute default)
Timeframe: use 1–15m for scalps, 5–30m for intraday.
Opening Range (OR — Opening Range): default 15 minutes.
Turn on “Show OR lines while opening range builds” if you want to see ORH/ORL during the first 15 minutes.
Session mode:
Stocks → Use Trading Session = ON (RTH — Regular Trading Hours, e.g., 09:30–16:00).
Crypto/24h → Use Trading Session = OFF (day-start mode).
Visuals: enable PDH/PDL, PWH/PWL, ORH/ORL, IDH/IDL, and the Opening Range box (fill).
2) What each line means
PDH/PDL (Prior Day High/Low): Yesterday’s extremes; frequent reaction zones.
PWH/PWL (Prior Week High/Low): Last week’s extremes; stronger “fences.”
ORH/ORL (Opening Range High/Low): High/low of the first 15 minutes by default; key breakout compass.
IDH/IDL (Intraday High/Low): Today’s high/low so far; confirms momentum after a break.
3) Short-Term Playbook (step-by-step)
A. Before the open
Note where price is vs PDH/PDL and PWH/PWL to set a bias.
Above PDH and pushing up → bullish lean.
Below PDL and slipping → bearish lean.
B. First 15 minutes (Opening Range forms)
Let the Opening Range box print (ORH top, ORL bottom).
Think of this box as the day’s first “battlefield.”
C. Breakout entries
Long: Clean break above ORH (preferably with momentum/volume).
Stop: just below ORH (aggressive) or below ORL (conservative).
Targets: step up through PDH → PWH.
Short: Clean break below ORL.
Stop: just above ORL (aggressive) or above ORH (conservative).
Targets: step down through PDL → PWL.
D. Retest entries (missed the first move?)
After a break, wait for a retest of ORH/ORL from the other side.
Enter on rejection/continuation; place stop on the opposite side of the retested level.
E. Momentum confirmation
New IDH (Intraday High) after an ORH break = trend strengthening (consider add/hold).
New IDL after an ORL break = downtrend strengthening.
Trail stops below higher lows (long) or above lower highs (short).
F. Range mode (no break yet)
If price stays inside the box, fade edges: buy near ORL, sell near ORH, until a decisive break.
4) Risk rules (keep it simple)
Aim for R:R (Risk-to-Reward) ≥ 1:2.
Set a daily max loss (e.g., 1–2R) and respect it.
Invalidation: if price breaks and then re-enters the box and holds, exit—don’t argue.
5) Quick example
The 15-minute OR prints: ORL = 100, ORH = 105.
Price breaks 106 with momentum → Long.
Stop 104.8 (below ORH) or 99.8 (below ORL).
Targets: PDH, then PWH. Trail as IDH keeps making new highs.
6) Handy tweaks
Noisy/news days: widen to 30-minute OR to reduce whipsaws.
Strong trend open: tighten to 5–10-minute OR to engage earlier.
Choppy session: stick to box-edge fades or stand aside after two failed breaks.
7) Built-in alerts to consider
“Break Above ORH / Below ORL” → entry triggers.
“New IDH / New IDL” → momentum confirms; tighten stops or scale.
“Break Above PDH / Below PDL / Above PWH / Below PWL” → target hits or bigger trend shifts.
8) Troubleshooting
No lines? Switch to an intraday timeframe (1–60m).
ORH/ORL missing? Turn ON Show OR lines while opening range builds.
Session mismatch? Use correct RTH hours, or turn session OFF for 24h symbols.
Abbreviation cheat-sheet
OR (Opening Range), ORH/ORL (Opening Range High/Low)
PDH/PDL (Prior Day High/Low)
PWH/PWL (Prior Week High/Low)
IDH/IDL (Intraday High/Low)
RTH (Regular Trading Hours), R:R (Risk-to-Reward)
WaveTrend RBF What it does
WT-RBF extracts a “wave” of momentum by subtracting a fast Gaussian-weighted smoother from a slow one, then robust-normalizes that wave with a median/MAD proxy to produce a z-score (z). A short EMA of z forms the signal line. Optional dynamic thresholds use the MAD of z itself so overbought/oversold levels adapt to volatility regimes.
How it’s built:
Radial (Gaussian) smoothers
Causal, exponentially-decaying weights over the last radius bars using σ (sigma) to control spread.
fast = rbf_smooth(src, fastR, fastSig)
slow = rbf_smooth(src, slowR, slowSig)
wave = fast − slow (band-pass)
Robust normalization
A two-stage EMA approximates the median; MAD is estimated from EMA of absolute deviations and scaled by 1.4826 to be stdev-comparable.
z = (wave − center) / MAD
Thresholds
Dynamic OB/OS: ±2.5 × MAD(z) (or fixed levels when disabled)
Reading the indicator
Bull Cross: z crosses above sig → momentum turning up.
Bear Cross: z crosses below sig → momentum turning down.
Exits / Bias flips: zero-line crosses (below 0 → exit long bias; above 0 → exit short bias).
Overbought/Oversold: z > +thrOB or z < thrOS. With dynamics on, the bands widen/narrow with recent noise; with dynamics off, static guides at ±2 / ±2.5 are shown.
Core Inputs
Source: Price series to analyze.
Fast Radius / Fast Sigma (defaults 6 / 2.5): Shorter radius/smaller σ = snappier, higher-freq.
Slow Radius / Slow Sigma (defaults 14 / 5.0): Larger radius/σ = smoother, lower-freq baseline.
Normalization
Robust Z-Score Window (default 200): Lookback for median/MAD proxy (stability vs responsiveness).
Small ε for MAD: Floor to avoid division by zero.
Signal & Thresholds
Dynamic Thresholds (MAD-based) (on by default): Adaptive OB/OS; toggle off to use fixed guides.
Visuals
Shade OB/OS Regions: Background highlights when z is beyond thresholds.
Show Zero Line: Midline reference.
(“Plot Cross Markers” input is present for future use.)
Rolling Performance Metrics TableRolling Performance Metrics Table
A clean, customizable table overlay that displays rolling performance metrics across multiple time periods. Perfect for quickly assessing price momentum and performance trends at a glance.
FEATURES:
- Displays performance across 5 time periods: 1 Week, 3 Month, 6 Month, 1 Year, and 2 Year
- Shows historical price at the start of each period
- Calculates both absolute price change and percentage change
- Color-coded results: Green for positive performance, Red for negative performance
- Fully transparent design with no background or borders - text floats cleanly over your chart
- Customizable table position (9 placement options)
DISPLAY COLUMNS:
1. Period - The lookback timeframe
2. Price - The historical price at the start of the period
3. Change (Value) - Absolute price change from the period start
4. Change (%) - Percentage return over the period
CUSTOMIZATION:
- Adjust the number of bars for each period (default: 1 Week = 5 bars, 3 Month = 63 bars, 6 Month = 126 bars, 1 Year = 252 bars, 2 Year = 504 bars)
- Choose from 9 table positions: Top, Middle, Bottom combined with Left, Center, Right
- Default position: Middle Left
USAGE:
Perfect for traders who want to quickly assess momentum across multiple timeframes. The transparent overlay design ensures minimal obstruction of chart analysis while providing critical performance data at a glance.
NOTE:
- The table only appears on the last bar of your chart
- Customize bar counts in settings to match your specific timeframe needs (e.g., daily vs hourly charts)
- "N/A" appears when historical data is insufficient for the selected period
Liquidity Sniper V3 (ANTI-FAKEOUT)An advanced institutional trading indicator combining liquidity pool targeting, smart money concepts, and momentum-based entries with comprehensive risk management.
🎯 CORE FEATURES:
- Liquidity Sniper Module: Identifies and targets major liquidity pools (PDH/PDL, PWH/PWL, Equal Highs/Lows, HVN/LVN edges)
- Anti-Fakeout Stack: 10-layer confirmation system including VWAP reclaim, micro BOS, displacement, relative volume, and mitigation entries
- Momentum Engulf Add-On: Catches high-velocity impulsive moves with engulfing candles, volume spikes, and volatility breakouts
- GARCH Volatility Filter: Dynamic volatility analysis to avoid choppy conditions
- Multi-Timeframe Confirmation: Ensures alignment across timeframes before entries
📊 SIGNAL CLASSIFICATION:
- BEST (Green): Highest probability setups with all confirmations aligned - 6.0+ score
- BETTER (Medium Green): Strong setups with most confirmations - 4.5-6.0 score
- GOOD (Light Green): Valid setups with basic confirmations - 3.0-4.5 score
🔍 TRADE SCENARIOS:
S1: Liquidity Reversal - Sweeps + reversals at key levels with displacement
S2: Continuation - Trend following with VWAP mean reversion
S3: Mean Reversion - Extreme deviations (2σ+) with Fibonacci exhaustion
S4: Deep Sweep - 3σ sweeps at major liquidity with high confluence
⚡ MOMENTUM TRIGGERS:
- MET (Momentum Engulf): Bullish/bearish engulfing with 1.5x+ volume spike and ATR impulse
- VBT (Volatility Breakout): Range breakouts with sigma bursts and participation
🛡️ RISK MANAGEMENT:
- Dynamic TP/SL based on ATR, VWAP bands, and liquidity pools
- 3-tier targets (T1: VWAP, T2: Nearest pool, T3: 5R extension)
- Early invalidation tracking (0.5R movement monitoring)
- Minimum 2:1 RR requirement with cooldown periods
- RTH session filters and anti-spam protection
📈 TECHNICAL EDGE:
- SMT Divergence detection vs ES correlation
- CVD (Cumulative Volume Delta) divergence confirmation
- FVG (Fair Value Gap) and Order Block mitigation entries
- Equal highs/lows clustering analysis
- Volume profile HVN/LVN identification
⚙️ FULLY CUSTOMIZABLE:
All parameters adjustable including cooldowns, proximity thresholds, ATR multipliers, RR floors, and scenario weights.
Perfect for: ES/NQ futures, forex majors, and liquid stocks. Works on 1-15 min timeframes. Best results during NY session (9:35-11:00 AM & 1:30-3:30 PM ET).
Created for serious traders seeking institutional-grade edge with quantifiable risk/reward and high-probability setups
SPX / Silver (XAGUSD) RatioThis script visualizes the S&P 500 Index to Silver ratio (SPX/Silver) — a powerful tool for monitoring the relative strength of equities vs. precious metals over time.
📊 Use Case:
Helps traders assess macro sentiment shifts between risk-on (equities) and risk-off (commodities).
A rising ratio indicates equity outperformance vs Silver, often in growth-driven bull markets.
A falling ratio suggests Silver is outperforming — potentially due to inflation, geopolitical risk, or weakening equities.
⚙️ Data & Calculation:
SPX: SP:SPX (S&P 500 Index)
Silver: TVC:SILVER
Formula:
SPX / Silver
(Both are spot/index prices, updated on daily timeframe)
📈 Interpretation:
📈 Ratio Rising → SPX outperforming Silver → Risk-on sentiment
📉 Ratio Falling → Silver outperforming SPX → Possible flight to safety or inflation hedge
🧠 Ideal For:
Macro trend analysis
Intermarket strategy development
Asset rotation decision-making
Spotting Silver bottoms during SPX/Silver peak zones
Dual ORB (EU/US) + VWAP + Filters (Retest/EMA/ATR/RVOL)Release Notes — Dual ORB (EU & US) + Color VWAP
Summary
This script plots two configurable Opening Range Breakouts (ORB)—one for the European open and one for the US open—along with a color-adaptive VWAP (green above price, red below). It’s designed for M5/M15 intraday trading on indices (e.g., US100) and metals (e.g., XAUUSD), with clean visuals, optional history retention, and simple breakout cues.
New & Key Features
Dual ORB Sessions
EU ORB (default 07:00) and US ORB (default 14:00).
Each session’s start time and duration are configurable (15/30/45/60 min).
Automatic OR box that tracks the session high/low and freezes at the end of the window.
Configurable Time Zone
Choose a specific UTC offset or an IANA time zone (e.g., Europe/Paris, America/New_York) for precise session timing.
“Exchange” option mirrors the chart’s exchange time when available.
Targets (1× Range by default)
First upside/downside target plotted as a step line once the OR closes (based on a % of the OR width).
Separate % settings per session (EU/US).
Breakout Signals
Optional ▲ / ▼ markers when price crosses ORH/ORL after the OR window closes.
Adjustable signal size and colors.
Color-Adaptive VWAP
VWAP plotted for the whole session; green when price ≥ VWAP, red when price < VWAP.
Single slider for VWAP line thickness and a toggle to show/hide.
Clean Visuals & History Control
Option to preserve historical boxes/lines/labels, or auto-clean previous sessions when a new OR starts.
Per-session colors for the OR lines, fills, labels.
Configuration
General
Show History: Keep OR drawings from prior sessions or clear them automatically.
Time Zone: Pick Exchange or a specific UTC/IANA zone.
ORB Europe / ORB US
Start Time (HH:MM)
Duration: 15 / 30 / 45 / 60 minutes.
Target %: Distance for the first target as a % of the OR range.
Colors: Line and fill per session.
Signals
Enable Breakout Signals
Up/Down Colors
Text Size: Tiny → Huge.
VWAP
Show/Hide
Line Width
Visual Elements
OR Box: Semi-transparent fill during the window; locks at end.
OR Levels: ORH / ORL solid lines; ORM dashed.
Target Lines: Step lines above/below after OR closes.
Signal Labels: ▲ at ORL (bull break), ▼ at ORH (bear break).
VWAP Line: Turns green/red with price relation.
Alerts (baseline)
Signal labels visually indicate ORH/ORL breaks. (You can add alertconditions to match these crossings if you want audible/Push alerts.)
Performance & Compatibility
Pine v6.
Intraday only (< 1D). The script aborts on daily or higher timeframes to avoid misleading OR timing.
Efficient drawing & clean-up to reduce line/label count.
Known Limitations
The script relies on bar timestamps; exact alignment depends on chart data and your chosen time zone
If your broker/exchange applies session gaps or custom trading hours, verify that your time zone and session align with the instrument.
Suggested Workflow
Pick your time zone.
Set EU/US start times and durations to match your plan (e.g., EU 07:00 30m, US 14:00 30m).
Choose whether to keep history.
Toggle signals and VWAP as desired.
Use ORH/ORL and the first target as decision levels; combine with your filter (trend MA, RSI, market structure, etc.).
Changelog (high-level)
v1.
Added dual configurable ORB (EU & US).
Added per-session targets (percent of OR width).
Added color-adaptive VWAP + width control.
Added breakout signals with customizable size and colors.
Added time zone selector (Exchange, UTC, IANA).
Added history on/off option and improved object lifecycle (clean-up vs persist).
Ported to Pine v6 and hardened against repainting artifacts at session edges.
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.
═════════════════════════════════════════════════════════════
Multi-Timeframe EMA Trend Dashboard with Volume and RSI Filters═══════════════════════════════════════════════════════════
MULTI-TIMEFRAME EMA TREND DASHBOARD
═══════════════════════════════════════════════════════════
OVERVIEW
This indicator provides a comprehensive view of trend direction across multiple timeframes using the classic EMA 20/50 crossover methodology, enhanced with volume confirmation and RSI filtering. It aggregates trend information from six timeframes into a single dashboard for efficient market analysis.
The indicator is designed for educational purposes and to assist traders in identifying potential trend alignments across different time horizons.
═══════════════════════════════════════════════════════════
FEATURES
═══════════════════════════════════════════════════════════
MULTI-TIMEFRAME ANALYSIS
• Monitors 6 timeframes simultaneously: 1m, 5m, 15m, 1H, 4H, 1D
• Each timeframe analyzed independently using request.security()
• Non-repainting implementation with proper lookahead settings
• Calculates overall trend strength as percentage of bullish timeframes
EMA CROSSOVER SYSTEM
• Fast EMA (default: 20) and Slow EMA (default: 50)
• Bullish: Fast EMA > Slow EMA
• Bearish: Fast EMA < Slow EMA
• Neutral: Fast EMA = Slow EMA (rare condition)
• Visual EMA plots with optional fill area
VOLUME CONFIRMATION
• Optional volume filter for crossover signals
• Compares current volume against moving average (default: 20-period SMA)
• Categorizes volume as: High (>1.5x average), Normal (>average), Low (70), oversold (<30), and neutral zones
• Used in quality score calculation
• Optional display toggle
SUPPORT & RESISTANCE DETECTION
• Automatic detection using highest/lowest over lookback period (default: 50 bars)
• Plots resistance (red), support (green), and mid-level (gray)
• Step-line style for clear visualization
• Optional display toggle
QUALITY SCORING SYSTEM
• Rates trade setups from 1-5 stars
• Considers: MTF alignment, volume confirmation, RSI positioning
• 5 stars: 4+ timeframes aligned + volume confirmed + RSI 50-70
• 4 stars: 4+ timeframes aligned + volume confirmed
• 3 stars: 3+ timeframes aligned
• 2 stars: Exactly 3 timeframes aligned
• 1 star: Other conditions
VISUAL DASHBOARD
• Clean table display (position customizable)
• Color-coded trend indicators (green/red/yellow)
• Extended statistics panel (toggleable)
• Shows: Trends, Strength, Quality, RSI, Volume, Price Distance
═══════════════════════════════════════════════════════════
TECHNICAL SPECIFICATIONS
═══════════════════════════════════════════════════════════
CALCULATIONS
Trend Determination per Timeframe:
• request.security() fetches EMA values with gaps=off, lookahead=off
• Compares Fast EMA vs Slow EMA
• Returns: 1 (bullish), -1 (bearish), 0 (neutral)
Trend Strength:
• Counts number of bullish timeframes
• Formula: (bullish_count / 6) × 100
• Range: 0% (all bearish) to 100% (all bullish)
Price Distance from EMA:
• Formula: ((close - EMA) / EMA) × 100
• Positive: Price above EMA
• Negative: Price below EMA
• Warning when absolute distance > 5%
ANTI-REPAINTING MEASURES
• All request.security() calls use lookahead=barmerge.lookahead_off
• Dashboard updates only on barstate.islast
• Historical bars remain unchanged
• Crossover signals finalize on bar close
═══════════════════════════════════════════════════════════
USAGE GUIDE
═══════════════════════════════════════════════════════════
INTERPRETING THE DASHBOARD
Timeframe Rows:
• Each row shows individual timeframe trend status
• Look for alignment (multiple timeframes same direction)
• Higher timeframes generally more significant
Strength Indicator:
• >66.67%: Strong bullish (4+ timeframes bullish)
• 33.33-66.67%: Mixed/choppy conditions
• <33.33%: Strong bearish (4+ timeframes bearish)
Quality Score:
• Higher stars = better confluence of factors
• 5-star setups have strongest multi-factor confirmation
• Lower scores may indicate weaker or conflicting signals
SUGGESTED APPLICATIONS
Trend Confirmation:
• Check if multiple timeframes confirm current chart trend
• Higher agreement = stronger trend confidence
• Use for position sizing decisions
Entry Timing:
• Wait for EMA crossover on chart timeframe
• Confirm with higher timeframe alignment
• Volume above average preferred
• RSI not in extreme zones
Divergence Detection:
• When lower timeframes diverge from higher
• May indicate trend exhaustion or reversal
• Requires additional confirmation
CUSTOMIZATION
EMA Settings:
• Adjust Fast/Slow lengths for different sensitivities
• Shorter periods = more responsive, more signals
• Longer periods = smoother, fewer signals
• Common alternatives: 10/30, 12/26, 50/200
Volume Filter:
• Enable for higher-quality signals (fewer false positives)
• Disable in always-liquid markets or for more signals
• Adjust MA length based on typical volume patterns
Display Options:
• Toggle EMAs, S/R levels, extended stats as needed
• Choose dashboard position to avoid chart overlap
• Adjust colors for visibility preferences
═══════════════════════════════════════════════════════════
ALERTS
═══════════════════════════════════════════════════════════
AVAILABLE ALERT CONDITIONS
1. Bullish EMA Cross (Volume Confirmed)
2. Bearish EMA Cross (Volume Confirmed)
3. Strong Bullish Alignment (4+ timeframes)
4. Strong Bearish Alignment (4+ timeframes)
5. Trend Strength Increasing (>16.67% jump)
6. Trend Strength Decreasing (>16.67% drop)
7. Excellent Trade Setup (5-star rating)
Alert messages use standard placeholders:
• {{ticker}} - Symbol name
• {{close}} - Current close price
• {{time}} - Bar timestamp
═══════════════════════════════════════════════════════════
LIMITATIONS & CONSIDERATIONS
═══════════════════════════════════════════════════════════
KNOWN LIMITATIONS
• Lower timeframe data may not be available on all symbols
• 1-minute data typically limited to recent history
• request.security() subject to TradingView data limits
• Dashboard requires screen space (may overlap on small screens)
• More complex calculations may affect load time on slower devices
NOT SUITABLE FOR
• Highly volatile/illiquid instruments (many false signals)
• News-driven markets during announcements
• Automated trading without additional filters
• Markets where EMA strategies don't perform well
DOES NOT PROVIDE
• Exact entry/exit prices
• Stop-loss or take-profit levels
• Position sizing recommendations
• Guaranteed profit signals
• Market predictions
═══════════════════════════════════════════════════════════
BEST PRACTICES
═══════════════════════════════════════════════════════════
RECOMMENDED USAGE
✓ Combine with price action analysis
✓ Use appropriate risk management
✓ Backtest on historical data before live use
✓ Adjust settings for specific market characteristics
✓ Wait for higher-quality setups in important trades
✓ Consider overall market context and fundamentals
NOT RECOMMENDED
✗ Using as standalone trading system without confirmation
✗ Trading every signal without discretion
✗ Ignoring risk management principles
✗ Trading without understanding the methodology
✗ Applying to unsuitable markets/timeframes
═══════════════════════════════════════════════════════════
EDUCATIONAL BACKGROUND
═══════════════════════════════════════════════════════════
EMA CROSSOVER STRATEGY
The Exponential Moving Average crossover is a classical trend-following technique:
• Golden Cross: Fast EMA crosses above Slow EMA (bullish signal)
• Death Cross: Fast EMA crosses below Slow EMA (bearish signal)
• Widely used since the 1970s in various markets
• More responsive than SMA due to exponential weighting
MULTI-TIMEFRAME ANALYSIS
Analyzing multiple timeframes helps traders:
• Identify alignment between short and long-term trends
• Reduce false signals from single-timeframe noise
• Understand market context across different horizons
• Make informed decisions about trade duration
VOLUME ANALYSIS
Volume confirmation adds reliability:
• High volume suggests institutional participation
• Low volume signals may indicate false breakouts
• Volume precedes price in many market theories
• Helps distinguish genuine moves from noise
═══════════════════════════════════════════════════════════
TECHNICAL IMPLEMENTATION
═══════════════════════════════════════════════════════════
CODE STRUCTURE
• Organized in clear sections with proper commenting
• Uses explicit type declarations (int, float, bool, color, string)
• Constants defined at top (BULLISH=1, BEARISH=-1, etc.)
• Functions documented with @function, @param, @returns
• Follows PineCoders naming conventions (camelCase variables)
PERFORMANCE OPTIMIZATION
• var keyword for table (created once, not every bar)
• Calculations cached where possible
• Dashboard updates only on last bar
• Minimal redundant security() calls
SECURITY IMPLEMENTATION
• Proper gaps and lookahead parameters
• No future data leakage
• Signals finalize on bar close
• Historical bars remain static
═══════════════════════════════════════════════════════════
VERSION INFORMATION
═══════════════════════════════════════════════════════════
Current Version: 2.0
Pine Script Version: 5
Last Updated: 2024
Developed by: Zakaria Safri
═══════════════════════════════════════════════════════════
SETTINGS REFERENCE
═══════════════════════════════════════════════════════════
EMA SETTINGS
• Fast EMA Length: 1-500 (default: 20)
• Slow EMA Length: 1-500 (default: 50)
VOLUME & MOMENTUM
• Use Volume Confirmation: true/false (default: true)
• Volume MA Length: 1-500 (default: 20)
• Show RSI Levels: true/false (default: true)
• RSI Length: 1-500 (default: 14)
PRICE ACTION FEATURES
• Show Price Distance: true/false (default: true)
• Show Key Levels: true/false (default: true)
• S/R Lookback Period: 10-500 (default: 50)
DISPLAY SETTINGS
• Show EMAs on Chart: true/false (default: true)
• Fast EMA Color: customizable (default: cyan)
• Slow EMA Color: customizable (default: orange)
• EMA Line Width: 1-5 (default: 2)
• Show Fill Between EMAs: true/false (default: true)
• Show Crossover Signals: true/false (default: true)
DASHBOARD SETTINGS
• Position: Top Left/Right, Bottom Left/Right
• Show Extended Statistics: true/false (default: true)
ALERT SETTINGS
• Alert on Multi-TF Alignment: true/false (default: true)
• Alert on Trend Strength Change: true/false (default: true)
═══════════════════════════════════════════════════════════
RISK DISCLAIMER
═══════════════════════════════════════════════════════════
This indicator is provided for educational and informational purposes only. It should not be considered financial advice or a recommendation to buy or sell any security.
IMPORTANT NOTICES:
• Past performance does not indicate future results
• All trading involves risk of capital loss
• No indicator guarantees profitable trades
• Always conduct independent research and analysis
• Use proper risk management and position sizing
• Consult a qualified financial advisor before trading
• The developer assumes no liability for trading losses
By using this indicator, you acknowledge that you understand these risks and accept full responsibility for your trading decisions.
═══════════════════════════════════════════════════════════
SUPPORT & CONTRIBUTIONS
═══════════════════════════════════════════════════════════
FEEDBACK WELCOME
• Constructive comments appreciated
• Bug reports help improve the indicator
• Feature suggestions considered for future versions
• Share your experience to help other users
OPEN SOURCE
This code is published as open source for the TradingView community to:
• Learn from the implementation
• Modify for personal use
• Understand multi-timeframe analysis techniques
If you find this indicator useful, please consider:
• Leaving a thoughtful review
• Sharing with other traders who might benefit
• Following for future updates and releases
═══════════════════════════════════════════════════════════
ADDITIONAL RESOURCES
═══════════════════════════════════════════════════════════
RECOMMENDED READING
• TradingView Pine Script documentation
• PineCoders community resources
• Technical analysis textbooks on moving averages
• Multi-timeframe trading strategy guides
• Risk management principles
RELATED CONCEPTS
• Trend following strategies
• Moving average convergence/divergence
• Multiple timeframe analysis
• Volume-price relationships
• Momentum indicators
═══════════════════════════════════════════════════════════
Thank you for using this indicator. Trade responsibly and continue learning!
═══════════════════════════════════════════════════════════
Alerts v6The strategy includes:
✅ EMA-based trend direction (fast vs slow)
✅ RSI filtering for overbought/oversold control
✅ ADX confirmation for strong trend validation
✅ Pullback & BOS detection for precision entries
✅ Per-bar change logic for adaptive entry timing
✅ Session/day gating to control trading hours
✅ JSON alert integration for AI trading bots or webhooks
This script is Pine Script v6 compatible and optimized for automated alert-based trading setups such as AI trading bots, webhook systems, and VPS-linked executions.
Recommended Timeframes: 5m, 15m, 30m
Markets: XAUUSD, FX pairs, indices, and metals
IIR One-Pole Price Filter [BackQuant]IIR One-Pole Price Filter
A lightweight, mathematically grounded smoothing filter derived from signal processing theory, designed to denoise price data while maintaining minimal lag. It provides a refined alternative to the classic Exponential Moving Average (EMA) by directly controlling the filter’s responsiveness through three interchangeable alpha modes: EMA-Length , Half-Life , and Cutoff-Period .
Concept overview
An IIR (Infinite Impulse Response) filter is a type of recursive filter that blends current and past input values to produce a smooth, continuous output. The "one-pole" version is its simplest form, consisting of a single recursive feedback loop that exponentially decays older price information. This makes it both memory-efficient and responsive , ideal for traders seeking a precise balance between noise reduction and reaction speed.
Unlike standard moving averages, the IIR filter can be tuned in physically meaningful terms (such as half-life or cutoff frequency) rather than just arbitrary periods. This allows the trader to think about responsiveness in the same way an engineer or physicist would interpret signal smoothing.
Why use it
Filters out market noise without introducing heavy lag like higher-order smoothers.
Adapts to various trading speeds and time horizons by changing how alpha (responsiveness) is parameterized.
Provides consistent and mathematically interpretable control of smoothing, suitable for both discretionary and algorithmic systems.
Can serve as the core component in adaptive strategies, volatility normalization, or trend extraction pipelines.
Alpha Modes Explained
EMA-Length : Classic exponential decay with alpha = 2 / (L + 1). Equivalent to a standard EMA but exposed directly for fine control.
Half-Life : Defines the number of bars it takes for the influence of a price input to decay by half. More intuitive for time-domain analysis.
Cutoff-Period : Inspired by analog filter theory, defines the cutoff frequency (in bars) beyond which price oscillations are heavily attenuated. Lower periods = faster response.
Formula in plain terms
Each bar updates as:
yₜ = yₜ₋₁ + alpha × (priceₜ − yₜ₋₁)
Where alpha is the smoothing coefficient derived from your chosen mode.
Smaller alpha → smoother but slower response.
Larger alpha → faster but noisier response.
Practical application
Trend detection : When the filter line rises, momentum is positive; when it falls, momentum is negative.
Signal timing : Use the crossover of the filter vs its previous value (or price) as an entry/exit condition.
Noise suppression : Apply on volatile assets or lower timeframes to remove flicker from raw price data.
Foundation for advanced filters : The one-pole IIR serves as a building block for multi-pole cascades, adaptive smoothers, and spectral filters.
Customization options
Alpha Scale : Multiplies the final alpha to fine-tune aggressiveness without changing the mode’s core math.
Color Painting : Candles can be painted green/red by trend direction for visual clarity.
Line Width & Transparency : Adjust the visual intensity to integrate cleanly with your charting style.
Interpretation tips
A smooth yet reactive line implies optimal tuning — minimal delay with reduced false flips.
A sluggish line suggests alpha is too small (increase responsiveness).
A noisy, twitchy line means alpha is too large (increase smoothing).
Half-life tuning often feels more natural for aligning filter speed with price cycles or bar duration.
Summary
The IIR One-Pole Price Filter is a signal smoother that merges simplicity with mathematical rigor. Whether you’re filtering for entry signals, generating trend overlays, or constructing larger multi-stage systems, this filter delivers stability, clarity, and precision control over noise versus lag, an essential tool for any quantitative or systematic trading approach.
Arnaud Legoux Gaussian Flow | AlphaNattArnaud Legoux Gaussian Flow | AlphaNatt
A sophisticated trend-following and mean-reversion indicator that combines the power of the Arnaud Legoux Moving Average (ALMA) with advanced Gaussian distribution analysis to identify high-probability trading opportunities.
🎯 What Makes This Indicator Unique?
This indicator goes beyond traditional moving averages by incorporating Gaussian mathematics at multiple levels:
ALMA uses Gaussian distribution for superior price smoothing with minimal lag
Dynamic envelopes based on Gaussian probability zones
Multi-layer gradient visualization showing probability density
Adaptive envelope modes that respond to market conditions
📊 Core Components
1. Arnaud Legoux Moving Average (ALMA)
The ALMA is a highly responsive moving average that uses Gaussian distribution to weight price data. Unlike simple moving averages, ALMA can be fine-tuned to balance responsiveness and smoothness through three key parameters:
ALMA Period: Controls the lookback window (default: 21)
Gaussian Offset: Shifts the Gaussian curve to adjust lag vs. responsiveness (default: 0.85)
Gaussian Sigma: Controls the width of the Gaussian distribution (default: 6.0)
2. Gaussian Envelope System
The indicator features three envelope calculation modes:
Fixed Mode: Uses ATR-based fixed width for consistent envelope sizing
Adaptive Mode: Dynamically adjusts based on price acceleration and volatility
Hybrid Mode: Combines ATR and standard deviation for balanced adaptation
The envelopes represent statistical probability zones. Price moving beyond these zones suggests potential mean reversion opportunities.
3. Momentum-Adjusted Envelopes
The envelope width automatically expands during strong trends and contracts during consolidation, providing context-aware support and resistance levels.
⚡ Key Features
Multi-Layer Gradient Visualization
The indicator displays 10 gradient layers between the ALMA and envelope boundaries, creating a visual "heat map" of probability density. This helps traders quickly assess:
Distance from the mean
Potential support/resistance strength
Overbought/oversold conditions in context
Dynamic Color Coding
Cyan gradient: Price below ALMA (bullish zone)
Magenta gradient: Price above ALMA (bearish zone)
The ALMA line itself changes color based on price position
Trend Regime Detection
The indicator automatically identifies market regimes:
Strong Uptrend: Trend strength > 0.5% with price above ALMA
Strong Downtrend: Trend strength < -0.5% with price below ALMA
Weak trends and ranging conditions
📈 Trading Strategies
Mean Reversion Strategy
Look for price entering the extreme Gaussian zones (beyond 95% of envelope width) when trend strength is moderate. These represent statistical extremes where mean reversion is probable.
Signals:
Long: Price in lower Gaussian zone with trend strength > -0.5%
Short: Price in upper Gaussian zone with trend strength < 0.5%
Trend Continuation Strategy
Enter when price crosses the ALMA during confirmed strong trend conditions, riding momentum while using the envelope as a trailing stop reference.
Signals:
Long: Price crosses above ALMA during strong uptrend
Short: Price crosses below ALMA during strong downtrend
🎨 Visualization Guide
The gradient layers create a "probability cloud" around the ALMA:
Darker shades (near ALMA): High probability zone - price tends to stay here
Lighter shades (near envelope edges): Lower probability - potential reversal zones
Price at envelope extremes: Statistical outliers - strongest mean reversion setups
⚙️ Customization Options
ALMA Parameters
Adjust period for different timeframes (lower for day trading, higher for swing trading)
Modify offset to tune responsiveness vs. smoothness
Change sigma to control distribution width
Envelope Configuration
Choose envelope mode based on market characteristics
Adjust multiplier to match instrument volatility
Modify gradient depth for visual preference (5-15 layers)
Signal Enhancement
Momentum Length: Lookback for trend strength calculation
Signal Smoothing: Additional EMA smoothing to reduce noise
🔔 Built-in Alerts
The indicator includes six pre-configured alert conditions:
ALMA Trend Long - Price crosses above ALMA in strong uptrend
ALMA Trend Short - Price crosses below ALMA in strong downtrend
Mean Reversion Long - Price enters lower Gaussian zone
Mean Reversion Short - Price enters upper Gaussian zone
Strong Uptrend Detected - Momentum confirms strong bullish regime
Strong Downtrend Detected - Momentum confirms strong bearish regime
💡 Best Practices
Use on clean, liquid markets with consistent volatility
Combine with volume analysis for confirmation
Adjust envelope multiplier based on backtesting for your specific instrument
Higher timeframes (4H+) generally provide more reliable signals
Use adaptive mode for trending markets, hybrid for mixed conditions
⚠️ Important Notes
This indicator works best in markets with normal price distribution
Extreme news events can invalidate Gaussian assumptions temporarily
Always use proper risk management - no indicator is perfect
Backtest parameters on your specific instrument and timeframe
🔬 Technical Background
The Arnaud Legoux Moving Average was developed to solve the classic dilemma of moving averages: the trade-off between lag and noise. By applying Gaussian distribution weighting, ALMA achieves superior smoothing while maintaining responsiveness to price changes.
The envelope system extends this concept by creating probability zones based on volatility and momentum, effectively mapping where price is "likely" vs "unlikely" to be found based on statistical principles.
Created by AlphaNatt - For educational purposes. Always practice proper risk management. Not financial advice. Always DYOR.
Advanced HMM - 3 States CompleteHidden Markov Model
Aconsistent challenge for quantitative traders is the frequent behaviour modification of financial
markets, often abruptly, due to changing periods of government policy, regulatory environment
and other macroeconomic effects. Such periods are known as market regimes. Detecting such
changes is a common, albeit difficult, process undertaken by quantitative market participants.
These various regimes lead to adjustments of asset returns via shifts in their means, variances,
autocorrelation and covariances. This impacts the effectiveness of time series methods that rely
on stationarity. In particular it can lead to dynamically-varying correlation, excess kurtosis ("fat
tails"), heteroskedasticity (volatility clustering) and skewed returns.
There is a clear need to effectively detect these regimes. This aids optimal deployment of
quantitative trading strategies and tuning the parameters within them. The modeling task then
becomes an attempt to identify when a new regime has occurred adjusting strategy deployment,
risk management and position sizing criteria accordingly.
A principal method for carrying out regime detection is to use a statistical time series tech
nique known as a Hidden Markov Model . These models are well-suited to the task since they
involve inference on "hidden" generative processes via "noisy" indirect observations correlated
to these processes. In this instance the hidden, or latent, process is the underlying regime state,
while the asset returns are the indirect noisy observations that are influenced by these states.
MAIN FEATURES OF THE INDICATOR
The "Advanced HMM - 3 States Complete" indicator is an advanced technical analysis tool that uses Hidden Markov Model (HMM) to identify three main market regimes: BULL, BEAR, and SIDEWAYS.
🎯 KEY FEATURES:
1. HMM-based Trend Detection
3 market states: Bull (0), Bear (1), Sideways (2)
Dynamic probabilities: Calculates probability for each state based on price data
Transition matrix: Models state transitions between regimes
2. Analytical Features
Price volatility: Log returns and standard deviation
Momentum: Rate of Change (ROC)
Volume: Volume ratio vs moving average
Data normalization: Standardizes features to common scale
3. Visual Trading Signals
text
📍 BUY Signals:
- Green upward triangle below bars
- "LONG" label in green
📍 SELL Signals:
- Red downward triangle above bars
- "SHORT" label in red
📍 EXIT Signals:
- Orange X marks when transitioning to sideways
4. Information Display
Probability table (top-right): Shows percentage for each state
State label: Current regime with probability percentages
Chart background color: Reflects dominant market state
5. Automated Alerts
Alerts when new Bull/Bear market detected
Alerts when market transitions to sideways
Configurable TradingView notifications
6. Customizable Parameters
pinescript
length: 100 // Lookback period
smoothing_period: 20 // Probability smoothing
volatility_threshold: 0.5 // Volatility threshold
💡 PRACTICAL APPLICATIONS:
Identify primary trends with quantified probabilities
Entry/exit signals based on state transitions
Risk management during sideways markets
Trend confirmation when combined with other indicators
This indicator is particularly useful for market regime analysis and identifying trend transition points using advanced statistical probability methods.
🔧 TECHNICAL IMPLEMENTATION:
Composite observation: Weighted combination of returns (40%), momentum (30%), and volatility (30%)
Gaussian emission probabilities: Different distributions for each state
Manual HMM updates: Avoids matrix computation limitations in Pine Script
Real-time smoothing: EMA applied to state probabilities
The indicator provides institutional-grade regime detection in a visually intuitive package suitable for both discretionary and systematic traders.
Match on Selectable Percentage Change + RangeIndicator Overview:
Match on Selectable Percentage Change + Range is a powerful analytical tool designed for traders and analysts who want to identify historical price bars that match a specific percentage variation, and then evaluate how price evolved in the following days. It combines precision filtering with visual tabular feedback, making it ideal for pattern recognition, backtesting, and scenario analysis.
What It Does
This indicator scans historical bars to find instances where the percentage change between two consecutive closes matches a user-defined target (± a customizable tolerance). Once matches are found, it displays:
The date of each match (most recent first)
The actual variation searched
The percentage change after 2, 10, 20, and 30 bars
The min-max range (in %) over those same periods
All results are shown in a dynamic table directly on the chart.
Inputs & Controls
Input Description
Which variation do you want to analyze? (%)
Set the target percentage change to look for (e.g. 2.5%)
% deviation from the variation to be considered (%) Define the tolerance range around the target (e.g. ±0.5%)
Bars to analyze (max 9999) Set how many past bars to scan
Show match table Toggle to enable/disable the entire table
Show percentage variations (2d, 10d, 20d, 30d) Toggle to show/hide post-match percentage changes
Show min-max ranges (2d, 10d, 20d, 30d) Toggle to show/hide post-match high/low ranges
Table Structure
Each row in the table represents a historical match. Columns include:
Date: When the match occurred
Variation in: The actual % change that triggered the match
2d / 10d / 20d / 30d: % change after those days
Min-Max 2d / 10d / 20d / 30d: Range of price movement after those days
Color coding helps quickly identify bullish (green) vs bearish (red) outcomes.
Use Cases
Backtesting: See how similar past moves evolved over time
Scenario modeling: Estimate potential outcomes after a known variation
Pattern recognition: Spot recurring setups or volatility clusters
Risk analysis: Understand post-variation drawdowns and upside potential
Tips for Use
Use tighter deviation (e.g. 0.3%) for precision, or wider (e.g. 1%) for broader pattern capture.
Combine with other indicators to validate setups (e.g. volume, RSI, trend filters).
Toggle off variation or range columns to focus only on the metrics you need.
Volume Profile Pro
Volume Profile Pro is an advanced market analysis tool that displays trading activity distribution across price levels. It identifies key market structure levels including Point of Control (POC), Value Area High (VAH), and Value Area Low (VAL) based on actual volume data.
ORIGINALITY & VALUE:
This indicator provides unique volume distribution analysis with intelligent timeframe detection, real-time profile development, and professional visualization. Unlike basic volume indicators, it calculates precise volume distribution across price levels and identifies high-volume nodes that act as dynamic support/resistance zones.
KEY FEATURES:
Smart Timeframe Detection - Automatically uses chart timeframe with manual override option
Value Area Calculation - Customizable percentage (68% recommended for standard deviation)
Real-time Profile Updates - Live developing profile during active trading sessions
Session Awareness - Adjusts for regular vs extended trading hours
Professional Visualization - Clean, customizable display with multiple placement options
Advanced Alert System - POC breach detection with multiple extension options
CORE COMPONENTS:
Point of Control (POC) - Price level with highest traded volume (market consensus price)
Value Area (VA) - Price range containing specified percentage of total volume
Value Area High (VAH) - Upper boundary of value area (Orange)
Value Area Low (VAL) - Lower boundary of value area (Bright Blue)
Volume Distribution - Visual histogram showing volume concentration at price levels
TRADING APPLICATIONS:
Dynamic Support/Resistance - POC and Value Area act as evolving S/R levels
Breakout Confirmation - Volume-backed breakouts from Value Area
Mean Reversion - Trading opportunities at Value Area boundaries
Market Structure - Understanding volume distribution and market acceptance
Risk Management - Using Value Area for strategic stop placement
SETUP INSTRUCTIONS:
Timeframe: Uses current chart timeframe by default (customizable in settings)
Value Area: Set to 68% for standard market profile or adjust based on volatility
Profile Placement: Choose Left for historical analysis or Right for current session
Alerts: Enable POC breach alerts for real-time trading signals
Visualization: Customize colors and widths to match your trading style
This indicator provides institutional-grade market structure analysis in an accessible format, helping traders identify high-probability trading zones based on actual volume data rather than just price action.






















