Pine Script® indicator
Average True Range (ATR)
Average True Range V2Here's an introduction and explanation for your ATR indicator script:
Average True Range (ATR) with Enhanced Features
This custom ATR indicator builds upon the traditional Average True Range calculation with several advanced visualization and analysis features designed for traders who need more precise market volatility insights.
Overview
The indicator calculates ATR using your choice of four smoothing methods (RMA, SMA, EMA, or WMA) and adds professional-grade tools for identifying extreme volatility levels over different time periods.
Key Features
Delayed Update Mode: Toggle the "Wait for period end before updating" option to prevent the ATR from recalculating until the current candle closes, eliminating false signals during active price action.
Scale Inversion: The "Flip scale" feature inverts the ATR values, which can be useful when comparing volatility patterns with inversely correlated indicators or when creating custom overlay strategies.
Dynamic Horizontal Line: A real-time horizontal line tracks the current ATR value across your chart, making it easier to identify when volatility reaches specific levels. Customize its color, style (solid, dashed, or dotted), and width to match your charting preferences.
Extreme Value Markers: Automatically identifies and marks 3-day and 7-day volatility extremes with customizable shapes and colors. This helps you quickly spot:
3-day low/high volatility points (shorter-term extremes)
7-day low/high volatility points (medium-term extremes)
Choose from seven different marker shapes (circle, triangle up/down, square, diamond, cross, or X cross) to distinguish between different extreme types at a glance.
Practical Applications
Use this indicator to identify optimal entry and exit points based on volatility cycles, set more accurate stop-loss levels during low volatility periods, or spot potential breakout opportunities when volatility reaches extreme lows before expanding.
The extreme markers are particularly valuable for mean-reversion strategies, helping you identify when volatility has stretched to unsustainable levels and may return to normal ranges.
Would you like me to adjust the tone to be more technical or conversational, or expand on any specific feature?
Pine Script® indicator
Gamma Hedging Pressure Gamma Hedging Pressure (Proxy) – Market Maker Gamma Exposure Estimator
This open-source, non-overlay indicator provides a **proxy** for dealer/market-maker gamma hedging pressure using only standard OHLCV data — no options chain or implied volatility required.
Core Concept
In options markets, gamma measures how much delta changes with price movement. When dealers are **net short gamma** (negative gamma), they must hedge aggressively in the direction of the move → this amplifies trends and breakouts. When **net long gamma** (positive gamma), they hedge against the move → this creates mean-reversion and pinning behavior.
Because true gamma exposure is hidden (dealer books are private), this script estimates hedging pressure indirectly by combining:
- Volatility expansion (normalized range)
- Price acceleration (second derivative)
- Abnormal volume participation
High positive values → likely negative gamma regime (trend acceleration)
High negative values → likely positive gamma regime (reversion pressure)
Near zero → neutral/chop
Why this proxy is useful
True gamma dashboards require Level 2 options data and are often delayed or paid. This lightweight version:
- Works on any instrument with volume (stocks, futures, forex proxies, crypto)
- Updates in real time
- Helps traders anticipate whether the current move is likely to accelerate (negative gamma) or fade (positive gamma)
- Useful as a regime filter alongside support/resistance, order flow, or momentum tools
How It Works – Step by Step
1. Volatility Expansion
- Normalized range = (high - low) / ATR(14)
2. Price Acceleration
- First difference: close - close
- Second difference (acceleration): diff - diff
3. Volume Participation
- Normalized volume = volume / SMA(volume, 20)
4. Raw Pressure
- rawPressure = normalized range × acceleration × normalized volume
5. Smoothed Gamma Pressure
- gammaPressure = EMA(rawPressure, 5) // short smoothing for responsiveness
6. Optional Daily Reset
- If enabled, resets to 0 at the start of each new day (useful for intraday)
7. Regime Classification
- Negative Gamma (red): gammaPressure > +threshold (default 0.5) → trend/breakout likely
- Positive Gamma (green): gammaPressure < -threshold → mean-reversion likely
- Neutral (gray): within ±threshold → chop/consolidation
Visual Output
- Histogram: colored by regime (red = negative gamma / trend accel, green = positive gamma / reversion, gray = neutral)
- Zero line reference
- Background tint: red/green during strong regimes
- Last-bar label: "NEGATIVE GAMMA – Trend / Breakout", "POSITIVE GAMMA – Mean Reversion", or "NEUTRAL"
How to Use
- Best on intraday timeframes (5m–1h) for futures (NQ, ES, GC), indices, or high-volume stocks
- Daily/4h for swing context on liquid names
- Interpretation examples:
→ Red histogram + rising pressure → dealers likely short gamma → expect trend continuation or acceleration
→ Green histogram + falling pressure → dealers long gamma → expect fading moves, pinning near strikes, or reversion
→ Gray/neutral → low gamma pressure → range-bound or low-conviction market
- Combine with:
- Key levels (VWAP, previous highs/lows)
- Volume profile or order flow
- Options-related news (expiration days, gamma flips)
- Threshold tuning: 0.3–0.8 depending on instrument volatility (lower for crypto, higher for forex)
Inputs
- ATR Length: default 14
- Volume MA Length: default 20
- Gamma Threshold: default 0.5 (sensitivity for regime coloring)
- Reset on New Session: true = daily reset (recommended for intraday)
Publishing Recommendation
- Publish with a clean chart (e.g., 15m–1h NQ1!, ES1!, or SPY)
- Show a trending period (red histogram) and a ranging/consolidation period (green/gray)
- No extra indicators/drawings needed for basic interpretation
This is an **educational proxy** — not a direct measure of actual dealer gamma. It approximates pressure from observable market behavior. Trading involves significant risk of loss. Use discretion and proper risk management.
Feedback welcome — especially threshold or smoothing suggestions for different markets!
Pine Script® indicator
ATR % V3Now I'll provide you with the fully translated script and comprehensive documentation:
ATR % V3 Indicator - Introduction
The ATR % V3 is a Pine Script indicator that displays the Average True Range (ATR) as a percentage of price, providing traders with a normalized view of market volatility. Unlike the standard ATR which shows absolute price values, this percentage-based approach allows for easier comparison across different securities and timeframes. The indicator includes advanced features such as multi-day extreme value detection, customizable horizontal reference lines, and optional coordinate inversion for specialized charting needs.
Key Features
Percentage-based ATR calculation relative to either current open or previous close
Flexible smoothing methods (RMA, SMA, EMA, WMA) for different trading styles
Multi-period extreme value markers for 3-day and 7-day highs/lows
Dynamic horizontal reference line showing current ATR% value
Optional coordinate flip for alternative visualization perspectives
Bar confirmation control to prevent repainting on live bars
Technical Explanation
ATR Percentage Calculation
The script calculates ATR% using the formula: ATR% = (ATR / Basis Price) × 100. The basis price can be either the current bar's open price or the previous bar's close price, allowing traders to choose the reference point that best suits their trading methodology.
Smoothing Methods
The indicator supports four moving average types for ATR smoothing:
RMA (Relative Moving Average): Default method, provides exponentially smoothed values similar to Wilder's original ATR implementation
SMA (Simple Moving Average): Equal weighting of all periods
EMA (Exponential Moving Average): Recent prices weighted more heavily
WMA (Weighted Moving Average): Linear weighting scheme
Extreme Value Detection
The script identifies when the current ATR% value represents a local extreme over 3-day or 7-day lookback periods. These markers appear only on the most recent bar and help traders identify volatility compression or expansion zones that may precede significant price moves.
Anti-Repainting Feature
The "Wait for Bar Close to Update" option prevents the indicator from recalculating on every tick within an unconfirmed bar. When enabled, the ATR% value updates only after each bar closes, ensuring consistent historical values that won't change retroactively.
Usage Recommendations
For Volatility Analysis: Use the percentage-based approach to compare volatility across different assets or timeframes objectively. Higher ATR% values indicate increased volatility relative to price.
For Position Sizing: ATR% can inform position size adjustments—reduce exposure when volatility (ATR%) spikes, and potentially increase when volatility contracts.
For Stop Loss Placement: The horizontal reference line provides a quick visual reference for current volatility levels, useful for setting volatility-adjusted stop losses.
For Breakout Confirmation: Watch for 3-day or 7-day extreme markers—volatility extremes often precede or confirm trend reversals or breakouts.
Pine Script® indicator
All-in-One SMC ProAll-in-One SMC Pro: CHOCH • BOS • FVG • Order Blocks • Liquidity + Discount/Premium
This open-source overlay indicator combines the five most widely used Smart Money / ICT (Inner Circle Trader) concepts into a single, customizable tool:
- Break of Structure (BOS)
- Change of Character (CHOCH)
- Fair Value Gaps (FVG)
- Order Blocks (mitigation blocks)
- Liquidity grabs (equal highs/lows)
- Discount / Premium zones
Why this combination?
SMC traders rarely use these concepts in isolation. A complete workflow typically involves:
1. Identifying market structure direction (BOS) or reversal (CHOCH)
2. Locating high-probability entry zones (Order Blocks, FVGs)
3. Confirming institutional manipulation (liquidity grabs of equal highs/lows)
4. Understanding price positioning relative to value (discount = buy bias, premium = sell bias)
Putting them all in one script reduces chart clutter, improves confluence visibility, and helps newer SMC users see how the pieces connect — without needing 5–7 separate indicators.
Core Concepts & Detection Logic
1. Break of Structure (BOS)
- Bullish BOS: price closes above previous swing high
- Bearish BOS: price closes below previous swing low
- Swing points detected with user-defined lookback (default 5 bars left/right)
2. Change of Character (CHOCH)
- Bullish CHOCH: price makes lower low but closes above previous swing high (bearish structure broken → bullish reversal signal)
- Bearish CHOCH: price makes higher high but closes below previous swing low (bullish structure broken → bearish reversal signal)
3. Fair Value Gaps (FVG)
- Bullish FVG: gap up after a bearish candle (low > high )
- Bearish FVG: gap down after a bullish candle (high < low )
- Sensitivity controlled via ATR multiplier (default 0.1 × ATR(14))
- Dashed horizontal lines mark the gap boundaries
4. Order Blocks
- Bullish OB: previous swing low after bullish BOS (potential demand zone)
- Bearish OB: previous swing high after bearish BOS (potential supply zone)
- Drawn as semi-transparent boxes extending rightward (lookback period adjustable)
5. Liquidity Grabs
- Detects clusters of equal highs/lows (default 3-bar lookback)
- Labels appear when price reverses after touching equal levels (classic stop-hunt / liquidity raid)
6. Discount / Premium Zones
- Equilibrium proxy = (H + L + C) / 3
- Discount: price below ~0.5% of equilibrium (green tint – buy bias area)
- Premium: price above ~0.5% of equilibrium (red tint – sell bias area)
Visual Customization
- Toggle each element independently (BOS, CHOCH, FVG, OB, Liquidity, Disc/Prem)
- Separate bullish/bearish colors + dedicated FVG/OB/Liquidity colors
- Max lines/labels set high (500) to handle longer histories
Alerts (built-in conditions)
- Bullish / Bearish BOS
- Bullish / Bearish CHOCH
- Bullish / Bearish FVG formation
How to Use
- Best on 5m–4h timeframes for forex, indices, crypto, gold (high-liquidity instruments)
- Typical SMC workflow example:
1. Look for CHOCH → potential trend reversal
2. Wait for BOS in new direction → structure confirmation
3. Seek entry at Order Block or FVG mitigation in discount/premium zone
4. Liquidity grabs near swing extremes often precede strong moves
- Combine with session times, news events, or higher-timeframe bias — never trade signals in isolation
- Adjust swingLen (3–10) for sensitivity: lower = more signals, higher = cleaner structure
Publishing Recommendation
- Publish with a clean chart (recommended: 15m–1h EURUSD, XAUUSD, BTCUSD, or NQ1!)
- Show a recent CHOCH → BOS → OB/FVG confluence sequence
- Remove all other indicators, drawings, and unnecessary gridlines
Always use discretion, proper risk management, and backtest thoroughly.
Feedback welcome — especially on FVG sensitivity or OB refinement ideas!
Pine Script® indicator
ATR 14 + ATR 3 (shade when ATR3 > 10% of price)Plots ATR14 and ATR3 on the same graph. If ATR3 > 10% of the closing price, shade the area in red.
Pine Script® indicator
Normalized ROC - Two Security SpreadThis is my exploratory script for comparing the movement of two securities: the one that is studied is compared to some benchmark (like QQQ etc.). The movements of both are measured as ROC(t) normalized with each others own ATR. Normalized ROCs are then subtracted to create a "spread".
The plot draws both securities' NormROC as lines and the spread as a histogram. So, histogram shows green, when the stock is stronger than the benchmark even in their normalized terms, indicating strong momentum, and vice versa as red. Furthermore, the indicator marks with triangles so called hidden strength and hidden weakness. Hidden strength occurs when Benchmark (e.g. QQQ) is weak, but the stock is not. The assumption is that when the benchmark turns positive the stock is ready to run faster. Respectively, hidden weakness is when Benchmark is strong, but the stock does not follow. Of course, there will be many false signals, these are just potential indications of strength and weakness.
Parameters can be adjusted, length of ROC and the line smoothing EMA. Also alerts can be set for histogram level and the hidden strength/weakness levels.
DISCLAIMER: Indicator has not been tested. Use with caution and own responsibility. As always, be aware of false signals. Never make decisions with one indicator only.
Pine Script® indicator
Stock Expansion - Pullback Screener (v6)Stock Expansion → Pullback Screener (v6) – Momentum Continuation Filter
This open-source, non-repainting indicator acts as a **screener** for high-probability pullback entries after strong momentum expansion candles — a classic continuation setup used in momentum, trend-following, and swing trading.
Core Concept
Markets often produce explosive candles during momentum surges (news, breakouts, volume spikes). After such expansions, price frequently retraces to value areas (dynamic support/resistance) before resuming the trend. This tool identifies:
1. Strong directional expansion bars
2. Sustained momentum confirmation
3. Healthy pullbacks to logical re-entry zones
…within a short time window after the expansion.
Why this combination?
- Raw expansion (large range) can be noisy → we require strong body (>60% of range) + ATR filter to isolate conviction moves.
- Directionless expansions are ignored → RSI momentum zones (>55 bull, <45 bear) add trend bias.
- Pullbacks to EMAs alone can be premature → we require price to be sandwiched between fast/slow EMA **or** very close to VWAP (institutional fair value proxy).
- Time decay prevents stale signals → only signals within user-defined bars after expansion (default 20).
This creates a focused, confluence-based filter that reduces whipsaws compared to single-indicator approaches.
How It Works – Step by Step
1. Expansion Candle Detection
- Range > ATR(14) × multiplier (default 1.3)
- Body > 60% of range (shows directional conviction, not just wick volatility)
2. Momentum Filter
- Bullish expansion: RSI(14) > 55
- Bearish expansion: RSI(14) < 45
3. Time Window
- Signal active only within maxBars (default 20) after the expansion candle
4. Pullback Zone Definition
- Bullish pullback: price between EMA20 and EMA50 **OR** within 0.3% of VWAP
- Bearish pullback: price between EMA50 and EMA20 **OR** within 0.3% of VWAP
5. Final Signal
- Bullish: active bull expansion window + current momentum still bullish + pullback zone
- Bearish: mirror logic
Visuals & Alerts
- Green triangle below bar → Bullish Expansion → Pullback setup
- Red triangle above bar → Bearish Expansion → Pullback setup
- Built-in alertconditions:
→ "Bullish expansion pullback on {{ticker}} ({{interval}})"
→ "Bearish expansion pullback on {{ticker}} ({{interval}})"
How to Use as a Screener
1. Add to any stock/ETF/index chart (works best on 15m–4h timeframes).
2. Use TradingView’s built-in screener or watchlist + alerts:
- Create separate alerts for bull/bear conditions
- Or scan manually across multiple tickers
3. Typical workflow:
- Wait for expansion triangle (strong move occurred)
- Wait for pullback triangle within ~10–20 bars
- Enter in direction of expansion when both conditions fire
4. Best environments:
- Trending stocks/sectors (tech, growth, momentum names)
- After earnings, sector rotation, or macro catalysts
- Avoid very choppy/low-volume names
5. Risk management (not coded – user responsibility):
- Stop below expansion low (bull) / above high (bear)
- Target previous swing high/low or 2–3× risk
Recommended Settings
- ATR Multiplier: 1.2–1.6 (lower = more signals, higher = stronger expansions)
- Max Bars: 10–30 (shorter = fresher setups, longer = more forgiving pullbacks)
- Timeframes: 15m–4h (daily works but fewer signals)
Publishing Recommendation
- Publish with a clean chart (e.g., 1h or 4h TSLA, NVDA, or SPY)
- Show both a recent expansion candle + pullback signal visible
- No extra indicators/drawings needed
This is a lightweight, educational momentum screener — fully open-source. It highlights setups, not automatic entries. Trading involves significant risk of loss. Always use proper risk management.
Feedback welcome — especially timeframe/parameter suggestions for different markets!
Pine Script® indicator
Bank CRE Stress & Short Risk Overlay + Dashboard🏦 Bank CRE Stress & Short Risk Overlay + Dashboard
This open-source indicator overlays risk visualization and a fixed dashboard specifically for **U.S. regional bank stocks** exposed to Commercial Real Estate (CRE) lending stress (as observed in 2023–2026 cycles).
It combines:
- Static CRE exposure tiers (critical/high/elevated/short-bias/failed) based on latest known CRE loan-to-capital ratios and provisions data (sourced from FDIC Call Reports, FAU studies, FFIEC filings ~Q3/Q4 2025)
- Real-time price stress detection (EMA200 breakdown + 20-bar range low breach)
- Visual alerts (background coloring + per-bar risk labels)
- Top-right summary dashboard
Purpose & Why This Combination?
Regional banks with heavy CRE concentration became focal points during rising office/vacancy stress, higher provisions, deposit outflows, and equity pressure. This tool helps traders quickly:
- Identify which tickers carry elevated CRE risk
- See when technical breakdown aligns with fundamental vulnerability (potential short setups or high-risk avoidance zones)
- Monitor a static watchlist without needing external spreadsheets
The mashup is useful because raw fundamentals change quarterly, while price action provides real-time confirmation of stress transmission to equity. Dashboard + overlay gives instant context on any bank chart.
How It Works
1. Ticker Classification (static – update manually when new Call Reports released)
- 🔴 Critical / Short Bias: >~500% CRE exposure or high-conviction short candidates
- 🟠 High: ~375–480%
- 🟡 Elevated: ~300–350%
- ❌ Failed: Known FDIC receivership cases
- 🟢 Low/None: not in list
2. Price Stress Trigger
- Below 200 EMA (major trend break)
- Below 20-bar lowest low (range breakdown)
- (Optional stricter filter: ATR expansion – commented out by default)
3. Visuals
- Background tint: black (failed), red (critical/short + stress), orange (high + stress), yellow (elevated + stress)
- Per-bar label above candle: risk category + warning text (only shown for relevant banks)
- EMA50 (gray) & EMA200 (white) plotted for reference
4. Dashboard (top-right, updates on last bar)
- Current ticker risk level + color coding
- Price stress status
- EMA200 position
- Static high-risk watchlist
- Data freshness & disclaimer note
Alerts
- "Critical/Short Bias Breakdown" when stress triggers on red/orange tickers
- "Failed Bank Symbol" on known failed tickers
How to Use
- Apply to **regional bank stocks** (DCOM, EGBN, OZK, LOB, VLY, FLG, ZION, WAL, SNV, RF, CMA, TFC, etc.)
- Best on daily or 4h charts for swing/position trading context
- Use as a **filter / watchlist aid**:
→ Red/orange background + stress label → heightened short risk or avoidance
→ Yellow → monitor for provisioning news or CRE delinquency spikes
→ Black → avoid (historical failures)
- Update the arrays quarterly when new FDIC data drops (Q1/Q2/Q3/Q4 Call Reports)
- Combine with volume, news, sector ETFs (KRE), or broader CRE indices
Inputs & Customization
- No user inputs — risk tiers are hardcoded for simplicity & consistency
- To add/remove banks: edit the array.from() lines directly
Publishing Notes
- Publish with a clean chart (e.g., DCOM, EGBN or VLY daily/4h)
- Remove unnecessary drawings/indicators
- Screenshot showing dashboard + stress label during a breakdown period is ideal
Important Disclaimers
- Data is **static** and approximate (based on public reports up to ~Q3/Q4 2025)
- Must be manually updated — not real-time fundamental feed
- This is **not financial advice**, not investment research, and carries no accuracy guarantee
- Regional bank equities are extremely volatile — especially under CRE stress
- Trading or shorting involves substantial risk of loss
Open-source for transparency & educational use. Feedback welcome — especially updated CRE tier suggestions.
Pine Script® indicator
Pine Script® indicator
stelaraX - ATRstelaraX – ATR
stelaraX – ATR is a volatility indicator based on the Average True Range (ATR). It measures the average price movement over a defined period and provides a clear view of current market volatility independent of price direction.
For advanced AI-based chart analysis and automated volatility evaluation, visit stelarax.com
Core logic
The indicator calculates the Average True Range using a user-defined period.
ATR is derived from the true range, which considers:
* current high minus current low
* absolute difference between current high and previous close
* absolute difference between current low and previous close
The ATR value reflects the average volatility over the selected lookback window.
Visualization
The script plots a single ATR line in a separate indicator pane:
* smooth volatility line
* configurable period length
* customizable line color
* clean and minimal visual design
The indicator does not generate signals and is intended purely for volatility assessment.
Use case
This indicator is intended for:
* measuring market volatility
* defining dynamic stop loss and take profit distances
* position sizing and risk management
* identifying volatility expansion or contraction
* filtering trades based on market conditions
For a fully automated AI-driven chart analysis solution, additional tools and insights are available at stelarax.com
Disclaimer
This indicator is provided for educational and technical analysis purposes only and does not constitute financial advice or trading recommendations. All trading decisions and risk management remain the responsibility of the user.
Pine Script® indicator
ATR Structure Trail Pro & Range Filter (v6)📌 ATR Structure Trail Pro & Range Filter (v6)
Multi-purpose trend-following and consolidation detection tool
🔍 Overview
This indicator combines structure pivots, an ATR-based trailing stop, range detection, and clean visual signals to identify trend shifts and potential trade zones.
It is designed for traders who want simple, clean structure reading without unnecessary chart noise.
This indicator does not guarantee profit and is intended for educational and analytical purposes only, serving as a visual aid for reading price action.
⚙️ Main Components
1️⃣ Structure Pivot Flip (Trend Change Detection)
The indicator uses Pivot High / Pivot Low structure to detect when price creates:
Higher High → BUY bias
Lower Low → SELL bias
When a structural flip occurs:
a green arrow appears (potential bullish setup)
or a red arrow appears (potential bearish setup)
These arrows are not trade signals, but visual markers highlighting a shift in market context.
2️⃣ ATR Trail Stop (Adaptive Trend Line)
The ATR trail line automatically adapts to market volatility:
green during bullish phases
red during bearish phases
The ATR multiplier determines how far the dynamic trail is placed relative to price.
The trail line is not a guaranteed exit level — it acts as a dynamic structural reference.
3️⃣ Range/Box Zones (Consolidation Filter)
When the indicator detects that price is entering a tight consolidation range based on ATR and recent volatility, it draws a box zone:
blue in bullish context
purple in bearish context
Range zones indicate low-risk/no-trade areas where entries are typically avoided according to price action logic.
🎯 Trading Logic (Non-Signaling)
This indicator is not a trading system.
It visually highlights:
✔ structure
✔ trend
✔ volatility
✔ consolidation
✔ potential reversals
Users make trading decisions independently of these visual elements.
🧩 Inputs & Customization
You can fully customize:
ATR length & multiplier
Pivot sensitivity
Box fill and border colors
ATR trail color, width, and style (solid/dashed/dotted)
Visibility of all components individually
The indicator works across all timeframes and instruments.
💡 How to Use
Use arrows as informational markers of structure change
Use the ATR trail as a dynamic guide for current trend
Use range boxes to avoid entries during consolidation
Combine it with your own price action analysis, EMA/Kijun lines, session opens, or volume levels
⚠️ Important Notes
This indicator provides no performance guarantees
Not financial advice or a trading signal
Users are responsible for their own testing and application
Intended strictly for educational and analytical use in compliance with TradingView’s rules
📬 Author Notes
If you find this indicator useful, feel free to leave a comment or suggestion for future improvements.
All inputs are open for expansion and further development.
Pine Script® indicator
Outlier Catching Moving AverageOutlier Catching Moving Average (OCMA) | MisinkoMaster
Outlier Catching Moving Average (OCMA) is a volatility-adaptive trend indicator designed to react quickly to abnormal price movements while maintaining smooth behavior during normal market conditions. The indicator aims to capture sudden price expansions without sacrificing overall trend clarity.
This makes OCMA suitable for traders who want faster adaptation to unusual market activity while still preserving stable trend structure across varying volatility regimes.
Key Features
Volatility-adaptive moving average designed to react to price outliers
Multiple moving average bases supported for flexible smoothing behavior
Optional ATR-based adaptive bands for volatility envelopes
Configurable trend logic for earlier signals or stronger confirmations
Dynamic candle coloring for intuitive trend visualization
Automatic Long and Short markers on confirmed trend transitions
Designed to balance responsiveness and smoothness across market conditions
How It Works
OCMA builds on traditional moving average concepts but incorporates adaptive smoothing that adjusts according to changing market volatility.
Rather than behaving uniformly across all conditions, the average becomes more responsive when price behavior deviates strongly from recent structure and smoother when markets return to normal activity.
Optional ATR bands expand and contract with volatility, helping identify when price moves significantly away from its adaptive equilibrium.
The result is a moving average that remains stable in calm markets yet quickly adapts when price action becomes irregular or impulsive.
Inputs Overview
Source — Selects the price data used in calculations
Moving Average Length — Controls the main smoothing period
ATR Length — Sets the volatility measurement period used for band calculations
Base Moving Average — Selects which moving average type is used as the foundation
Trend Logic — Chooses whether trends are detected via band crossover, average direction change, or both
Use ATR Bands — Enables or disables adaptive volatility bands
Factor — Controls ATR band width sensitivity
ALMA Offset & Sigma — Parameters used only when ALMA smoothing is selected
Usage Notes
Designed to detect abnormal price expansions while preserving overall trend structure
Suitable for breakout traders and volatility-aware trend strategies
Band crossovers can signal potential trend transitions
Average direction changes may confirm continuation or reversal
Works well when combined with market structure or confirmation tools
Adjust parameters according to asset volatility and timeframe
Summary
Outlier Catching Moving Average provides a volatility-aware alternative to standard moving averages, helping traders capture unusual price behavior while maintaining smooth and readable trend signals. It is well suited for traders seeking adaptive trend tools capable of responding when markets move outside normal conditions.
Pine Script® indicator
Outlier Resistant Moving AverageOutlier Resistant Moving Average (ORMA) | MisinkoMaster
Outlier Resistant Moving Average (ORMA) is a trend-following moving average designed to reduce the impact of abnormal price spikes while preserving responsiveness to real market moves. The goal is to provide a smoother and more stable trend reference that remains usable even during volatile or erratic price behavior.
Unlike traditional moving averages that react strongly to sudden price shocks, ORMA adapts its behavior to volatility conditions, helping traders follow trends without being constantly misled by temporary price extremes.
Key Features
Moving average designed to resist distortion from price outliers
Adaptive smoothing behavior that reacts to volatility conditions
Optional ATR-based dynamic bands for trend confirmation
Multiple moving average types supported as the calculation base
Flexible trend detection logic options
Automatic trend coloring and signal labeling
Candle coloring for intuitive trend visualization
How It Works
ORMA builds upon a selectable base moving average and modifies its behavior to reduce the influence of abnormal price movements. Instead of reacting equally to all price changes, the calculation adjusts its responsiveness according to changing volatility conditions.
When market volatility expands, the indicator becomes more conservative, preventing sudden spikes from distorting the average. During calmer conditions, responsiveness increases, allowing the average to track price action more closely.
Optional ATR-based bands can be applied around the average, allowing traders to use band breakouts as confirmation of trend strength rather than relying solely on slope changes.
The result is a moving average that remains stable in noisy markets while still adapting during real trend movements.
Inputs Overview
Source — Selects the price source used in calculations
Moving Average Length — Controls smoothing and calculation sensitivity
ATR Length — Controls volatility measurement used for adaptive behavior
Base Moving Average — Selects which MA type forms the calculation foundation
Trend Logic — Determines whether trend is detected via crossover, slope change, or both
Use ATR Bands — Enables or disables dynamic ATR bands
ATR Factor — Controls band distance from the average
ALMA Offset & Sigma — Parameters used only when ALMA smoothing is selected
Floored Offset — Optional ALMA configuration affecting smoothing behavior
Usage Notes
Useful for filtering noise during volatile or choppy markets
ATR bands can help confirm stronger breakouts or trend continuation
Trend logic modes allow adaptation to different trading styles
Suitable for swing trading, trend-following, and position trading approaches
Can act as dynamic support or resistance in trending markets
Works well when combined with momentum or volume confirmation tools
Summary
Outlier Resistant Moving Average offers a volatility-aware trend reference that helps traders remain aligned with broader price movement while minimizing disruptions from sudden price spikes. It is especially useful for traders seeking smoother trend identification without sacrificing adaptability.
Pine Script® indicator
Stocks: QQQ Daily ATR% + Premarket Range (% of ATR)## Stocks/ETFs: QQQ Premarket Range (% of Daily ATR) — ORB Trading Guide
### What this indicator does
This indicator is built for **stocks and ETFs** like **QQQ** and is meant to support **Opening Range Breakout (ORB)** trading.
It measures the **Premarket Range** from **04:00 to 09:30** (exchange time), then compares that move to QQQ’s **typical full-day movement** using **Daily ATR(14)**.
The goal is simple:
> **Before the open, decide whether the day is more likely to behave like a “chop day” or an “expansion day,” and then choose the ORB style that matches.**
---
## Key terms (plain English)
### Daily ATR(14)
ATR stands for **Average True Range**.
On the **daily** timeframe, ATR(14) estimates QQQ’s **typical daily movement** over the last 14 trading days.
Think of it as:
> “On a normal day, QQQ tends to move about *X* dollars.”
---
### ATR% (vs Daily Close)
This converts ATR into a percent of price so you can compare volatility over time:
Think of it as:
> “QQQ’s typical daily move is about *X%* of its price.”
---
### Premarket Range (04:00–09:30)
This is the distance between the **premarket high** and **premarket low** during the session window:
**04:00 → 09:30**
Think of it as:
> “How much QQQ already moved before the bell.”
---
### Premarket Range % of ATR
This is the core measurement:
It answers:
> “How much of a normal day’s movement already happened before the open?”
Examples:
* **20%** = quiet premarket (small move)
* **60%** = active premarket (big move already happened)
---
## How to interpret the Regime label
This script classifies the day into one of three “regimes”:
### **CHOP-LEANING** (Premarket Range < 25% of Daily ATR)
Premarket was quiet. The open is more likely to be:
* range-bound
* full of fakeouts
* slower follow-through
### **NEUTRAL** (25%–50%)
Normal premarket activity. Either outcome is possible:
* trend or chop
* you must let the open confirm it
### **EXPANSION-LEANING** (Premarket Range > 50%)
Premarket was very active. The open is more likely to:
* move faster
* expand range quickly
* have stronger directional pushes (or sharp swings)
**Important:** Expansion does not guarantee a clean trend. It means **movement is more likely**.
---
# How I use this indicator with ORB (my rules)
This indicator is not a buy/sell signal by itself.
I use it to decide **which ORB style to trade**.
## Step 1 — Check the “Regime” before the open
* If the indicator reads **EXPANSION-LEANING**, I treat it like a momentum environment.
* If the indicator reads **CHOP-LEANING**, I treat it like a confirmation environment.
* If it reads **NEUTRAL**, I stay selective and let price action confirm.
---
## Step 2 — ORB Execution Rules
### ✅ If **EXPANSION-LEANING** (momentum day)
**Goal:** Catch the move early and avoid missing the breakout.
**My ORB plan:**
* Build my opening range using the **5-minute ORB**
* Enter on a **break of the ORB level**
* Use the **1-minute timeframe** for the actual entry trigger
**How I confirm the break:**
* I want a clean break through the ORB level (not just a wick touch)
* If price snaps immediately back inside the ORB, I avoid chasing
This approach fits expansion days because QQQ can move fast after the open and waiting for perfect retests can cause you to miss the push.
---
### ✅ If **CHOP-LEANING** (confirmation day)
**Goal:** Avoid fakeouts and only enter when the break proves itself.
**My ORB plan:**
* Build my opening range using a **15-minute ORB**
* I do **not** enter on the first break
* I wait for a **break and retest**
* Then I use the **5-minute timeframe** to confirm the retest holds before entry
This fits chop days because breaks fail more often, so I require confirmation before committing.
---
### ✅ If **NEUTRAL**
**Goal:** Reduce low-quality trades.
**My ORB plan:**
* Treat it as “wait and see”
* Only take the break if price shows strong conviction (hold outside ORB)
* If price is whipping in and out of the range, I skip the trade
---
## Best practices
* Works best on **1m / 5m / 15m charts** so the premarket high/low is captured accurately.
* Premarket session time uses the symbol’s **exchange time**.
* Use proper risk management—QQQ can move fast, especially on expansion days.
---
## Disclaimer
This script is for educational purposes only and is not financial advice. Trading involves risk. Always use risk management and test any approach before trading live.
Pine Script® indicator
Volatility Visualizer Percentiles (VIXFix, ATR, VIX)Summary
A volatility regime dashboard for liquid instruments that converts three volatility lenses into 0 to 100 percentile ranks versus the last 252 closed daily bars. It is built to answer one question: is volatility unusually low or unusually high relative to the last year . Use it to adjust position sizing, stop width, and trade selectivity. It is not a directional signal.
Scope and intent
Markets : US indices and index ETFs, index futures, large cap equities, liquid crypto proxies, and other symbols where daily volatility regimes matter
Timeframes : best on Daily. It can be applied on other chart timeframes, but the reference window remains 252 closed daily bars
Default demo : SPX on Daily
Purpose : provide a simple, testable volatility context layer that you can plug into any daily system as a risk filter or risk scaler
What makes it original and useful
Most “volatility tools” show raw ATR or a single volatility index. This script standardizes three distinct sources into the same unit (percentile), so you can compare them and combine them without guessing thresholds.
Unique fusion : internal realized volatility (ATR%), internal stress proxy (VIXFix), and external implied volatility (input VIX symbol) expressed in the same 0 to 100 scale
Practical outcome : the table gives a regime read and an action posture, so the output is directly usable for risk decisions
Testable : all components are visible and thresholdable; you can backtest rules like “only trade when composite is between 30 and 75”
Portable : percentiles remove the need to hardcode market specific “ATR is high” numbers across different symbols
Method overview in plain language
Base measures
VIXFix : a price based fear proxy derived from the instrument’s own daily behavior (using the relationship between recent high closes and current lows)
ATR% : daily ATR normalized by daily close, expressed as a percentage for cross symbol comparability
External VIX : a user selected volatility index or proxy pulled via input symbol (default CBOE:VIX)
Normalization to percentiles
For each metric, the script stores the last 252 closed daily values
It then computes where the most recent closed daily value sits inside that history as a percentile from 0 to 100
Tie handling is configurable (Midrank, StrictLess, LessOrEqual) to define how repeated values are ranked
Fusion rule
Composite percentile is the simple average of the available percentiles (VIXFix, ATR%, VIX)
If one component is missing (for example the external symbol is unavailable), the composite averages the remaining components
How to use it on Daily
This tool is most effective as a risk regime layer on top of an existing strategy. Use the Composite row as the primary dial, and the individual components as confirmation.
Recommended operating zones
0–20 Very Low : quiet regime. Tight stops often survive, but breakouts can underperform. Favor mean reversion or require stronger breakout confirmation.
20–40 Low : constructive for many systems. Use baseline sizing and baseline stops.
40–60 Mid : neutral. Run your base playbook.
60–80 High : volatility expansion. Reduce size and widen stops, or trade only higher quality setups.
80–100 Very High : stress regime. Smallest size, widest stops, and skip marginal setups. Gap risk and slippage risk are higher.
How to interpret disagreements
If ATR% is high but VIX is mid , realized vol is elevated but the market is not pricing extreme fear. Treat as a caution zone, not panic.
If VIX is high but ATR% is mid , implied vol is elevated ahead of potential events. Expect expansion risk even if realized vol has not moved yet.
If all three are high , treat it as a full stress regime and enforce strict risk limits.
What you will see on the chart
A compact table with one row per metric and optional composite
For each row: last closed daily value, 252D percentile, a progress bar, and an action posture
Optional stats: min, median, max for the 252D window (useful for sanity checks, adds CPU)
Table fields quick guide
Last closed daily : the value used for ranking, taken from the last fully closed daily bar
252D percentile : where the current reading ranks versus the last 252 closed daily readings
Bar : quick visual map of percentile from 0 to 100
Action : risk posture suggestion tied to the percentile bucket
Inputs with guidance
Core
Window (closed daily bars) : default 252. Higher values make the regime slower and more structural. Lower values make it more reactive.
VIX
VIX symbol : default CBOE:VIX. You can replace it with another implied volatility proxy appropriate for your market.
VIXFix
VIXFix lookback : typical range 21/22. Smaller reacts faster, larger smooths regimes.
ATR
ATR length : typical range 10–21 on Daily
ATR as % of close : recommended on for comparability across symbols and long history
UI
Show composite volatility score : recommended on. Best single dial.
Show action guide : recommended on if you want direct posture cues.
Show min, median, max : optional. Useful for diagnostics, higher CPU.
Table position : place it where it does not cover price.
Usage recipes
Daily trend following overlay
Trade your trend system normally when Composite is between 25 and 75
If Composite is above 75, reduce size and widen stops, and require stronger trend confirmation
Daily mean reversion overlay
Focus on Composite below 40
Avoid Composite above 80 where gaps and cascading moves reduce mean reversion reliability
Daily risk parity style scaling
Use Composite percentile as a coarse risk throttle: higher percentile equals lower exposure
Example posture: 0–40 normal exposure, 40–80 reduced exposure, above 80 minimal exposure
Alerts
This script is intentionally a dashboard and does not emit buy or sell signals. If you want alerts, create them from percentile thresholds in your own fork. For conservative workflows, trigger alerts on bar close.
// Example alert conditions (add to your fork if desired)
high_vol = comp_pct > 80
low_vol = comp_pct < 20
Honest limitations and failure modes
This is not a directional predictor. Volatility can rise in both bull and bear markets.
Percentiles are relative to the last 252 closed daily bars. A “high percentile” is high versus recent history, not an absolute guarantee of future movement.
Implied volatility (VIX) can move ahead of realized volatility (ATR%). Treat divergence as information, not a signal.
Very high volatility regimes can include gap risk and slippage risk that are not visible in indicator values alone.
Legal
Education and research only. Not investment advice. You are responsible for your decisions. Test on historical data and in simulation before any live use.
Pine Script® indicator
Step Generalized Moving Average [BackQuant]Step Generalized Moving Average
Overview
Step Generalized Moving Average (StepGMA) is a trend-structure moving average designed to solve two common problems with classic MAs:
They overreact to noise in chop, causing constant micro-flips.
They lag too much when you smooth them enough to stop that noise.
StepGMA tackles this by combining two layers:
A Generalized Moving Average (GMA) that increases responsiveness without simply shortening length.
A Step Filter that converts the MA into discrete “steps” sized by ATR, suppressing insignificant movement and only updating when the move is meaningful.
The output is a trend line that behaves more like market structure: it holds its level through noise, then “reprices” in chunks when volatility-adjusted movement is large enough.
What the indicator is trying to represent
Instead of showing every tiny MA wiggle, StepGMA tries to represent the idea that:
Most price movement is noise relative to volatility.
Trend only matters when it advances by a meaningful amount.
A good trend line should stay stable until the market forces it to move.
That makes this indicator useful as:
A regime filter (trend vs chop).
A trend-following bias line.
A structure-like dynamic S/R reference.
A signal generator with fewer low-quality flips.
Component 1: Moving Average engine (selectable)
The base smoothing is not fixed. You can choose between multiple MA types:
SMA, EMA, WMA, VWMA: classic smoothing families.
DEMA, TEMA: reduced-lag EMA variants.
T3: smooth yet responsive, good for trend.
HMA: very low lag, can be twitchy without filtering.
ALMA: center-weighted smoothing, often “cleaner” visually.
KAMA: adaptive smoothing based on efficiency ratio, good in mixed regimes.
LSMA: regression-based, tends to track trend direction well.
McGinley: dynamic smoothing designed to reduce lag during fast moves.
This matters because the StepGMA is not “one MA.” It is a framework that lets you pick the underlying smoothing behavior, then applies the generalization and step logic on top.
Component 2: Generalized Moving Average (GMA)
Where the idea comes from
Generalized MA here is essentially a form of two-stage smoothing compensation . A common trick in signal processing and technical analysis is:
Apply a smoother once (MA1).
Apply it again (MA2).
Use MA2 as a “lag reference,” then combine MA1 and MA2 to reduce lag while keeping smoothness.
This is related in spirit to reduced-lag filters (like DEMA/TEMA) and “zero-lag” style constructions that subtract part of the lag component. You are not magically removing lag, you are biasing the output toward the first-pass MA while subtracting some of the second-pass smoothing that represents delayed response.
How this script does it
It computes:
ma1 = MA(src, len)
ma2 = MA(ma1, len)
Then combines them using a volume factor (vf):
generalized = ma1 * (1 + vf) - ma2 * vf
Interpretation:
ma2 is a “more delayed” version of ma1.
Subtracting vf * ma2 and adding (1+vf) * ma1 pushes the output toward responsiveness.
vf controls how aggressive that push is.
Volume Factor (vf) is really an aggressiveness knob
The script clamps vf between 0.01 and 1.0 to keep it stable. Conceptually:
Low vf: behaves closer to a normal MA1, smoother, more lag.
High vf: more compensation, faster response, more risk of overshoot or noise sensitivity (which is then handled by the step filter).
So the GMA stage tries to give you a cleaner, faster trend estimate without just shrinking the MA period.
Component 3: Step Filter (the key behavior)
What a step filter is
A step filter turns a continuous signal (here, the generalized MA) into a discrete “staircase” signal. Instead of updating every bar, it updates only when the input has moved far enough to justify a new step.
This is conceptually similar to:
A quantizer in signal processing (rounding changes to discrete increments).
A volatility threshold filter (ignore changes smaller than X).
Market structure logic where levels matter more than micro movement.
How it works in this script
The filter maintains a persistent value: stepped .
Each bar:
diff = src - stepped
If |diff| < stepSize, do nothing (hold the level).
If |diff| >= stepSize, move stepped by a number of step increments.
The step increment size is:
stepSize = (stepMult / 100) * ATR(atrPeriod)
This is critical:
In higher volatility, ATR is larger, so steps are larger, fewer updates, more stability.
In lower volatility, ATR is smaller, so steps are smaller, more updates, more sensitivity.
So the step behavior automatically adapts to volatility.
Multiple-step catching behavior
If price jumps far beyond one step, the script does not move only one step. It moves by:
floor(|diff| / stepSize) * stepSize
So it “catches up” in discrete blocks, preserving the stepped character without lagging massively after large moves.
Direction and regime
Direction is determined by the stepped line, not the raw MA:
direction = +1 if steppedMA is rising
direction = -1 if steppedMA is falling
otherwise direction stays the same
Signals only trigger on direction state changes:
Long when direction flips to +1
Short when direction flips to -1
This matters because it prevents repeated signals while the trend remains intact. You only get a signal when the market has moved enough (in ATR terms) to justify a structural step in the opposite direction.
Secondary line and gradient fill
The script also plots a secondary “slow MA” (length 25, same MA type). This is not the core logic, it is a visual context layer:
StepGMA is the structure line (discrete, regime-driven).
Slow MA is a smoother reference for the underlying drift.
The gradient fill highlights separation and dominance.
When StepGMA sits above the slow MA, the fill reinforces bullish bias. When below, it reinforces bearish bias. It is basically a “trend pressure” visual, not a separate signal.
How to interpret it
1) StepGMA as trend structure
Flat steps mean price is not making enough volatility-adjusted progress to move structure.
Up-steps mean the market has advanced enough to reprice the trend line upward.
Down-steps mean deterioration significant enough to reprice structure downward.
2) Direction is a regime, not a tick-by-tick call
Because direction is derived from step changes, it is naturally a regime filter:
Fewer flips in chop.
Clearer regime transitions.
Signals tend to occur later than ultra-fast tools, but with better confirmation quality.
3) Step size controls noise rejection
StepMult is the main “anti-chop” control:
Higher stepMult = bigger ATR steps = fewer updates, fewer signals, more confirmation, slower to react.
Lower stepMult = smaller steps = more updates, more signals, more sensitivity, more chop risk.
4) Generalization controls responsiveness of the underlying trend estimate
vf controls how “fast” the MA tries to be before stepping:
Higher vf makes the MA respond faster to new price information.
Lower vf makes the MA smoother and more conservative.
The step filter then decides whether that change is meaningful enough to matter.
Practical use cases
Trend filter for entries
Only take longs when direction is bullish.
Only take shorts when direction is bearish.
Avoid trades when StepGMA is flat for long periods, market is not repricing meaningfully.
Dynamic support and resistance
Because the line holds levels, it often behaves like structure:
In uptrends it can act as a rising support reference.
In downtrends it can act as falling resistance.
Signal quality layer
The step-based flip signals tend to be higher quality than basic MA crossovers because they require:
A meaningful volatility-adjusted move.
A confirmed direction change in the stepped trend structure.
Trade management
Use StepGMA as a trailing invalidation reference.
Use direction flips as “hard” regime exits.
Use separation vs slow MA as a “pressure” gauge for scaling decisions.
Tuning guidelines
MA Type
Pick based on the character you want:
T3, ALMA, KAMA are usually good defaults for clean trend representation.
HMA/LSMA are faster but may need larger stepMult to avoid twitch.
SMA is slow and stable but can be too laggy unless vf is increased.
MA Period
Sets the base smoothing horizon. Longer periods give “macro trend,” shorter periods give “tactical trend.”
Volume Factor (vf)
Sets responsiveness compensation:
0.05–0.25 is usually sensible.
Higher than that can get aggressive, step filter will save you, but your steps may fire more often.
ATR Period and StepMult
These define your structure sensitivity:
ATR Period controls how stable the volatility estimate is.
StepMult controls how large a move must be to change structure.
If you want fewer flips, increase StepMult or ATR Period. If you want quicker reaction, lower StepMult or ATR Period.
What this indicator is and is not
It is:
A trend structure MA that ignores sub-threshold noise.
A regime tool that uses volatility-adjusted repricing logic.
A configurable framework that works across assets and timeframes.
It is not:
A predictive reversal tool.
A scalping signal machine.
A replacement for risk management.
Summary
Step Generalized Moving Average combines a lag-compensated moving average (generalization via MA1/MA2 blending) with a volatility-scaled step filter (ATR-based quantization). The result is a stable, structure-like trend line that updates only when price movement is meaningful relative to volatility, producing cleaner regimes, fewer chop flips, and clearer trend bias than conventional moving averages.
Pine Script® indicator
ATR/Structure Trail Stop Loss This indicator is a high-performance trend-following tool designed to help traders stay in winning positions for maximum "R" gains. It solves the common problem of getting stopped out too early by combining Volatility (ATR) with Market Structure (Price Action Swings).
How it Works
The script calculates two different stop-loss levels and automatically chooses the most "conservative" one to protect your capital:
ATR Stop: Measures the current market volatility. If the market gets wild, the stop widens. If the market gets calm, the stop tightens.
Structure Stop: Looks at the lowest lows (for Longs) or highest highs (for Shorts) of the last few candles. This ensures you don't stay in a trade if the actual price trend breaks.
Key Features
Hybrid Logic: The stop strictly follows Closing Prices to prevent "wick-outs" from temporary spikes.
Trend Dashboard: A real-time table tracks ADX (Trend Power).
"RUN IT": High momentum; keep trailing for 12R–30R targets.
"TIGHTEN": Momentum is dying; consider locking in profits.
Visual Diamonds: Uses a Step-Line style with diamonds to show exactly when your stop-loss "locks in" a new level.
How to Use It (Step-by-Step)
Entry: Enter your trade based on your standard breakout strategy.
Initial Risk: Use the Initial Stop (5 points) until the price moves in your favor.
The Trail: Once the trend establishes, follow the Light White Diamonds.
Scaling: Use the ATR Multiplier input to adjust the "breathing room."
Lower Multiplier (e.g., 1.5): Tighter trail, good for scalp targets.
Higher Multiplier (e.g., 2.5+): Wider trail, best for catching 30R monster moves.
Exit: Close the position immediately when a candle closes on the opposite side of the diamonds.
Pine Script® indicator
True Range Smoothed SuperTrendTrue Range Smoothed SuperTrend (TRS SuperTrend | MisinkoMaster)
The True Range Smoothed SuperTrend is an innovative trend analysis indicator designed to identify clear market trends while minimizing noise. By combining a smoothed price source weighted by true range values with an ATR-based volatility multiplier, this tool delivers reliable trend signals adaptable to a wide variety of asset classes and timeframes.
It’s particularly useful for traders seeking a versatile trend-following system that balances sensitivity and stability.
🔍 Concept & Idea
The indicator enhances the classic SuperTrend concept by using a true range–weighted smoothing of price data instead of raw price or simple moving averages. This weighting helps focus on periods with higher volatility, improving the relevance of trend detection.
Along with smoothing, the indicator applies an ATR-based volatility multiplier to dynamically adjust the upper and lower trend bands, adapting to current market volatility conditions.
⚙️ How It Works
True Range Weighted Smoothing:
The source price (default: low) is multiplied by the true range values over the lookback period.
These weighted values are summed and normalized by the total true range sum.
The result is further smoothed using an Exponential Moving Average (EMA) with a length proportional to the square root of the input length, reducing noise while preserving trend responsiveness.
ATR-based Bands:
The Average True Range (ATR) is calculated with the same length as the smoothing period.
The ATR is multiplied by a user-defined multiplier to establish dynamic upper and lower bands around the smoothed price.
Trend Determination:
When the source price crosses above the upper band, a bullish trend is signaled.
Conversely, crossing below the lower band signals a bearish trend.
These crossings update the trend state, which controls plotted bands and trend labels.
🧩 Inputs Overview
Length – Controls the lookback period for true range weighting, ATR calculation, and smoothing. Affects sensitivity and smoothness (default 37).
Source – Price source used for calculation, defaulting to low.
Multiplier – Scales the ATR bands to adjust volatility sensitivity (default 1.45).
📌 Usage Notes
The TRS SuperTrend works well across various asset classes and timeframes.
The true range weighting improves trend detection in volatile markets by emphasizing price moves during active periods.
Adjust the length and multiplier inputs to balance between noise reduction and responsiveness for your specific market and strategy.
Trend changes are visually marked with “𝓛𝓸𝓷𝓰” and “𝓢𝓱𝓸𝓻𝓽” labels directly on the chart.
Background fills between bands and price improve visual clarity.
Combine with other confirmation tools and risk management practices for best results.
Not a standalone trading system; always validate and backtest prior to live trading.
⚠️ Disclaimer
This script is provided for educational and informational purposes only and does not constitute financial advice. Trading involves risk and users should perform their own analysis before making trading decisions.
Enjoy smoother and clearer trend analysis with the True Range Smoothed SuperTrend!
Pine Script® indicator
Extreme HMA ATR BandsExtreme HMA ATR Bands
Extreme HMA ATR Bands are a fast and smooth trend-following tool designed to capture directional moves while minimizing false signals across volatile markets.
🚀 Benefits
• High responsiveness to market moves
• Smooth trend tracking with fewer false signals
• Strong performance on assets such as SOLUSD, SUIUSD, and CROUSD
• Clear visual band structure for easier market interpretation
💡 Core Idea
The indicator builds adaptive bands around a smoothed price structure derived from Hull-type processing. By focusing on extreme values and combining them into a balanced midpoint, the bands capture trend direction while maintaining smooth behavior.
ATR is then applied to dynamically scale the bands according to market volatility.
⚙️ How It Works
A fast-smoothed price series is calculated using Hull-style logic.
Highest and lowest values of this series are measured over multiple stages.
These extremes are processed again to balance responsiveness and smoothness.
The resulting midpoint forms the base trend line.
ATR is added and subtracted from this midpoint to generate adaptive upper and lower bands.
The result is a fast yet stable band structure that reacts efficiently to market direction changes.
📌 Usage Notes
• Price moving above the upper band suggests bullish pressure.
• Price moving below the lower band suggests bearish pressure.
• Band expansion signals increasing volatility.
• Band contraction often indicates consolidation phases.
Enjoy and trade smart.
Pine Script® indicator
Length Adaptive MA SuperTrendLength Adaptive MA SuperTrend
Length Adaptive MA SuperTrend is a third-generation evolution of the SuperTrend concept, designed to improve signal accuracy while maintaining high responsiveness across different market conditions. The indicator dynamically adjusts its moving-average length to better match current market activity, allowing it to react quickly in fast markets while remaining stable during slower phases.
This adaptive behavior helps traders and investors visualize trend direction more clearly while reducing unnecessary noise, making the tool suitable for both beginners and advanced users seeking a responsive trend overlay.
🔍 How It Works
The indicator uses a moving average as the foundation for a SuperTrend-style structure, but instead of keeping the moving-average length fixed, it continuously adapts to changing market environments.
The script compares average activity levels across three horizons:
• Long-term period
• Medium-term period (half length)
• Short-term period (square-root length)
Activity is measured using one of three selectable drivers:
• ATR (volatility)
• Volume
• Standard deviation
Whichever period shows the strongest average activity becomes the active length used for calculating the moving-average base. This allows the indicator to automatically shift between faster and slower behavior depending on market conditions.
After selecting the active length, the result is slightly smoothed using the chosen moving-average type to produce a cleaner and more stable trend structure.
ATR-based bands are then applied around the adaptive base, and trend direction changes when price crosses these bands.
⚙️ Key Features
• Adaptive moving-average length selection
• Automatic adjustment between short, medium, and long market conditions
• Multiple smoothing types (SMA, EMA, WMA, HMA, VWMA, DEMA, TEMA, EWMA)
• ATR-based SuperTrend structure
• Trend transition markers
• Optional candle coloring based on active trend
🧩 Inputs Overview
• Moving-average smoothing type
• Base length and price source
• ATR length and multiplier
• Adaptive driver selection (ATR, Volume, or Standard Deviation)
📌 Usage Notes
• Helps visualize prevailing market trends across changing environments.
• Automatically adapts speed for trending and consolidating markets.
• Signals may change intrabar on lower timeframes.
• Best used with confirmation tools and proper risk management.
• Intended as an analytical tool, not financial advice.
Pine Script® indicator
Multiple Factor Adaptive MA SuperTrendMultiple Factor Adaptive MA SuperTrend
Multiple Factor Adaptive MA SuperTrend is an enhanced trend-following overlay that builds on the classical SuperTrend concept by introducing an adaptive moving-average base. The indicator dynamically adjusts to changing market conditions to produce smoother and faster trend signals, helping traders better track directional moves while reducing unnecessary noise.
Instead of relying on a fixed moving-average base, the indicator updates its baseline only when market conditions justify it. This creates a stabilizing effect during consolidation while allowing quicker reactions when volatility, momentum, or activity increases.
🔍 How It Works
The indicator combines:
• A user-selectable Moving Average as the core trend base
• ATR-based volatility bands to detect trend transitions
• An adaptive filter that determines when the base should update
The adaptive mechanism evaluates market conditions using one of several selectable drivers:
• ATR expansion (volatility increase)
• Rate-of-change acceleration
• Rising trading volume
• Increasing divergence between price and the moving average
If the chosen condition signals increased activity or market change, the moving-average base updates normally. Otherwise, the previous base value is retained, effectively smoothing the trend structure and filtering minor fluctuations.
Volatility bands are then calculated around this adaptive base using ATR multiplied by a configurable factor. Trend changes occur when price crosses these bands.
When price breaks above the upper band, a bullish trend is activated and the lower band becomes the trailing support. When price breaks below the lower band, a bearish trend is activated and the upper band acts as trailing resistance.
⚙️ Key Features
• Adaptive moving-average baseline
• Multiple MA types including SMA, EMA, WMA, HMA, VWMA, DEMA, TEMA, and EWMA
• ATR-based volatility bands
• Multiple adaptation modes (volatility, momentum, volume, divergence)
• Reduced noise during consolidation phases
• Smooth trend visualization and transition markers
🧩 Inputs Overview
• Moving-average type and length
• Price source selection
• ATR length and multiplier
• Adaptive filter method selection
📌 Usage Notes
• Useful for identifying prevailing market direction and trend shifts.
• Adaptive filtering can help reduce false signals during sideways markets.
• Signals may update intrabar on lower timeframes.
• Best results are achieved when combined with confirmation tools or risk management rules.
• This script is intended for analytical purposes and does not provide financial advice.
Pine Script® indicator
Adaptive MA SuperTrendAdaptive MA SuperTrend
Adaptive MA SuperTrend is a trend-following overlay indicator designed to deliver smoother and more responsive signals than the classical SuperTrend by dynamically combining two moving averages with volatility-based band calculations.
Instead of relying on a single average, the script calculates a selectable pair of moving averages and continuously assigns them as the upper or lower base depending on which value is greater at each bar. This adaptive swapping allows the structure to respond better to changing market conditions while preserving overall trend stability.
A volatility component is then added to the bases using either:
• Average True Range (ATR)
• Standard Deviation (SD)
The selected volatility measure is multiplied by a configurable factor to create adaptive bands around the moving-average bases. Price crossing these bands determines trend direction changes.
When price crosses above the upper band, the trend switches bullish and the lower band becomes the trailing support line. When price crosses below the lower band, the trend switches bearish and the upper band becomes the trailing resistance line. Only the active trend side is plotted to reduce visual noise and improve chart clarity.
Multiple moving-average pair options are provided, allowing users to choose combinations that match their preferred balance between smoothness and responsiveness, including SMA, EMA, WMA, HMA, VWMA, DEMA, TEMA, and ALMA-based combinations. Additional parameters are available when ALMA is selected.
⚙️ Key Features
• Adaptive swapping between two moving averages
• Choice of MA pairs with different responsiveness profiles
• ATR or Standard Deviation volatility bands
• Configurable volatility length and multiplier
• Optional ALMA tuning parameters
• Trend visualization with color-coded support/resistance lines
• Signal markers displayed on trend transitions
🧩 Inputs Overview
• Moving average pair selection
• Moving average length and price source
• Volatility method, length, and multiplier
• Optional ALMA offset and sigma parameters
📌 Usage Notes
• Designed to help visualize prevailing trend direction and potential trend shifts.
• Can be combined with confirmation tools or risk management rules within broader strategies.
• Signals are generated when price crosses volatility-adjusted moving-average bands; signals may update intrabar, especially on lower timeframes.
• This script is intended for analytical purposes and does not constitute financial advice. Users should test and validate performance within their own workflow before applying it to live trading.
Pine Script® indicator






















