インジケーターとストラテジー
Simple candle pattern detector🕯️ Simple Candle Pattern Detector
A comprehensive Pine Script indicator that automatically detects and displays 15 popular candlestick patterns with a convenient reference table.
📊 Features
Real-time Pattern Detection : Automatically identifies candlestick patterns as they form
Visual Labels : Displays emoji-based labels directly on the chart for easy recognition
Reference Table : Shows all available patterns with descriptions and trading signals
Pattern Highlighting : Current pattern is highlighted in yellow in the reference table
Customizable Styling : Adjust table size, borders, and text sizes to your preference
Tooltips : Hover over pattern labels for detailed descriptions
🎯 Detected Patterns
Reversal Patterns
╥ Hammer - Bullish reversal after decline
🪢👤 Hanging Man - Bearish reversal at peak
╨ Inverted Hammer - Bullish reversal after decline
🌠 Shooting Star - Bearish reversal after rise
🐂⤴ Bullish Engulfing - Strong bullish reversal
🐻⤵ Bearish Engulfing - Strong bearish reversal
🐂‖ Tweezer Bottom - Support level, bullish signal
🐻‖ Tweezer Top - Resistance level, bearish signal
☀⭐ Morning Star - Three-candle bullish reversal
🌙⭐ Evening Star - Three-candle bearish reversal
Continuation Patterns
🛡🛡🛡 Three White Soldiers - Strong uptrend continuation
🐦⬛🐦⬛🐦⬛ Three Black Crows - Strong downtrend continuation
Indecision Patterns
┼ Doji - Market uncertainty
🐂👔 Bullish In-Neck - Weak bullish signal
🐻👔 Bearish In-Neck - Weak bearish signal
⚙️ Customization Options
Table Style Settings
Table Rows (5-30): Adjust the number of visible rows
Border Width (0-5): Change cell border thickness
Frame Width (0-10): Adjust outer frame thickness
Text Size Settings
Header Text Size : Customize column header size
Pattern Text Size : Adjust emoji pattern display size
Description Text Size : Change description text size
🚀 How to Use
Add to Chart : Apply the indicator to any timeframe
Watch for Labels : Pattern labels appear above candles when detected
Check the Table : Reference table shows all patterns (top-right by default)
Current Pattern : Active pattern is highlighted in yellow
Hover for Details : Tooltips provide full pattern description
💡 Trading Tips
⚠️ Important : This indicator is for educational purposes. Always:
Confirm patterns with other technical indicators
Consider overall market trend and context
Use proper risk management
Practice on demo accounts first
Never rely on a single indicator for trading decisions
📈 Best Practices
Multi-Timeframe Analysis : Check patterns across different timeframes
Volume Confirmation : Verify patterns with volume indicators
Support/Resistance : Look for patterns near key levels
Trend Context : Reversal patterns work best at trend extremes
Continuation Patterns : Most effective within established trends
🔧 Technical Details
Version : Pine Script v6
Overlay : Yes (displays on price chart)
Performance : Lightweight, minimal resource usage
Compatibility : Works on all timeframes and instruments
📝 Pattern Detection Logic
Each pattern uses specific mathematical criteria:
Body size : |close - open|
Upper shadow : high - max(open, close)
Lower shadow : min(open, close) - low
Ratios : Customized for each pattern type
🎨 Visual Design
Clean, modern table design
Emoji-based pattern representation for
FOREXSOM EMA Crossover Buy & Sell IndicatorFOREXSOM EMA Crossover Buy & Sell Indicator
The FOREXSOM EMA Crossover Buy & Sell Indicator is a lightweight technical analysis tool designed to help traders visualize trend direction and momentum shifts using a dual Exponential Moving Average (EMA) framework.
This script plots a fast EMA and a slow EMA on the price chart and highlights potential BUY and SELL points when a crossover occurs. While EMA crossovers are a well-known concept, this indicator focuses on clarity, simplicity, and practical usability, making it suitable for traders who want a clean visual representation of trend changes without additional complexity.
How the indicator works
A BUY signal is displayed when the fast EMA crosses above the slow EMA, indicating a potential bullish momentum shift.
A SELL signal is displayed when the fast EMA crosses below the slow EMA, indicating a potential bearish momentum shift.
Both EMA lengths are fully adjustable, allowing users to adapt the indicator to different markets, timeframes, and personal trading preferences.
What makes this script useful
Clear visual signals directly on the chart
Adjustable EMA parameters for flexibility
Minimal design that does not clutter the chart
Works across Forex, stocks, indices, and cryptocurrencies
Can be combined with market structure, support and resistance, or higher-timeframe analysis
Usage notes and limitations
EMA crossover signals are most effective in trending market conditions and may generate false signals during sideways or low-volatility periods. This indicator does not attempt to predict price movement or filter market conditions on its own.
This script is intended for educational and technical analysis purposes only. It does not provide financial advice and does not guarantee trading outcomes. Users should apply proper risk management and use additional confirmation methods when making trading decisions.
GOLD SMC + SR Breaks + Channels
GOLD SMC + SR Breaks + Channels
GOLD SMC + SR Breaks + Channels is an all-in-one indicator designed to quickly identify the market’s most likely reaction zones and build a clean, structured trade plan—without cluttering the chart.
1) Institutional Zones (probable reactions)
Automatically detects supply and demand zones based on price structure (swing highs / swing lows).
Draws clear horizontal zones extended to the right to act as reference areas for reactions, rejections, or reversals.
“Clean” display options: ability to hide text, hide POIs, limit the number of visible zones, and fade older zones to keep the chart readable.
2) Support / Resistance validated by volume
Adds support and resistance zones filtered by significant volume, helping highlight levels that are genuinely defended by the market.
Provides clear reading signals:
level holds (reaction/defense),
level breaks (breakout),
potential flips: former support → resistance and vice versa.
3) Dynamic channels + internal areas
Draws adaptive channels that follow the current market rhythm.
Displays a full structure: upper/lower boundaries, a central area, and intermediate zones (useful for spotting extensions and mean-reversion moves).
Flags channel breaks to signal a change of pace or an invalidation of the previous structure.
4) Candlestick pattern detection in key areas
Highlights certain candlestick patterns only when they appear in relevant channel zones (reaction / reversal areas), avoiding useless signals in the middle of nowhere.
What it’s for (in practice)
Spot where the market is most likely to react (zones + levels + structure).
Reduce noise thanks to readability filters.
Build a plan: zone → confirmation → timing, with clear references for entry / invalidation / targets.
Trend Following MACD + MA Ribbon+ADX+CMOTraders - this is a trend following strategy, It uses MACD, ADX, and EMA 1 & EMA 3 during the entry. For the exits, it uses price action piercing EMA 2, along the Chande Momentum Oscillator. For those not familiar, this is a cousin to the RSI, and Stocastic and responds very well to fast moving changes of regime. I have used this mostly with crypto currency, but other assets may work well. Enjoy and safe trading
B52 BOMBER ENHANCED V4B52 BOMBER ENHANCED V4 – Advanced MA Ribbon & Market Intelligence System
B52 Bomber Enhanced V4 is a professional-grade multi-moving average ribbon system designed to deliver real-time trend intelligence, volatility state analysis, and volume-based confluence across short-, medium-, and long-term timeframes.
This indicator goes far beyond traditional MA ribbons by combining adaptive slopes, ribbon width dynamics, volume-weighted logic, and an advanced dashboard into a single, decision-focused tool.
🔹 Core Capabilities
📈 Multi-Timeframe MA Architecture
9 Moving Averages grouped into:
Short-Term (ST) – execution & momentum
Medium-Term (MT) – trend confirmation
Long-Term (LT) – market bias
Global MA type selection: EMA, SMA, WMA, HMA, ALMA, DEMA, TEMA, VWMA, SMMA
Preset trading modes:
Scalping
Day Trading
Swing Trading
Position Trading
🧠 Advanced Trend Intelligence
Immediate + Medium + Dynamic Reference Slope Engine
Ultra-responsive slope detection for early reversals
Optional angle-based strength amplification
Accurate trend classification:
Strong Bull / Bull / Mild Bull
Flat
Mild Bear / Bear / Strong Bear
📊 Ribbon Width & Volatility State Engine
Ribbon width = volatility & energy measurement
Automatic state classification:
Explosive Compression
Weak Compression
Stable
Weak Expansion
Explosive Expansion
Width percentile & acceleration analysis to anticipate breakouts
🔥 Volume & Institutional Participation Analysis
Volume-weighted moving averages (dynamic VWMA blending)
Volume Spike Detection (2x / 5x / 10x)
Advanced volume metrics:
Volumetric Slope
Volume Delta
Cumulative Volume Delta (CVD)
Combined Confluence Score with letter grading (A+ → F)
🖥️ Professional Dashboard
Compact, Minimal, and Full modes
Displays at a glance:
Trend alignment (ST / MT / LT)
Slope health
Strength score (0–100)
Ribbon state
Width trend & percentile
Trend duration (bars)
Volume & confluence metrics
Optional Higher Timeframe (HTF) analysis:
Market structure
Volatility regime
RSI momentum
EMA trend alignment
HTF confluence score
☁️ Visual Enhancements
MA clouds for trend thickness
Background trend zones for full alignment
Early trend change signals
Fully customizable colors, widths, and visibility
🔹 How to Use
Trend Trading
Look for ribbon compression followed by expansion
Trade in the direction of full ST/MT/LT alignment
Confirm with volume confluence and strength score
Breakout Anticipation
Monitor extreme compression percentiles
Wait for width acceleration + volume confirmation
Risk Management
Avoid trades during mixed confluence or flat slopes
Use ribbon over-expansion as a late-trend warning
🔹 Best Suited For
Scalping, intraday, swing, and positional trading
Index, forex, crypto, and equities
Traders who want context, not just signals
⚠️ Disclaimer
This indicator is a market analysis and decision-support tool, not a standalone buy/sell signal generator.
Always combine with proper risk management and personal trading rules.
GMS EMA'sGMS EMA’s is a clean, structure-focused indicator designed to help traders understand trend direction, market structure, and momentum shifts without cluttering the chart.
This indicator combines key exponential moving averages with internal and external market structure, Break of Structure (BOS), and Change of Character (CHOCH) logic to support discretionary, price-action-based trading.
It does not provide buy or sell signals. Instead, it helps traders read the market clearly and make informed decisions.
🔹 What’s Included
9 / 20 / 200 EMA system
Toggle each EMA on or off to match your trading style.
Internal & External Structure Detection
Clearly labeled swing highs and lows:
ISH / ISL (internal)
ESH / ESL (external)
Break of Structure (BOS)
Identifies structure continuation in the direction of the trend.
Change of Character (CHOCH)
Highlights potential shifts in momentum and early trend transitions.
Custom Structure Mode
View internal structure, external structure, or both.
Clean, candle-based visualization
No oscillators, no separate panels, no zigzag lines.
🔹 Who This Indicator Is For
Price-action traders
Structure-based traders
Forex, indices, crypto, and futures traders
Traders using top-down analysis
Traders who prefer clarity over complexity
🔹 How to Use
Use the 200 EMA and external structure to determine market bias.
Look for BOS to confirm trend continuation.
Use internal structure to refine entries.
Treat CHOCH as a warning, not a signal.
🔹 Philosophy
GMS EMA’s is built on the idea that less information leads to better decisions.
It’s designed to support discipline, awareness, and structure-based thinking — not to replace it.
Disclaimer:
This indicator is for educational purposes only and does not constitute financial advice. Always manage risk appropriately.
Market StructureAll credits to original inventor @SimpleCryptoLife True Market Structure.
Added a table for higher time frame and a toggle option.
[CT] Smart Supertrend Smart Supertrend is an overlay trend and context indicator that combines three different ideas into one visual: a dynamic “cloud” that adapts to market cycle speed, a pivot-point anchored trailing line that behaves like a smarter Supertrend, and an ADX strength filter that helps separate real trends from noisy sideways movement. It is designed to keep you aligned with the dominant direction while giving you a clean framework for entries, pullbacks, and exits.
The “cloud” is the heart of the script’s regime read. Internally, it builds an adaptive smoothing engine that reacts to how efficiently the price is moving. When the price is moving in a clean, directional way, the cloud becomes more responsive. When the price is choppy and overlapping, the cloud becomes slower and steadier. The cloud itself is drawn as two lines, Cloud A and Cloud B, and the filled area between them. When the adaptive KAMA slope is rising, the cloud is treated as bullish and uses your Up color. When it is falling, the cloud is treated as bearish and uses your Down color. This creates a quick visual of whether the market is behaving like an uptrend regime or a downtrend regime without relying on one fixed moving average length that can be too fast in chop or too slow in trend.
The PP line is the trade management spine. It is built from pivot logic that detects meaningful swing highs and swing lows using your PP Period. Those pivots are blended into a centerline, and then an ATR band is applied around that center using your ATR Period and ATR Factor. That band is turned into a trailing line that “ratchets” in the direction of the current trend. When the price is above the trailing logic, the script considers the trend state to be long. When the price is below, it considers the trend state to be short. The reason this feels different from a basic Supertrend is that the anchor comes from pivots and smoothing rather than only a direct ATR band around price, so it tends to track structure more naturally and reduce some of the fast flipping you see in choppy sections.
The ADX filter is the quality control layer. It computes plus DI, minus DI, and ADX over your ADX Length, and then checks whether ADX is above your threshold. When ADX is above the threshold, it suggests the market is trending enough for trend signals to matter. When ADX is below the threshold, the script is telling you the environment is more sideways, which is where most trend systems get chopped up. In the original logic, the “best” conditions occur when the cloud direction agrees with the DI direction, and ADX is strong, because that means direction and strength are aligned.
How you trade it starts with using the cloud as your directional bias. When the cloud is bullish, you prioritize longs and you treat shorts as lower quality or countertrend. When the cloud is bearish, you prioritize shorts and you treat longs as lower quality. Next, you use the PP line as the “line in the sand” for trend state and risk placement. In a bullish environment, price holding above the PP line is your confirmation that the structure-anchored trailing level is supporting the move. In a bearish environment, price holding below the PP line is your confirmation that the trailing level is capping rallies.
A clean, practical entry approach is to wait for agreement between the cloud and the PP line, then take pullbacks into that framework. For long trades, the highest quality setups occur when the cloud is bullish, the PP line is below price, and ADX is above the threshold with plus DI leading minus DI. In that state, you can look for pullbacks that dip toward the PP line or into the cloud region and then reject back upward, because you’re buying a retracement inside a confirmed trend regime rather than chasing extension. For short trades, the mirror applies: the cloud is bearish, the PP line is above price, ADX is above the threshold with minus DI leading, and you sell rallies back into the PP line or cloud that fail and rotate down.
Stops and exits can be built around the PP line because it is already an ATR-based trailing structure level. For a long, a conservative stop is placed just below the PP line with a buffer related to ATR, because if price closes and holds below that line you are likely seeing a trend condition break. For a short, the stop goes just above the PP line with a similar buffer. For profit taking, many traders scale out when price stretches far away from the PP line or when the cloud begins to lose slope and compress, because that often signals trend momentum is slowing. Another simple exit rule is to reduce or close when the PP line flips trend state against your position, or when the ADX falls back under the threshold after a run, because that frequently marks a transition into consolidation where trailing systems can give back gains.
If you enable signals in versions that plot them, the logic is meant to highlight moments when the PP line flips trend and the cloud is not contradicting that flip, then further filters those into “higher quality” conditions when cloud direction and ADX trend strength agree. In practice, you should still treat signals as prompts, not automatic trades. The best results come from using the signal as a timing cue while you still enforce the bigger rule of alignment: cloud direction, PP line trend state, and ADX strength all pointing the same way, with entries taken on pullbacks rather than on late breakout candles.
Finally, be aware that all adaptive smoothing systems will look different across markets and timeframes, so the main tuning knobs are your Cloud Length, PP Period, ATR Factor, and ADX Threshold. If you want fewer flips and more “position trading” behavior, increase the ATR Factor and consider a higher ADX threshold. If you want earlier entries and more sensitivity, lower ATR Factor and lower the threshold, but expect more chop. The indicator is at its best when you treat it as a regime and structure tool: let the cloud tell you the side, let the PP line define where you are wrong, and let ADX decide whether it’s a trend day or a chop day before you commit size.
Abertura do Dia juscy# Complete Description of TradingView Code: "Daily Open + Moving Averages"
## Overview
This is an advanced TradingView indicator (Pine Script v5) that combines multiple visual elements and technical analysis tools focused on the daily opening price. The indicator is highly customizable and allows traders to quickly visualize key levels based on the daily opening price, plus includes optional moving averages.
## Structure and Main Functionalities
### 1. **Initial Settings**
- **Indicator name**: "Daily Open + Moving Averages"
- **Overlay**: True (draws directly on the price chart)
- **Maximum lines**: 500 (to avoid system overload)
### 2. **Visual Elements Based on Daily Open**
#### **Dynamic Vertical Line**
- Drawn on the first candle of each day
- Automatically adjusts its height to reflect the daily high and low
- Updated in real-time as new extremes form
- Customizable color and transparency
#### **Horizontal Opening Line**
- Dashed line marking the daily opening price
- Extends horizontally throughout the entire session
- Serves as reference for percentage movements
#### **Percentage Levels**
- Four levels calculated relative to the opening:
- +0.5% (green/up)
- +1.0% (green/up)
- -0.5% (red/down)
- -1.0% (red/down)
- Useful for identifying nearby support/resistance zones
#### **Daily VWAP (Volume Weighted Average Price)**
- Calculates volume-weighted average price for each day
- Optional (can be disabled for better performance)
- Updated in real-time during the session
### 3. **Moving Averages System**
The indicator includes 7 popular moving averages:
- **EMA 9**: 9-period exponential moving average (short-term)
- **SMA 12**: 12-period simple moving average
- **SMA 21**: 21-period simple moving average (common in strategies)
- **SMA 34**: 34-period simple moving average
- **SMA 55**: 55-period simple moving average (medium-term)
- **SMA 89**: 89-period simple moving average
- **SMA 200**: 200-period simple moving average (long-term)
Each moving average can be individually enabled/disabled and has customizable colors.
### 4. **Technical Architecture**
#### **Daily State Management**
- Uses `ta.change(time("D"))` to detect new days
- Stores key variables: `daily_open`, `daily_high`, `daily_low`
- Tracks opening bar index (`day_start_bar`)
#### **Array System for Lines**
- Uses arrays (`array.new_line()`) to store and manage graphic lines
- Allows efficient updating of visual elements
- Avoids accumulation of unnecessary graphic objects
#### **Update Logic**
- **During the day**: Updates extremes and VWAP
- **Day change**: Reinitializes variables and creates new elements
- **Last candle**: Extends horizontal lines to end of chart
#### **Performance Control**
- Use of `barstate.islastconfirmedhistory` and `barstate.isrealtime` for optimization
- Conditional creation of visual elements
- Implicit cleanup through replacement of old lines
### 5. **User Interface**
#### **Organized Configuration Groups**
1. **General Settings**: Line transparency and thickness
2. **Visual Elements**: Controls for each graphic component
3. **Moving Averages**: Enable/disable each moving average
4. **Colors**: Complete color customization for all elements
#### **Display Options**
All functionalities can be enabled/disabled:
- Vertical and horizontal lines
- Percentage levels
- VWAP
- Each moving average individually
### 6. **Practical Applications**
#### **For Day Traders**
- Quick identification of daily open as reference level
- Visualization of ±0.5% and ±1.0% zones for targets and stops
- VWAP as dynamic support/resistance level
#### **For Swing Traders**
- Multiple moving averages for trend analysis
- Daily context on important levels
- Combination of intraday and position analysis
#### **For Technical Analysis**
- Study of reactions at opening price
- Identification of daily trading ranges
- Level confluence (opening + moving averages)
### 7. **Design Advantages**
- **Modular**: Each component can be disabled
- **Efficient**: Careful management of graphic resources
- **Customizable**: Adjustable colors, thicknesses, and visibility
- **Real-time**: Automatically updates during session
- **Multi-timeframe**: Useful across various timeframes (from 1 minute to daily)
### 8. **Usage Considerations**
- Best performance on liquid assets
- Most useful in markets with defined openings (stocks, futures)
- Can be combined with other indicators
- Recommended to use alongside volume analysis
This indicator serves as a complete visual "workstation," providing multiple layers of information in a single overlay, facilitating decision-making based on key levels derived from the daily opening price.
Three pillar rule + YTD line with color coding in the info boxThe script objectively shows you whether a market should be "held" from an annual, trend and YTD point of view - or not.
The infobox summarizes all three core statements:
Component statement
Beginning of the year: Was the start of the year positive?
YTD: Is the market above last year's level?
SMA: Is the market above the long-term trend? Positive?
Representation in the info box
Arrows/symbols (configurable)
Green/Red
Freely positionable in the chart
Typical use in practice
1. As bias filter
"Am I acting more long or defensive today?"
2. For position trading
"Can I buy pullbacks or just sell them?"
3. For Investments/ETFs/Crypto
"Hold or reduce risk?"
The script is not a
❌ No entry signal
❌ No exit signal
❌ No short-term trading indicator
The script follows Andre Stagge's three-thumb rule
First Candle RuleCaptures the 09:30–09:35 EST opening range on a 5-minute chart
Draws the high/low lines, optional midline, and a shaded box until 16:30 EST
Computes breakout signals every bar and then gates them by session/range readiness to satisfy the consistency warning
Multi TF Cierre de velas mayoresCuenta regresiva para el cierre de velas de H4, H8, H12 y TM personalizado
Overnight QQQ/ NQ Auto LevelsUsing QQQ Overnight pricing to have correct levels on the NQ Future Chart.
SOL Short EMA165 Failed ReclaimThis script identifies short opportunities on SOL when price attempts to reclaim the EMA 165 but fails.
A signal is generated when price trades above the EMA 165 and then closes back below it on the selected timeframe.
The script plots the EMA 165 and triggers an alert() for use with external execution (e.g. Bitget signal bots).
Designed for reliability and clean alert execution.
MACD Histogram Expansion Alerts (Scalp)Purpose: Alerts when MACD histogram is expanding (momentum increasing) rather than simply crossing. Designed for 1-minute scalping and intraday momentum confirmation.
This script is for traders who are tired of late MACD cross alerts.
Instead of firing when MACD lines cross (which often happens after the move), this indicator alerts when the MACD histogram is expanding — meaning momentum is actually increasing right now, not rolling over.
I use it as a “heads up” alert, not a buy/sell signal. When it fires, I check price action, volume, VWAP, support/resistance, etc., to see if the move is worth trading.
Best suited for 1-minute charts, scalping, and fast intraday momentum.
MACD Histogram Expansion Alerts (Scalp) is a lightweight alert-focused indicator designed for intraday traders and scalpers, particularly on lower timeframes such as the 1-minute chart.
Rather than triggering alerts on standard MACD line crossovers (which tend to lag in fast or volatile markets), this script detects MACD histogram expansion — a condition that indicates momentum acceleration, not just direction.
🔍 What this script does
Uses a fast MACD configuration suitable for lower timeframes
Monitors the MACD histogram slope and magnitude
Triggers alerts only when the histogram expands for multiple consecutive bars
Alerts are fired on bar close only, reducing noise and false intrabar signals
🚀 Why focus on histogram expansion?
Histogram expansion highlights when momentum is building, which can be useful for:
Continuation setups
Early momentum confirmation
Avoiding entries when momentum is already fading
This approach is especially helpful in small caps, news-driven stocks, and volatile intraday instruments, where traditional MACD cross alerts can arrive too late.
🔔 Alert Types
Bullish MACD Histogram Expansion
Bearish MACD Histogram Expansion
Each alert can be enabled independently and is intended as an attention signal, not a standalone trading system.
⚙️ Customizable Inputs
MACD Fast / Slow / Signal lengths
Number of consecutive expanding histogram bars required
Optional minimum histogram magnitude filter
Optional directional filter (above/below zero line)
⚠️ Important Notes!!!!
This script does not place trades
Alerts should be used with additional context, such as price action, volume, VWAP, or support/resistance
Not designed for higher-timeframe or swing trading use .
If you find this helpful, feel free to adapt it to your own trading style or timeframe. This script is meant to be simple, flexible, and non-opinionated.
NQ Scalp EMA Reclaim EMA Momentum Pullback Indicator
What it does (typical EMA method used for momentum trading):
Trend filter: Fast EMA above Slow EMA = bullish bias; below = bearish bias
Entry: In bullish bias, wait for a pullback to the EMA “zone”, then a reclaim candle → BUY
In bearish bias, pullback into zone then rejection → SELL
Optional 200 EMA filter (only take longs above 200, shorts below 200)
Timeframe WatermarkA clean, minimal watermark indicator that displays the current chart timeframe as a large, semi-transparent text overlay.
Features:
Automatically formats timeframes (1M, 15M, 1H, 4H, 1D, 1W, etc.)
Fully customizable appearance
9 position options (corners, edges, center)
Adjustable transparency for non-intrusive display
Works on all chart types and timeframes
Settings:
Appearance
Color : Watermark text color (default: gray)
Transparency : 0 = solid, 100 = invisible (default: 85)
Size : Tiny / Small / Normal / Large / Huge
Position
Vertical : Top / Middle / Bottom
Horizontal : Left / Center / Right
Use Cases:
Quick timeframe reference when analyzing multiple charts
Screenshot clarity for sharing chart analysis
Multi-monitor setups where timeframe visibility matters
Lightweight overlay indicator with zero impact on chart performance.
[GYTS] VolatilityToolkit LibraryVolatilityToolkit Library
🌸 Part of GoemonYae Trading System (GYTS) 🌸
🌸 --------- INTRODUCTION --------- 🌸
💮 What Does This Library Contain?
VolatilityToolkit provides a comprehensive suite of volatility estimation functions derived from academic research in financial econometrics. Rather than relying on simplistic measures, this library implements range-based estimators that extract maximum information from OHLC data — delivering estimates that are 5–14× more efficient than traditional close-to-close methods.
The library spans the full volatility workflow: estimation, smoothing, and regime detection.
💮 Key Categories
• Range-Based Estimators — Parkinson, Garman-Klass, Rogers-Satchell, Yang-Zhang (academically-grounded variance estimators)
• Classical Measures — Close-to-Close, ATR, Chaikin Volatility (baseline and price-unit measures)
• Smoothing & Post-Processing — Asymmetric EWMA for differential decay rates
• Aggregation & Regime Detection — Multi-horizon blending, MTF aggregation, Volatility Burst Ratio
💮 Originality
To the best of our knowledge, no other TradingView script combines range-based estimators (Parkinson, Garman-Klass, Rogers-Satchell, Yang-Zhang), classical measures, and regime detection tools in a single package. Unlike typical volatility implementations that offer only a single method, this library:
• Implements four academically-grounded range-based estimators with proper mathematical foundations
• Handles drift bias and overnight gaps, issues that plague simpler estimators in trending markets
• Integrates with GYTS FiltersToolkit for advanced smoothing (10 filter types vs. typical SMA-only)
• Provides regime detection tools (Burst Ratio, MTF aggregation) for systematic strategy integration
• Standardises output units for seamless estimator comparison and swapping
🌸 --------- ADDED VALUE --------- 🌸
💮 Academic Rigour
Each estimator implements peer-reviewed methodologies with proper mathematical foundations. The library handles aspects that are easily missed, e.g. drift independence, overnight gap adjustment, and optimal weighting factors. All functions include guards against edge cases (division by zero, negative variance floors, warmup handling).
💮 Statistical Efficiency
Range-based estimators extract more information from the same data. Yang-Zhang achieves up to 14× the efficiency of close-to-close variance, meaning you can achieve the same estimation accuracy with far fewer bars — critical for adapting quickly to changing market conditions.
💮 Flexible Smoothing
All estimators support configurable smoothing via the GYTS FiltersToolkit integration. Choose from 10 filter types to balance responsiveness against noise reduction:
• Ultimate Smoother (2-Pole / 3-Pole) — Near-zero lag; the 3-pole variant is a GYTS design with tunable overshoot
• Super Smoother (2-Pole / 3-Pole) — Excellent noise reduction with minimal lag
• BiQuad — Second-order IIR filter with quality factor control
• ADXvma — Adaptive smoothing based on directional volatility
• MAMA — Cycle-adaptive moving average
• A2RMA — Adaptive autonomous recursive moving average
• SMA / EMA — Classical averages (SMA is default for most estimators)
Using Infinite Impulse Response (IIR) filters (e.g. Super Smoother, Ultimate Smoother) instead of SMA avoids the "drop-off artefact" where volatility readings crash when old spikes exit the window.
💮 Plug-and-Play Integration
Standardised output units (per-bar log-return volatility) make it trivial to swap estimators. The annualize() helper converts to yearly volatility with a single call. All functions work seamlessly with other GYTS components.
🌸 --------- RANGE-BASED ESTIMATORS --------- 🌸
These estimators utilise High, Low, Open, and Close prices to extract significantly more information about the underlying diffusion process than close-only methods.
💮 parkinson()
The Extreme Value Method -- approximately 5× more efficient than close-to-close, requiring about 80% less data for equivalent accuracy. Uses only the High-Low range, making it simple and robust.
• Assumption: Zero drift (random walk). May be biased in strongly trending markets.
• Best for: Quick volatility reads when drift is minimal.
• Parameters: smoothing_length (default 14), filter_type (default SMA), smoothing_factor (default 0.7)
Source: Parkinson, M. (1980). The Extreme Value Method for Estimating the Variance of the Rate of Return. Journal of Business, 53 (1), 61–65. DOI
💮 garman_klass()
Extends Parkinson by incorporating Open and Close prices, achieving approximately 7.4× efficiency over close-to-close. Implements the "practical" analytic estimator (σ̂²₅) which avoids cross-product terms whilst maintaining near-optimal efficiency.
• Assumption: Zero drift, continuous trading (no gaps).
• Best for: Markets with minimal overnight gaps and ranging conditions.
• Parameters: smoothing_length (default 14), filter_type (default SMA), smoothing_factor (default 0.7)
Source: Garman, M.B. & Klass, M.J. (1980). On the Estimation of Security Price Volatilities from Historical Data. Journal of Business, 53 (1), 67–78. DOI
💮 rogers_satchell()
The drift-independent estimator correctly isolates variance even in strongly trending markets where Parkinson and Garman-Klass become significantly biased. Uses the formula: ln(H/C)·ln(H/O) + ln(L/C)·ln(L/O).
• Key advantage: Unbiased regardless of trend direction or magnitude.
• Best for: Trending markets, crypto (24/7 trading with minimal gaps), general-purpose use.
• Parameters: smoothing_length (default 14), filter_type (default SMA), smoothing_factor (default 0.7)
Source: Rogers, L.C.G. & Satchell, S.E. (1991). Estimating Variance from High, Low and Closing Prices. Annals of Applied Probability, 1 (4), 504–512. DOI
💮 yang_zhang()
The minimum-variance composite estimator — both drift-independent AND gap-aware. Combines overnight returns, open-to-close returns, and the Rogers-Satchell component with optimal weighting to minimise estimator variance. Up to 14× more efficient than close-to-close.
• Parameters: lookback (default 14, minimum 2), alpha (default 1.34, optimised for equities).
• Best for: Equity markets with significant overnight gaps, highest-quality volatility estimation.
• Note: Unlike other estimators, Yang-Zhang does not support custom filter types — it uses rolling sample variance internally.
Source: Yang, D. & Zhang, Q. (2000). Drift-Independent Volatility Estimation Based on High, Low, Open, and Close Prices. Journal of Business, 73 (3), 477–491. DOI
🌸 --------- CLASSICAL MEASURES --------- 🌸
💮 close_to_close()
Classical sample variance of logarithmic returns. Provided primarily as a baseline benchmark — it is approximately 5–8× less efficient than range-based estimators, requiring proportionally more data for the same accuracy.
• Parameters: lookback (default 14), filter_type (default SMA), smoothing_factor (default 0.7)
• Use case: Comparison baseline, situations requiring strict methodological consistency with academic literature.
💮 atr()
Average True Range -- measures volatility in price units rather than log-returns. Directly interpretable for stop-loss placement (e.g., "2× ATR trailing stop") and handles gaps naturally via the True Range formula.
• Output: Price units (not comparable across different price levels).
• Parameters: smoothing_length (default 14), filter_type (default SMA), smoothing_factor (default 0.7)
• Best for: Position sizing, trailing stops, any application requiring volatility in currency terms.
Source: Wilder, J.W. (1978). New Concepts in Technical Trading Systems . Trend Research.
💮 chaikin_volatility()
Rate of Change of the smoothed trading range. Unlike level-based measures, Chaikin Volatility shows whether volatility is expanding or contracting relative to recent history.
• Output: Percentage change (oscillates around zero).
• Parameters: length (default 10), roc_length (default 10), filter_type (default EMA), smoothing_factor (default 0.7)
• Interpretation: High values suggest nervous, wide-ranging markets; low values indicate compression.
• Best for: Detecting volatility regime shifts, breakout anticipation.
🌸 --------- SMOOTHING & POST-PROCESSING --------- 🌸
💮 asymmetric_ewma()
Differential smoothing with separate alphas for rising versus falling volatility. Allows volatility to spike quickly (fast reaction to shocks) whilst decaying slowly (stability). Essential for trailing stops that should widen rapidly during turbulence but narrow gradually.
• Parameters: alpha_up (default 0.1), alpha_down (default 0.02).
• Note: Stateful function — call exactly once per bar.
💮 annualize()
Converts per-bar volatility to annualised volatility using the square-root-of-time rule: σ_annual = σ_bar × √(periods_per_year).
• Parameters: vol (series float), periods (default 252 for daily equity bars).
• Common values: 365 (crypto), 52 (weekly), 12 (monthly).
🌸 --------- AGGREGATION & REGIME DETECTION --------- 🌸
💮 weighted_horizon_volatility()
Blends volatility readings across short, medium, and long lookback horizons. Inspired by the Heterogeneous Autoregressive (HAR-RV) model's recognition that market participants operate on different time scales.
• Default horizons: 1-bar (short), 5-bar (medium), 22-bar (long).
• Default weights: 0.5, 0.3, 0.2.
• Note: This is a weighted trailing average, not a forecasting regression. For true HAR-RV forecasting, it would be required to fit regression coefficients.
Inspired by: Corsi, F. (2009). A Simple Approximate Long-Memory Model of Realized Volatility. Journal of Financial Econometrics .
💮 volatility_mtf()
Multi-timeframe aggregation for intraday charts. Combines base volatility with higher-timeframe (Daily, Weekly, Monthly) readings, automatically scaling HTF volatilities down to the current timeframe's magnitude using the square-root-of-time rule.
• Usage: Calculate HTF volatilities via request.security() externally, then pass to this function.
• Behaviour: Returns base volatility unchanged on Daily+ timeframes (MTF aggregation not applicable).
💮 volatility_burst_ratio()
Regime shift detector comparing short-term to long-term volatility.
• Parameters: short_period (default 8), long_period (default 50), filter_type (default Super Smoother 2-Pole), smoothing_factor (default 0.7)
• Interpretation: Ratio > 1.0 indicates expanding volatility; values > 1.5 often precede or accompany explosive breakouts.
• Best for: Filtering entries (e.g., "only enter if volatility is expanding"), dynamic risk adjustment, breakout confirmation.
🌸 --------- PRACTICAL USAGE NOTES --------- 🌸
💮 Choosing an Estimator
• Trending equities with gaps: yang_zhang() — handles both drift and overnight gaps optimally.
• Crypto (24/7 trading): rogers_satchell() — drift-independent without the lag of Yang-Zhang's multi-period window.
• Ranging markets: garman_klass() or parkinson() — simpler, no drift adjustment needed.
• Price-based stops: atr() — output in price units, directly usable for stop distances.
• Regime detection: Combine any estimator with volatility_burst_ratio().
💮 Output Units
All range-based estimators output per-bar volatility in log-return units (standard deviation). To convert to annualised percentage volatility (the convention in options and risk management), use:
vol_annual = annualize(yang_zhang(14), 252) // For daily bars
vol_percent = vol_annual * 100 // Express as percentage
💮 Smoothing Selection
The library integrates with FiltersToolkit for flexible smoothing. General guidance:
• SMA: Classical, statistically valid, but suffers from "drop-off" artefacts when spikes exit the window.
• Super Smoother / Ultimate Smoother / BiQuad: Natural decay, reduced lag — preferred for trading applications.
• MAMA / ADXvma / A2RMA: Adaptive smoothing, sometimes interesting for highly dynamic environments.
💮 Edge Cases and Limitations
• Flat candles: Guards prevent log(0) errors, but single-tick bars produce near-zero variance readings.
• Illiquid assets: Discretisation bias causes underestimation when ticks-per-bar is small. Use higher timeframes for more reliable estimates.
• Yang-Zhang minimum: Requires lookback ≥ 2 (enforced internally). Cannot produce instantaneous readings.
• Drift in Parkinson/GK: These estimators overestimate variance in trending conditions — switch to Rogers-Satchell or Yang-Zhang.
Note: This library is actively maintained. Suggestions for additional estimators or improvements are welcome.
EMTIA_MASTER_LIBLibrary "EMTIA_MASTER_LIB"
trendUp(emaFast, emaSlow)
Parameters:
emaFast (float)
emaSlow (float)
rsiHealthy(rsi)
Parameters:
rsi (float)
adxStrong(adx, diPlus, diMinus)
Parameters:
adx (float)
diPlus (float)
diMinus (float)
macroSlope(emaFast, emaSlow)
Parameters:
emaFast (float)
emaSlow (float)
structureBull(hh, hl)
Parameters:
hh (bool)
hl (bool)
calcScore(weeklyTrend, dailyTrend, adxOk, rsiOk, structureOk, macroOk)
Parameters:
weeklyTrend (bool)
dailyTrend (bool)
adxOk (bool)
rsiOk (bool)
structureOk (bool)
macroOk (bool)





















