Volume-Gated Trend Ribbon [QuantAlgo]🟢 Overview
The Volume-Gated Trend Ribbon employs a selective price-updating mechanism that filters market noise through volume validation, creating a trend-following system that responds exclusively to significant price movements. The indicator gates price updates to moving average calculations based on volume threshold crossovers, ensuring that only bars with significant participation influence the trend direction. By interpolating between fast and slow moving averages to create a multi-layered visual ribbon, the indicator provides traders and investors with an adaptive trend identification framework that distinguishes between volume-backed directional shifts and low-conviction price fluctuations across multiple timeframes and asset classes.
🟢 How It Works
The indicator first establishes a dynamic baseline by calculating the simple moving average of volume over a configurable lookback period, then applies a user-defined multiplier to determine the significance threshold:
avgVol = ta.sma(volume, volPeriod)
highVol = volume >= avgVol * volMult
The gated price mechanism employs conditional updating where the close price is only captured and stored when volume exceeds the threshold. During low-volume periods, the indicator maintains the last qualified price level rather than tracking every minor fluctuation:
var float gatedClose = close
if highVol
gatedClose := close
Dual moving averages are calculated using the gated price input, with the indicator supporting various MA types. The fast and slow periods create the outer boundaries of the trend ribbon:
fastMA = volMA(gatedClose, close, fastPeriod)
slowMA = volMA(gatedClose, close, slowPeriod)
Ribbon interpolation creates intermediate layers by blending the fast and slow moving averages using weighted combinations, establishing a gradient effect that visually represents trend strength and momentum distribution:
midFastMA = fastMA * 0.67 + slowMA * 0.33
midSlowMA = fastMA * 0.33 + slowMA * 0.67
Trend state determination compares the fast MA against the slow MA, establishing bullish regimes when the faster average trades above the slower average and bearish regimes during the inverse relationship. Signal generation triggers on state transitions, producing alerts when the directional bias shifts:
bullish = fastMA > slowMA
longSignal = trendState == 1 and trendState != 1
shortSignal = trendState == -1 and trendState != -1
The visualization architecture constructs a three-tiered opacity gradient where the ribbon's core (between mid-slow and slow MAs) displays the highest opacity, the inner layer (between mid-fast and mid-slow) shows medium opacity, and the outer layer (between fast and mid-fast) presents the lightest fill, creating depth perception that emphasizes the trend center while acknowledging edge uncertainty.
🟢 How to Use This Indicator
▶ Long and Short Signals: The indicator generates long/buy signals when the trend state transitions to bullish (fast MA crosses above slow MA) and short/sell signals when transitioning to bearish (fast MA crosses below slow MA). Because these crossovers only reflect volume-validated price movements, they represent significant level of participation rather than random noise, providing higher-conviction entry signals that filter out false breakouts occurring on thin volume.
▶ Ribbon Width Dynamics: The spacing between the fast and slow moving averages creates the ribbon width, which serves as a visual proxy for trend strength and volatility. Expanding ribbons indicate accelerating directional movement with increasing separation between short-term and long-term momentum, suggesting robust trend development. Conversely, contracting ribbons signal momentum deceleration, potential trend exhaustion, or impending consolidation as the fast MA converges toward the slow MA.
▶ Preconfigured Presets: Three optimized parameter sets accommodate different trading styles and market conditions. Default provides balanced trend identification suitable for swing trading on daily timeframes with moderate volume filtering and responsiveness. Fast Response delivers aggressive signal generation optimized for intraday scalping on 1-15 minute charts, using lower volume thresholds and shorter moving average periods to capture rapid momentum shifts. Smooth Trend offers conservative trend confirmation ideal for position trading on 4-hour to weekly charts, employing stricter volume requirements and extended periods to filter noise and identify only the most robust directional moves.
▶ Built-in Alerts: Three alert conditions enable automated monitoring: Bullish Trend Signal triggers when the fast MA crosses above the slow MA confirming uptrend initiation, Bearish Trend Signal activates when the fast MA crosses below the slow MA confirming downtrend initiation, and Trend Change alerts on any directional transition regardless of direction. These notifications allow you to respond to volume-validated regime shifts without continuous chart monitoring.
▶ Color Customization: Six visual themes (Classic, Aqua, Cosmic, Ember, Neon, plus Custom) accommodate different chart backgrounds and display preferences, ensuring optimal contrast and visual clarity across trading environments. The adjustable fill opacity control (0-100%) allows fine-tuning of ribbon prominence, with lower opacity values create subtle background context while higher values produce bold trend emphasis. Optional bar coloring extends the trend indication directly to the price bars, providing immediate directional reference without requiring visual cross-reference to the ribbon itself.
التقلب
Bollinger Bands Forecast with Signals (Zeiierman)█ Overview
Bollinger Bands Forecast with Signals (Zeiierman) extends classic Bollinger Bands into a forward-looking framework. Instead of only showing where volatility has been, it projects where the basis (midline) and band width are likely to drift next, based on recent trend and volatility behavior.
The projection is built from the measured slopes of the Bollinger basis, the standard deviation (or ATR, depending on the mode), and a volatility “breathing” component. On top of that, the script includes an optional projected price path that can be blended with a deterministic random walk, plus rejection signals to highlight failed band breaks.
█ How It Works
⚪ Bollinger Core
The script first computes standard Bollinger Bands using the selected Source, Length, and Multiplier:
Basis = SMA(Source, Length)
Band width = Multiplier × StDev(Source, Length)
Upper/Lower = Basis ± Width
This remains the “live” (non-forecast) structure on the chart.
⚪ Trend & Volatility Slope Estimation
To project forward, the indicator measures directional drift and volatility drift using linear regression differences:
Basis slope from the Bollinger basis
StDev slope from the Bollinger deviation
ATR slope for ATR-based projection mode
These slopes drive the forecast bands forward, reflecting the market’s recent directional and volatility regime.
⚪ Projection Engine (Forecast Bands)
At the last bar, the indicator draws projected basis, upper, and lower lines out to Forecast Bars. The projected basis can be:
Trend (straight linear projection)
Curved (ease-in/out transition toward projected endpoints)
Smoothed (extra smoothing on projected basis/width)
⚪ Price Path Projection + Optional Random Walk
In addition to projecting the bands, the script can draw a price forecast path made of a small number of zigzag swings.
Each swing targets a point offset from the projected basis by a multiple of the projected half-width (“width units”).
Decay gradually reduces swing size as the forecast deepens.
The Optional Random Walk Blend adds a deterministic drift component to the zigzag path. It’s not true randomness; it’s a stable pseudo-random sequence, so the drawing doesn’t jump around on refresh, while still adding “natural” variation.
⚪ Rejection Signals
Signals are based on failed attempts to break a band:
Bear Signal (Down): price tries to push above the upper band, then falls back inside, while still closing above the basis.
Bull Signal (Up): price tries to push below the lower band, then returns back inside, while still closing below the basis.
█ How to Use
⚪ Forward Support/Resistance Corridors
Treat the projected upper/lower bands as a future volatility envelope, not a guarantee:
The upper projection ≈ is likely a resistance level if the regime persists
The lower projection ≈ is likely a support level if the regime persists
Best used for trade planning, targets, and “where price could travel” under similar conditions.
⚪ Regime Read: Trend + Volatility
The projection shape is informative:
Rising basis + expanding width → trend with increasing volatility (needs wider stops / more caution)
Flat basis + compressing width → contraction regime (often precedes expansion)
⚪ Signals for Mean-Reversion / Failed Breakouts
The rejection markers are useful for fade-style setups:
A Down signal near/after upper-band failure can imply rotation back toward the basis.
An Up signal near/after lower-band failure can imply snap-back toward the basis.
With MA filtering enabled, signals are constrained to align with the broader bias, helping reduce chop-driven noise.
█ Related Publications
Donchian Predictive Channel (Zeiierman)
█ Settings
⚪ Bollinger Band
Controls the live Bollinger Bands on the chart.
Source – Price used for calculations.
Length – Lookback period; higher = smoother, lower = more reactive.
Multiplier – Bandwidth; higher = wider bands, lower = tighter bands.
⚪ Forecast
Controls the forward projection of the Bollinger Bands.
Forecast Bars – How far into the future the bands are projected.
Trend Length – Lookback used to estimate trend and volatility slopes.
Forecast Band Mode – Defines projection behavior (linear, curved, breathing, ATR-based, or smoothed).
⚪ Price Forecast
Controls the projected price path inside the bands.
ZigZag Swings – Number of projected oscillations.
Amplitude – Distance from basis, measured in bandwidth units.
Decay – Shrinks swings further into the forecast.
⚪ Random-Walk
Adds controlled randomness to the price path.
Enable – Toggle random-walk influence.
Blend – Strength of randomness vs. zigzag.
Step Size – Size of random steps (band-width units).
Decay – Reduces randomness as the forecast deepens.
Seed – Changes the (stable) random sequence.
⚪ Signals
Controls rejection/mean-reversion signals.
Show Signals – Enable/disable signal markers.
MA Filter (Type/Length) – Filters signals by trend direction.
-----------------
Disclaimer
The content provided in my scripts, indicators, ideas, algorithms, and systems is for educational and informational purposes only. It does not constitute financial advice, investment recommendations, or a solicitation to buy or sell any financial instruments. I will not accept liability for any loss or damage, including without limitation any loss of profit, which may arise directly or indirectly from the use of or reliance on such information.
All investments involve risk, and the past performance of a security, industry, sector, market, financial product, trading strategy, backtest, or individual's trading does not guarantee future results or returns. Investors are fully responsible for any investment decisions they make. Such decisions should be based solely on an evaluation of their financial circumstances, investment objectives, risk tolerance, and liquidity needs.
PMax - Asymmetric MultipliersDescription: This script is an enhanced version of the popular PMax (Profit Maximizer) indicator, originally developed by KivancOzbilgic. It has been converted into a full strategy with advanced customization options for backtesting and trend following.
Key Features & Modifications:
Asymmetric ATR Multipliers: Unlike the standard version, this script allows you to set different ATR multipliers for Upper (Short/Resistance) and Lower (Long/Support) bands.
Default Upper: 1.5 (Tighter trailing for Short positions)
Default Lower: 3.0 (Wider trailing for Long positions to avoid whipsaws)
Expanded MA Types: Added HULL (HMA) and VAR (Variable Index Dynamic Average) options.
VAR is highly recommended for filtering out noise in ranging markets.
HULL is ideal for scalping and faster reactions.
Built-in Risk Management: A fixed 5% Stop Loss mechanism is integrated into the strategy. It protects your capital by closing positions if the price moves 5% against you, even if the trend hasn't reversed yet.
Visibility Fix: Solved the issue where the PMax line would disappear or start at zero in the initial bars.
How to Use:
Use the VAR MA type for trend following in volatile markets.
Adjust the "Stop Loss Percent" input to fit your risk appetite.
The strategy employs an "Always In" logic (Long/Short) but respects the hard Stop Loss.
Credits: Original PMax logic by KivancOzbilgic.
SuperTrend Long/Short Signals With Fibonacci“By using the updated version of the previously published indicator with a Fibonacci extension, you can obtain multiple take-profit levels and make profitable trades.
Wishing you plenty of profits.
Volatility Targeting: Single Asset [BackQuant]Volatility Targeting: Single Asset
An educational example that demonstrates how volatility targeting can scale exposure up or down on one symbol, then applies a simple EMA cross for long or short direction and a higher timeframe style regime filter to gate risk. It builds a synthetic equity curve and compares it to buy and hold and a benchmark.
Important disclaimer
This script is a concept and education example only . It is not a complete trading system and it is not meant for live execution. It does not model many real world constraints, and its equity curve is only a simplified simulation. If you want to trade any idea like this, you need a proper strategy() implementation, realistic execution assumptions, and robust backtesting with out of sample validation.
Single asset vs the full portfolio concept
This indicator is the single asset, long short version of the broader volatility targeted momentum portfolio concept. The original multi asset concept and full portfolio implementation is here:
That portfolio script is about allocating across multiple assets with a portfolio view. This script is intentionally simpler and focuses on one symbol so you can clearly see how volatility targeting behaves, how the scaling interacts with trend direction, and what an equity curve comparison looks like.
What this indicator is trying to demonstrate
Volatility targeting is a risk scaling framework. The core idea is simple:
If realized volatility is low relative to a target, you can scale position size up so the strategy behaves like it has a stable risk budget.
If realized volatility is high relative to a target, you scale down to avoid getting blown around by the market.
Instead of always being 1x long or 1x short, exposure becomes dynamic. This is often used in risk parity style systems, trend following overlays, and volatility controlled products.
This script combines that risk scaling with a simple trend direction model:
Fast and slow EMA cross determines whether the strategy is long or short.
A second, longer EMA cross acts as a regime filter that decides whether the system is ACTIVE or effectively in CASH.
An equity curve is built from the scaled returns so you can visualize how the framework behaves across regimes.
How the logic works step by step
1) Returns and simple momentum
The script uses log returns for the base return stream:
ret = log(price / price )
It also computes a simple momentum value:
mom = price / price - 1
In this version, momentum is mainly informational since the directional signal is the EMA cross. The lookback input is shared with volatility estimation to keep the concept compact.
2) Realized volatility estimation
Realized volatility is estimated as the standard deviation of returns over the lookback window, then annualized:
vol = stdev(ret, lookback) * sqrt(tradingdays)
The Trading Days/Year input controls annualization:
252 is typical for traditional markets.
365 is typical for crypto since it trades daily.
3) Volatility targeting multiplier
Once realized vol is estimated, the script computes a scaling factor that tries to push realized volatility toward the target:
volMult = targetVol / vol
This is then clamped into a reasonable range:
Minimum 0.1 so exposure never goes to zero just because vol spikes.
Maximum 5.0 so exposure is not allowed to lever infinitely during ultra low volatility periods.
This clamp is one of the most important “sanity rails” in any volatility targeted system. Without it, very low volatility regimes can create unrealistic leverage.
4) Scaled return stream
The per bar return used for the equity curve is the raw return multiplied by the volatility multiplier:
sr = ret * volMult
Think of this as the return you would have earned if you scaled exposure to match the volatility budget.
5) Long short direction via EMA cross
Direction is determined by a fast and slow EMA cross on price:
If fast EMA is above slow EMA, direction is long.
If fast EMA is below slow EMA, direction is short.
This produces dir as either +1 or -1. The scaled return stream is then signed by direction:
avgRet = dir * sr
So the strategy return is volatility targeted and directionally flipped depending on trend.
6) Regime filter: ACTIVE vs CASH
A second EMA pair acts as a top level regime filter:
If fast regime EMA is above slow regime EMA, the system is ACTIVE.
If fast regime EMA is below slow regime EMA, the system is considered CASH, meaning it does not compound equity.
This is designed to reduce participation in long bear phases or low quality environments, depending on how you set the regime lengths. By default it is a classic 50 and 200 EMA cross structure.
Important detail, the script applies regime_filter when compounding equity, meaning it uses the prior bar regime state to avoid ambiguous same bar updates.
7) Equity curve construction
The script builds a synthetic equity curve starting from Initial Capital after Start Date . Each bar:
If regime was ACTIVE on the previous bar, equity compounds by (1 + netRet).
If regime was CASH, equity stays flat.
Fees are modeled very simply as a per bar penalty on returns:
netRet = avgRet - (fee_rate * avgRet)
This is not realistic execution modeling, it is just a simple turnover penalty knob to show how friction can reduce compounded performance. Real backtesting should model trade based costs, spreads, funding, and slippage.
Benchmark and buy and hold comparison
The script pulls a benchmark symbol via request.security and builds a buy and hold equity curve starting from the same date and initial capital. The buy and hold curve is based on benchmark price appreciation, not the strategy’s asset price, so you can compare:
Strategy equity on the chart symbol.
Buy and hold equity for the selected benchmark instrument.
By default the benchmark is TVC:SPX, but you can set it to anything, for crypto you might set it to BTC, or a sector index, or a dominance proxy depending on your study.
What it plots
If enabled, the indicator plots:
Strategy Equity as a line, colored by recent direction of equity change, using Positive Equity Color and Negative Equity Color .
Buy and Hold Equity for the chosen benchmark as a line.
Optional labels that tag each curve on the right side of the chart.
This makes it easy to visually see when volatility targeting and regime gating change the shape of the equity curve relative to a simple passive hold.
Metrics table explained
If Show Metrics Table is enabled, a table is built and populated with common performance statistics based on the simulated daily returns of the strategy equity curve after the start date. These include:
Net Profit (%) total return relative to initial capital.
Max DD (%) maximum drawdown computed from equity peaks, stored over time.
Win Rate percent of positive return bars.
Annual Mean Returns (% p/y) mean daily return annualized.
Annual Stdev Returns (% p/y) volatility of daily returns annualized.
Variance of annualized returns.
Sortino Ratio annualized return divided by downside deviation, using negative return stdev.
Sharpe Ratio risk adjusted return using the risk free rate input.
Omega Ratio positive return sum divided by negative return sum.
Gain to Pain total return sum divided by absolute loss sum.
CAGR (% p/y) compounded annual growth rate based on time since start date.
Portfolio Alpha (% p/y) alpha versus benchmark using beta and the benchmark mean.
Portfolio Beta covariance of strategy returns with benchmark returns divided by benchmark variance.
Skewness of Returns actually the script computes a conditional value based on the lower 5 percent tail of returns, so it behaves more like a simple CVaR style tail loss estimate than classic skewness.
Important note, these are calculated from the synthetic equity stream in an indicator context. They are useful for concept exploration, but they are not a substitute for professional backtesting where trade timing, fills, funding, and leverage constraints are accurately represented.
How to interpret the system conceptually
Vol targeting effect
When volatility rises, volMult falls, so the strategy de risks and the equity curve typically becomes smoother. When volatility compresses, volMult rises, so the system takes more exposure and tries to maintain a stable risk budget.
This is why volatility targeting is often used as a “risk equalizer”, it can reduce the “biggest drawdowns happen only because vol expanded” problem, at the cost of potentially under participating in explosive upside if volatility rises during a trend.
Long short directional effect
Because direction is an EMA cross:
In strong trends, the direction stays stable and the scaled return stream compounds in that trend direction.
In choppy ranges, the EMA cross can flip and create whipsaws, which is where fees and regime filtering matter most.
Regime filter effect
The 50 and 200 style filter tries to:
Keep the system active in sustained up regimes.
Reduce exposure during long down regimes or extended weakness.
It will always be late at turning points, by design. It is a slow filter meant to reduce deep participation, not to catch bottoms.
Common applications
This script is mainly for understanding and research, but conceptually, volatility targeting overlays are used for:
Risk budgeting normalize risk so your exposure is not accidentally huge in high vol regimes.
System comparison see how a simple trend model behaves with and without vol scaling.
Parameter exploration test how target volatility, lookback length, and regime lengths change the shape of equity and drawdowns.
Framework building as a reference blueprint before implementing a proper strategy() version with trade based execution logic.
Tuning guidance
Lookback lower values react faster to vol shifts but can create unstable scaling, higher values smooth scaling but react slower to regime changes.
Target volatility higher targets increase exposure and drawdown potential, lower targets reduce exposure and usually lower drawdowns, but can under perform in strong trends.
Signal EMAs tighter EMAs increase trade frequency, wider EMAs reduce churn but react slower.
Regime EMAs slower regime filters reduce false toggles but will miss early trend transitions.
Fees if you crank this up you will see how sensitive higher turnover parameter sets are to friction.
Final note
This is a compact educational demonstration of a volatility targeted, long short single asset framework with a regime gate and a synthetic equity curve. If you want a production ready implementation, the correct next step is to convert this concept into a strategy() script, add realistic execution and cost modeling, test across multiple timeframes and market regimes, and validate out of sample before making any decision based on the results.
VEGA (Velocity of Efficient Gain Adaptation)VEGA (Velocity of Efficient Gain Adaptation)
VEGA is a momentum oscillator that measures the velocity of an efficiency-weighted adaptive moving average. Unlike traditional momentum indicators that react uniformly to all price movements, VEGA intelligently adapts its sensitivity based on market conditions—responding quickly during trending periods and filtering noise during consolidation.
--------------------------------
What Makes VEGA Different
Efficiency-Driven Adaptation
At its core, VEGA uses the Efficiency Ratio (ER) to distinguish between trending and choppy markets. When price moves efficiently in one direction, VEGA's underlying adaptive MA speeds up to capture the move. When price chops sideways, it slows down to avoid whipsaws. This creates a momentum reading that's inherently cleaner than fixed-period alternatives.
Linear Regression Smoothed Source
VEGA offers an optional LinReg-smoothed price source that blends regular candles with linear regression values. This pre-smoothing reduces noise before it ever enters the calculation, resulting in a histogram that's easier to read without sacrificing responsiveness. The mix ratio lets you dial in exactly how much smoothing you want.
Z-Score Normalization with Dead Zone
Rather than arbitrary oscillator bounds, VEGA normalizes output as standard deviations from the mean. This gives statistically meaningful levels: readings above +2σ or below -2σ represent genuinely extreme momentum. The configurable dead zone (with Snap, Soft Fade, or None modes) filters out insignificant movements near zero, keeping you focused on signals that matter.
--------------------------------
How It Works
1. Source Preparation — Price is smoothed via a LinReg/regular candle blend
2. Efficiency Ratio — Measures directional movement vs total movement over the lookback period
3. Adaptive MA — Applies variable smoothing based on efficiency (fast during trends, slow during chop)
4. Velocity — Calculates the rate of change of the adaptive MA
5. Normalization — Converts to Z-Score (standard deviations) or ATR-normalized percentage
6. Dead Zone — Optionally filters near-zero values to reduce noise
--------------------------------
How To Read VEGA
Signal and Interpretation
Histogram above zero | Bullish momentum
Histogram below zero | Bearish momentum
Bright color | Momentum accelerating
Faded color | Momentum decelerating
Beyond ±1σ bands | Above-average momentum
Beyond ±2σ bands | Extreme momentum (potential reversal zone)
Zero line cross*| Momentum shift
--------------------------------
Key Settings
ER Length — Lookback for efficiency ratio calculation. Higher = smoother, slower adaptation.
Fast/Slow Smoothing — Controls the adaptive MA's responsiveness range. The MA blends between these based on efficiency.
LinReg Settings — Enable smoothed candles and adjust the blend ratio (0 = regular candles, 1 = full LinReg, 0.5 = 50/50 mix).
Z-Score Lookback — Period for calculating mean and standard deviation. Shorter = more reactive normalization.
Dead Zone Type — How to handle near-zero values:
Snap — Hard cutoff to zero
Soft Fade — Gradual reduction toward zero
None — No filtering
Dead Zone Threshold — Values within this Z-Score range are affected by the dead zone setting.
VEGA works on any timeframe and any market. For best results, adjust the ER Length and LinReg settings to match your trading style and the volatility characteristics of your instrument.
SUPERTREND VALIDADO ADX EMAS VWAP # Modular Trading System - SuperTrend + ADX + Multi-Filter Confirmation
## Overview
Professional modular trading system designed for trend-following strategies on 4H timeframes. Features a clean, mobile-optimized interface with customizable filters and real-time status monitoring.
## Core Features
### Validated Components (Backtested)
- **SuperTrend (ATR 10, Multiplier 3.0)**: Primary trend direction filter with visual fill
- **ADX >23**: Trend strength confirmation (14-period)
- Proven performance: 52.11% win rate, 3.162 profit factor over 4 years
### Additional Filters (Optional)
- **DI Spread >9**: Directional movement confirmation
- **Volume > EMA20**: Volume confirmation above 20-period average
- **EMA System**: 7/21/50 with dynamic coloring
- **VWAP**: Daily volume-weighted average price
### Visual Elements
- **SuperTrend Line**: Green (bullish) / Red (bearish) with background fill
- **EMA 7**: Yellow when ADX >23, White when ADX ≤23
- **EMA 21**: Green (price above) / Red (price below)
- **EMA 50**: Blue reference line
- **VWAP**: Orange line
- **PDH/PDL**: Previous day high/low levels
- **EMA Cross Signals**: Small dots marking 7/21 crossovers
### Smart Money Concepts
- Automatic Previous Day High (PDH) / Previous Day Low (PDL) tracking
- Horizontal lines extending from current price
- Clear labeling for support/resistance levels
## Status Dashboard
Compact 2-column table (top-right) shows:
```
FILTERS | STATUS
1. ADX >23 | 47.6 OK / 18.2 NO
2. DI Spread >9 | Bullish / Bearish
3. SuperTrend | Bullish / Bearish
4. Volume >EMA20 | 1.25x OK / 0.14x NO
─────────────────────────────
SIGNAL | BUY / SELL / WAIT
```
Color-coded backgrounds:
- Green: Condition met
- Red: Condition not met
- Yellow: Waiting for confirmation
## Signal Logic
### Entry Conditions
**LONG**: All active filters must align
- SuperTrend bullish (green)
- ADX >23
- DI+ > DI- (if DI Spread enabled)
- Volume > EMA20 (if Volume enabled)
- Price > EMA21 and EMA7 > EMA21 (if EMAs enabled)
**SHORT**: All active filters must align
- SuperTrend bearish (red)
- ADX >23
- DI- > DI+ (if DI Spread enabled)
- Volume > EMA20 (if Volume enabled)
- Price < EMA21 and EMA7 < EMA21 (if EMAs enabled)
### Exit Conditions
- SuperTrend direction change
- Clear "EXIT" markers on chart
### Position Management
- One position per trend (no pyramiding)
- Prevents multiple entries in same direction
- "WAIT" status when conditions partially met
## Settings & Customization
### Filters (Enable/Disable)
**Core Filters:**
- ✓ SuperTrend (VALIDATED)
- ✓ ADX >23 (VALIDATED)
**Additional Filters:**
- ⚠️ DI Spread >9 (EXPERIMENTAL)
- ⚠️ Volume > EMA20 (EXPERIMENTAL)
- ⚠️ EMAs 7/21/50 (EXPERIMENTAL)
**Visual:**
- Show EMA 7/21 Crosses (dots)
### Parameters
**SuperTrend:**
- ATR Period: 10 (default)
- ATR Multiplier: 3.0 (default)
**ADX/DI:**
- ADX Length: 14 (default)
- ADX Threshold: 23 (default)
- DI Spread Threshold: 9 (default)
**Volume:**
- Volume EMA: 20 (default)
**EMAs:**
- Fast EMA: 7 (default)
- Medium EMA: 21 (default)
- Slow EMA: 50 (default)
## Alerts
Pre-configured alerts for:
- Long Signal (BUY - Entry confirmed)
- Short Signal (SELL - Entry confirmed)
- Exit Long (EXIT LONG - SuperTrend changed)
- Exit Short (EXIT SHORT - SuperTrend changed)
- EMA Cross Up (EMA 7 crossed above EMA 21)
- EMA Cross Down (EMA 7 crossed below EMA 21)
## Best Practices
### Recommended Setup (Validated System)
```
Enable ONLY:
- SuperTrend: ON
- ADX >23: ON
- All other filters: OFF
```
### Testing New Filters
1. Enable experimental filters
2. Backtest thoroughly before live trading
3. Compare performance metrics
4. Validate with demo account first
### Timeframe
- Optimized for: 4H charts
- Tested on: Bitcoin/USDT
- Works on: Any trending instrument
## Risk Management
This indicator provides entry/exit signals but does NOT include:
- Stop loss levels
- Take profit targets
- Position sizing
Always use proper risk management:
- Maximum 1-2% risk per trade
- Use stop losses
- Follow your trading plan
## Performance Notes
**Validated Backtest Results (SuperTrend + ADX only):**
- Win Rate: 52.11%
- Profit Factor: 3.162
- Return: +45.46% (4 years)
- Tested Period: 2020-2024
- Instrument: BTC/USDT 4H
**Important:** Adding additional filters changes the system. Results may vary. Always backtest your specific configuration before live trading.
## Mobile Optimization
- Compact table design
- Clear color coding
- Minimal chart clutter
- Large signal text
- Optimized for small screens
## Use Cases
✅ **Ideal for:**
- Trend-following strategies
- Swing trading (4H timeframe)
- Clear market conditions
- Systematic traders
❌ **NOT ideal for:**
- Scalping (too slow)
- Range-bound markets
- Counter-trend strategies
- Lateral/choppy conditions
## Credits & Methodology
Based on proven technical analysis principles:
- SuperTrend (volatility-based trend following)
- ADX (trend strength measurement)
- Directional Indicators (DI+/DI-)
- Volume analysis
- EMA systems
**Designed for:** Disciplined execution over frequent trading
**Philosophy:** Quality setups > Quantity of trades
## Disclaimer
This indicator is for educational purposes only. Past performance does not guarantee future results. Always:
- Test on demo account first
- Use proper risk management
- Never risk more than you can afford to lose
- Consult a financial advisor
Trading involves substantial risk. This tool does not constitute financial advice.
---
## Version History
**v2.0 (Current)**
- Modular filter system
- 2-column compact status table
- EMA 7 dynamic coloring (yellow when ADX >23)
- EMA 50 + VWAP added
- PDH/PDL levels
- EMA cross markers
- Improved signal logic
- One position per trend
- Multiple alert conditions
---
**For support, updates, or feedback, contact the developer.**
Renko Average Bricks This indicator calculates the average RENKO brick streaks. Streaks=consecutive bricks of the same color. EX. G= 1 streak of 1. GGG = 1 streak of 3. RR 1 streak of 2. Single bricks count. There is the option for look back period which can be changed but Defaults to 50. Calculates the last 50 completed green streaks and then averages them. Same with red streaks. Only closed bricks count.
Very Simple and can be used for targets, ect.
Cheers
rj_temu_pair_tradea simple "temu" implementation of a pair trade
see robotjames.substack.com for details.
Tailwind (SPY)Tailwind is a staggered level breakout strategy (Grid Breakout), designed to trade the SPY, although the logic can be applied to any asset.
In this case, traditional indicators are not used. Instead, the price is divided into a grid based on a step size (step_size), which defaults to 20 points.
The strategy looks for the exact moment when the price "breaks out" or crosses upward one of these invisible steps (since there is an upward bias). It buys if the current candle closed above the step, but the previous candle closed below that same level. In other words, it detects when the price crosses a grid line.
Once it enters a trade (buy), it sets fixed and symmetric targets based on the step size.
• Entry: The price of the base level is assumed (the multiple of 20).
• Take Profit: entry_level + step_size. It aims to gain exactly one step upward.
• Stop Loss: entry_level - step_size. It cuts losses if the price falls exactly one step
downward.
The code includes advanced visual logic (line.new and line.set_x2):
• When a trade is opened, it draws a dashed green line on the chart indicating where your Take Profit is.
• It draws a dashed red line indicating your Stop Loss.
• These lines extend to the right as long as the trade remains open.
Capital Configuration
• Initial Capital: 20,000 USDT (or the base currency).
• Position Size: Risks 10% of your total capital on each trade.
• Commission: Simulates a 0.1% cost per trade.
You'll love testing how it performs on a weekly chart. Best regards!
SUPERTREND ADX FACTOR Modular Trading System - SuperTrend + ADX + DI
A comprehensive trend-following system with customizable filters for precise trade execution.
CORE COMPONENTS:
- SuperTrend with visual fill (trend detection)
- ADX + Directional Indicators (trend strength confirmation)
- Volume filter (optional)
- EMAs 7/21/50 (optional)
- Daily VWAP (optional)
- Previous Day High/Low levels (support/resistance)
KEY FEATURES:
✓ One entry per trend - avoids overtrading
✓ Entry: ADX crosses above threshold with SuperTrend alignment
✓ Exit: SuperTrend direction change
✓ Real-time status dashboard showing all filter conditions
✓ Clear BUY/SELL signals with EXIT markers
✓ All filters can be toggled ON/OFF for testing
✓ Customizable parameters for each indicator
DASHBOARD DISPLAY:
- Live ADX value (green >23 / red <23)
- DI+/DI- values with color coding
- Volume metrics
- Position status (IN/OUT)
- Signal status (BUY/SELL/WAIT)
IDEAL FOR:
Swing traders and position traders on 4H timeframe looking for high-probability trend entries with proper confirmation.
Default configuration: SuperTrend (ATR 10, 3.0) + ADX >23 + DI alignment
SuperTrend Long/Short Signals“Provides trend-based long and short signals. With regular use while adhering to the entry, stop-loss, and take-profit levels, profits can be achieved.”
RSI WMA Crossover Momentum w/ HighlightRSI WMA Crossover Momentum
This is a momentum indicator that tracks the RSI. Its principle is to use the WMA line to determine the trend of the RSI, and from the RSI, the price trend can be determined.
Tailwind(XMR)Tailwind is a staggered level breakout strategy (Grid Breakout), apparently designed to trade Monero (XMR), although the logic can be applied to any asset.
In this case, traditional indicators are not used. Instead, the price is divided into a grid based on a step size (step_size), which defaults to 27 points.
The strategy looks for the exact moment when the price "breaks out" or crosses upward one of these invisible steps (since there is an upward bias). It buys if the current candle closed above the step, but the previous candle closed below that same level. In other words, it detects when the price crosses a grid line.
Once it enters a trade (buy), it sets fixed and symmetric targets based on the step size.
• Entry: The price of the base level (the multiple of 27) is assumed.
• Take Profit: entry_level + step_size. It aims to gain exactly one step upward.
• Stop Loss: entry_level - step_size. It cuts losses if the price falls exactly one step downward.
The code includes advanced visual logic (line.new and line.set_x2):
• When a trade is opened, it draws a dashed green line on the chart indicating where your Take Profit is.
• It draws a dashed red line indicating your Stop Loss.
• These lines extend to the right as long as the trade remains open.
Capital Configuration
• Initial Capital: 20,000 USDT (or the base currency).
• Position Size: Risks 10% of your total capital on each trade.
• Commission: Simulates a 0.1% cost per trade.
The system operates on timeframes of 5 minutes, 15 minutes, 30 minutes, 45 minutes, 4 hours...
HAR Volatility ATR v1.0 (Andreus Villalobos)
Indicator based on the HAR (Hyper-Realized Volatility) model.
Combines daily, weekly, and monthly ATRs to project:
– Most probable price range (90%)
– Most probable take profit (60%)
Does not generate entry signals.
Designed for use in conjunction with:
market structure, liquidity, and price action.
Works on Forex, Indices, Gold, and Cryptocurrencies.
Tailwind.(BTC)Imagine the price of Bitcoin is like a person climbing a staircase.
The Steps (Grid): Instead of watching every single price movement, the strategy divides the market into fixed steps. In your configuration, each step measures **3,000 points**. (Examples: 60,000, 63,000, 66,000...).
The Signal: We buy only when the price climbs a full step decisively.
The "Expensive Price" Filter: If the price jumps the step but lands too far away (the candle closes too high), we do not buy. It is like trying to board a train that has already started moving too fast; the risk is too high.
Rigid Exits: The Take Profit (TP) and Stop Loss (SL) are calculated from the edge of the step , not from the specific price where you managed to buy. This preserves the geometric structure of the market.
The Code Logic (Step-by-Step)
A. The Math of the Grid (`math.floor`)
pinescript
level_base = math.floor(close / step_size) * step_size
This is the most important line.
What does it do? It rounds the price down to the nearest multiple of 3,000.
Example: If BTC is at 64,500 and the step size is 3,000:
1. Divide: $64,500 / 3,000 = 21.5$
2. `math.floor` (Floor): Removes the decimals $\rightarrow$ remains $21$.
3. Multiply: $21 * 3,000 = 63,000$.
Result: The code knows that the current "floor" is **63,000**, regardless of whether the price is at 63,001 or 65,999.
B. The Strict Breakout (`strict_cross`)
pinescript
strict_cross = (open < level_base) and (close > level_base)
Most strategies only check if `close > level`. We do things slightly differently:
`open < level_base`: Requires the candle to have "born" *below* the line (e.g., opened at 62,900).
`close > level_base`: Requires the candle to have *finished* above the line (e.g., closed at 63,200).
Why? This avoids entering on gaps (price jumps where the market opens already very high) and confirms that there was real buying power crossing the line.
C. The "Expensive Price" Filter (`max_dist_pct`)
pinescript
limit_price_entry = level_base + (step_size * (max_dist_pct / 100.0))
price_is_valid = close <= limit_price_entry
Here you apply the percentage rule:
-If the level is 63,000 and the next is 66,000 (a difference of 3,000).
-If `max_dist_pct` is **60%**, the limit is $63,000 + (60\% \text{ of } 3,000) = 64,800$.
-If the breakout candle closes at **65,000**, the variable `price_is_valid` will be **false** and it will not enter the trade. This avoids buying at the ceiling.
D. TP and SL Calculation (Anchored to the Level)
pinescript
take_profit = level_base + (step_size * tp_mult)
stop_loss = level_base - (step_size * sl_mult)
Note that we use `level_base` and not `close`.
-If you entered because the price broke 63,000, your SL is calculated starting from 63,000.
-If your SL is 1.0x, your stop will be exactly at 60,000.
This is crucial: If you bought "expensive" (e.g., at 63,500), your real stop is wider (3,500 points) than if you bought cheap (63,100). Because you filter out expensive entries, you protect your Risk/Reward ratio.
E. Visual Management (`var line`)
The code uses `var` variables to remember the TP and SL lines and the `line.set_x2` function to stretch them to the right while the operation remains open, providing that visual reference on the chart until the trade ends.
Workflow Summary
Strategy Parameters:
Total Capital: $20,000
We will use 10% of total capital per trade.
Commissions: 0.1% per trade.
TP: 1.4
SL : 1
Step Size (Grid): 3,000
We use the 200 EMA as a trend filter.
Feel free to experiment with the parameters to your liking. Cheers.
Trinity Bollinger Bands Pro with BreakoutsTrinity Bollinger Bands Pro Indicator
The **Trinity Bollinger Bands Pro + Triple Bands & Expansion** is a highly customized, advanced volatility and breakout indicator built on the classic Bollinger Bands framework. It expands the standard single-pair bands into **three independent deviation levels** (typically 1σ, 2σ, and 3σ) around a user-selectable moving average basis (default EMA 20). This creates clear "zones" of volatility, with dynamic trend-based coloring, layered fills, fixed-style labels, and a statistical volatility expansion detector shown as a directional background highlight in a separate pane. The result is a visually intuitive tool that helps traders identify consolidation, building momentum, confirmed trends, and rare explosive moves with high-probability filtering.
### Why It's Good and Different from Standard Indicators
This indicator stands out by addressing common limitations of traditional Bollinger Bands and multi-deviation scripts:
- **Layered statistical significance**: Unlike single (2σ) or basic double-band setups, it provides three distinct levels—early momentum (1σ), standard confirmation (2σ), and extreme/rare breakouts (3σ)—making it easier to stage trades progressively rather than relying on one ambiguous cross.
- **Trend-aware visuals**: Bands, basis, and fills change color based on price position relative to a separate trend MA, giving immediate bullish/bearish bias without needing additional indicators.
- **Clean, fixed labels**: Tiny, arrow-pointing labels ("1/2/3 SD Above/Below", "BB Basis") with consistent colors (purple upper, blue lower, yellow basis) provide instant identification
- **Statistical expansion detection**: Uses percentile ranking of band width "bell curve" concept" to identify abnormally high volatility, triggering directional background highlights (green bullish, red bearish) earlier than raw width spikes.
- **Reduced noise and fakeouts**: Tiered breakouts + expansion filter focus alerts on high-probability moves, unlike most BB scripts that flood signals on every touch.
Compared to popular public scripts (e.g., standard Bollinger Bands, Triple BB variants, or separate BBW Percentile tools), this combines everything into one cohesive indicator with superior visual clarity and statistical rigor.
### Key Features
- **Triple customizable bands**: Enable/disable and adjust multipliers for 1σ (early), 2σ (confirmed), 3σ (extreme) deviations.
- **Trend-based dynamic coloring**: Separate editable colors for each band set (bullish/bearish).
- **Layered zone fills**: Colored between bands with transparency, reflecting current trend.
- **Fixed tiny labels**: All left-pointing arrows with purple (upper), blue (lower), yellow (basis) backgrounds for quick reference.
- **Statistical expansion overlay**: with directional background (green/red) during extreme volatility expansions (earlier trigger using 2σ width).
- **Tiered alerts**: Early (Band 1), Confirmed (Band 2), Extreme (Band 3), High-Probability (Extreme + expansion), and general expansion alerts.
- **Fully configurable basis**: Length, type (SMA/EMA/WMA/RMA), and thin fixed lines for minimal clutter.
### How Traders Can Use It
- **Spot squeezes and breakouts**: Watch for tight bands (low width) → expansion background → price closing outside Band 1 (early entry), Band 2 (add/confirm), Band 3 (strong trend conviction).
- **Filter fakeouts**: Only act on crosses accompanied by expansion background color matching trend direction—dramatically reduces whipsaws.
- **Trend riding**: Price "walking" colored bands (e.g., hugging upper purple-label bands in green background = strong bullish momentum).
- **Scalping/intraday**: On lower timeframes (e.g., 10min), use early Band 1 signals with expansion for quick moves.
- **Swing/position trading**: Wait for Band 3 extreme breakout + colored background for higher-probability, larger moves.
- **Risk management**: Place stops near basis or inner band; trail using outer bands during expansions.
Overall, this indicator excels at turning volatility into actionable, staged signals with visual simplicity—ideal for traders seeking an edge in identifying real explosive trends over noise. It's particularly powerful on volatile stocks like AMD/INTC or indices during news/events.
Session Volume Profile Sniffer: HVN & Rejection ZonesA simple tool built for traders who rely on intraday volume structure.
What this script does
This script tracks volume distribution inside a selected session and highlights two key price levels:
High Volume Nodes (HVNs) — areas where price spent time building heavy participation.
Low Volume Nodes (LVNs) — thin zones where price moved quickly with very little interest.
Instead of plotting a full profile, this tool gives you the exact rejection-level lines you usually hunt manually.
Why these levels matter
HVN → price tends to react, stall, or flip direction
LVN → price often rejects strongly since liquidity is thin
Rejection patterns around these areas give clean entry signals
Positioning trades around HVN/LVN helps filter noise in choppy sessions
This script removes the trouble of drawing profiles, counting bins, or guessing node levels. Everything is calculated inside the session you choose.
How the detection works
Inside your session window, the script:
1. Tracks each tick-based price bucket
2. Accumulates raw volume for every bucket
Identifies:
HVNs = buckets with volume above a tier
LVNs = buckets with volume below a tier
3. Prints each level as a single clean line
4. Generates:
Long signal → bounce from LVN
Short signal → rejection from HVN
Built-in exits use ATR-based conditions for quick testing.
Features
Session-based volume mapping
HVN + LVN levels drawn automatically
Entry triggers based on rejection
ATR exits for experimental backtests
Clean, minimal visual output
Best use cases
Intraday futures
Index scalping
FX sessions (London / NY)
Crypto sessions (user-timed)
Anyone who trades around volume structure
Adjustable settings
Session window
Volume bin size
HVN multiplier
LVN multiplier
Enable/disable zone lines
This keeps it flexible enough for both scalpers and slow-paced intraday setups.
Important note
This script is built for study + idea testing.
It is not intended as a final system.
Once you identify how price behaves around these nodes, you can blend this tool into your own setup.
VIX Term Structure Pro [v7.0 Enhanced]# VIX Term Structure Pro v7.0
[! (img.shields.io)](www.tradingview.com)
[! (img.shields.io)](www.tradingview.com)
[! (img.shields.io)](LICENSE)
**Professional VIX-based Market Sentiment & Timing Indicator**
专业的 VIX 市场情绪与择时指标
---
## 🌟 Overview / 概述
VIX Term Structure Pro is an advanced multi-factor market timing indicator that analyzes the VIX futures term structure, volatility regime, and market breadth to generate actionable buy/sell signals.
VIX Term Structure Pro 是一款高级多因子市场择时指标,通过分析 VIX 期货期限结构、波动率区间及市场广度,生成可操作的买卖信号。
---
## 🚀 Key Features / 核心功能
### 📊 Multi-Factor Scoring System / 多因子评分系统
- **Term Structure Z-Score**: Measures deviation from historical mean / 期限结构 Z 分数:衡量与历史均值的偏离
- **VIX/VX1 Basis**: Spot premium detection for panic signals / VIX 现货溢价:恐慌信号检测
- **Contango Analysis**: Futures curve shape insights / 期货升水分析
- **SKEW Integration**: Options skew for tail risk / SKEW 整合:尾部风险监测
- **Put/Call Ratio**: Sentiment extremes / 看跌/看涨比率:情绪极端
- **VVIX Support**: Volatility of volatility (optional) / VVIX 支持:波动率的波动率
### 🎯 Three-Tier Signal System / 三级信号系统
| Signal | Score | Description |
|--------|-------|-------------|
| 🚨 **CRASH BUY** | ≥ 6 | Extreme panic, rare opportunity / 极端恐慌,罕见机会 |
| 🟢 **STRONG BUY** | ≥ 5 | Multi-factor confluence / 多因子共振 |
| 🟡 **BUY DIP** | ≥ 4 | Accumulate on weakness / 逢低吸纳 |
| 🟠 **SELL/HEDGE** | ≤ -2 | Consider reducing risk / 考虑减仓对冲 |
| 🔴 **STRONG SELL** | ≤ -5 | Strong bearish signals / 强烈看跌信号 |
| 🔥 **EUPHORIA SELL** | ≤ -6 | Extreme greed, sell signal / 极度贪婪,卖出信号 |
### 📈 Dashboard Indicators / 仪表盘指标解读
| Indicator | Bullish 🟢 | Bearish 🔴 |
|-----------|------------|------------|
| Overall Bias | STRONG BUY / BUY DIP | STRONG SELL / SELL/HEDGE |
| AI Score | ≥ 5 (Extreme Fear) | ≤ -5 (Extreme Greed) |
| Market Trend | 🟢SPX 🟢NDX (Above MA200) | 🔴SPX 🔴NDX (Below MA200) |
| VIX Regime | LOW VOL (<15) | HIGH VOL (>25) |
| Term Struct Z | < -2.0 (Panic) | > 2.0 (Complacency) |
---
## ⚙️ Configuration / 配置选项
### 📡 Data Sources / 数据源
- **VIX Symbol**: Default `CBOE:VIX` (Alternative: `TVC:VIX`)
- **Put/Call Ratio**: Default `INDEX:CPCI` (Index P/C)
- **Timeframe**: Daily (stable) or Chart (real-time)
### ⚠️ Strategy Mode / 策略模式
- **High (Scalping)**: Sensitive, for short-term trades / 高敏感,短线
- **Normal (Swing)**: Balanced approach / 平衡模式
- **Low (Trend/Safe)**: Conservative, trend-following / 保守,趋势跟踪
### 🔬 Backtest Mode / 回测模式
- **OFF (Real-time)**: Shows current day data, suitable for live monitoring / 显示当日数据,适合实盘监控
- **ON (Historical)**: Uses only confirmed data, avoids look-ahead bias / 仅使用已确认数据,避免未来函数
---
## 📖 Usage Guide / 使用指南
### Best Practices / 最佳实践
1. **Apply to SPX/SPY/QQQ daily charts** for optimal signal accuracy
在 SPX/SPY/QQQ 日线图上使用,信号准确度最佳
2. **Wait for next trading day** to execute signals (signals trigger on daily close)
信号触发后在下一交易日执行(信号基于日线收盘)
3. **Use in conjunction with price action** for confirmation
结合价格走势确认信号
4. **Enable Market Trend Filter** (MA200) for safer entries in uncertain markets
开启趋势过滤(MA200)以在不确定市场中更安全入场
### Signal Interpretation / 信号解读
```
🚨 CRASH BUY (Score ≥ 6)
→ Rare extreme panic event
→ Historical average return: significant positive over 2 months
→ Consider aggressive positioning
🟢 STRONG BUY (Score ≥ 5)
→ Multiple indicators align
→ Historical average return: positive over 1 month
→ Consider building positions
🟡 BUY DIP (Score ≥ 4)
→ Moderate fear detected
→ Suitable for adding to existing positions
→ Filtered out in bear markets if Trend Filter is ON
```
---
## 📊 Historical Statistics / 历史统计
The indicator tracks signal frequency and average subsequent returns:
- **CRASH BUY**: 40-day return period (~2 months)
- **STRONG BUY**: 20-day return period (~1 month)
- **BUY DIP**: 10-day return period (~2 weeks)
指标追踪信号频率和后续平均收益,可在仪表盘中查看历史统计。
---
## 🔔 Alerts / 警报
Built-in alert conditions with cooldown mechanism to prevent spam:
| Alert | Condition |
|-------|-----------|
| Crash Buy Alert | Score ≥ 6, extreme panic |
| Strong Buy Alert | Score ≥ 5, multi-factor confluence |
| Buy Dip Alert | Score ≥ threshold |
| Euphoria Sell Alert | Score ≤ -6, extreme greed |
| Strong Sell Alert | Score ≤ -5 |
| VIX Basis Panic | VIX spot premium spike |
---
## 📋 Changelog / 更新日志
### v7.0 (Current)
- ✨ Three-tier buy/sell signal system
- 📊 Signal statistics with average return tracking
- 🔬 Backtest Mode toggle for historical testing
- 🎨 Configurable ±1 Z-Score reference lines
- ⚡ Modular scoring functions
- 🛡️ Dual index trend display (SPX + NDX)
- 📱 Compact & Full dashboard modes
---
## ⚠️ Disclaimer / 免责声明
**English:**
This indicator is for educational and informational purposes only. It does not constitute financial advice. Past performance does not guarantee future results. Always do your own research and consider your risk tolerance before trading.
**中文:**
本指标仅供教育和信息参考,不构成投资建议。过往表现不代表未来收益。交易前请自行研究并评估风险承受能力。
---
## 📄 License / 许可证
MIT License - Feel free to use, modify, and share.
---
## 🤝 Contributing / 贡献
Issues and pull requests are welcome!
欢迎提交问题和贡献代码!
---
**Made with ❤️ for the trading community**
**为交易社区用心打造**
HMM Trend Exhaust Detector (Partial TP Areas)🔹 HMM Trend Exhaust Detector (Partial TP Areas)
HMM Trend Exhaust Detector is a professional risk-management and partial profit awareness tool, designed to highlight moments when price becomes over-extended within a strong trend.
This indicator is not an entry system and not a reversal predictor.
It is built to help traders protect profits, manage open positions, and avoid chasing price when the market is already stretched.
🧠 How it works (Simple Explanation)
When price moves aggressively away from its trend structure:
The candle color changes in real time, warning that price is entering a potential exhaustion zone.
A dotted guide level appears at the exact threshold price, showing where profit pressure begins.
After the candle closes, Partial TP Areas are marked on the chart to provide structure and context.
This two-step approach ensures:
Live awareness during the candle
Confirmed visual zones after close
🎯 What this indicator is best used for
✔ Partial profit booking
✔ Risk reduction during strong trends
✔ Avoiding late entries into extended moves
✔ Trade management & discipline
⚙️ Sensitivity Modes
The indicator includes a single Sensitivity setting to adapt to different trading styles:
Relaxed → Earlier warnings, more frequent partial TP zones
Strict → Balanced, institutional default
Very Strict → Only major, extreme exhaustion moves
(All internal calculations are handled automatically.)
📌 Important Notes
This indicator does not generate buy or sell signals.
Rectangle height is just based on candle heights at that time (Not strength based)
Partial TP Areas are confirmed after candle close by design.
Live candle highlighting and guide levels provide real-time awareness, not prediction.
Best used alongside your existing strategy or entries.
🧩 Recommended Use
Scalping / Fast markets → Relaxed
Intraday trading → Strict
Swing / News / Higher timeframes → Very Strict
🚀 About HMM
House of Market Minds -(HMM) indicators focus on clarity, discipline, and decision support — not hype or unrealistic promises.
This is the first public release in the HMM series, built with a long-term professional vision.
GARCH Volume Volatility [MarkitTick]Title: GARCH Volume Volatility
Description
Overview
The GARCH Volume Volatility (GV) indicator is a sophisticated quantitative tool designed to analyze the rate of change in market participation. While the vast majority of technical indicators focus on Price Volatility (how much price moves), this script focuses on Volume Volatility (how unstable the participation is).
Market volume is rarely distributed evenly; it tends to cluster. Periods of high activity are often followed by more high activity, and periods of calm tend to persist. This behavior is known as "heteroskedasticity." This script utilizes an Exponentially Weighted Moving Average (EWMA) model—a core component of Generalized Autoregressive Conditional Heteroskedasticity (GARCH) frameworks—to model these changing variance regimes.
By isolating volume volatility from raw volume data, this tool helps traders distinguish between sustainable liquidity flows and erratic, unsustainable volume shocks that often precede market reversals or breakouts.
Methodology and Calculations
1. Logarithmic vs. Percentage Returns
The foundation of this indicator is the calculation of "Volume Returns"—the period-over-period change in volume.
- The script defaults to Logarithmic Returns. In financial statistics, log returns are preferred because they normalize data that can vary wildly in magnitude (such as cryptocurrency volume spikes), providing a more symmetric view of changes.
- Users can opt for standard percentage changes if they prefer a linear approach.
2. Variance Proxy (Squared Returns)
To measure volatility, the direction of the volume change (up or down) matters less than the magnitude. The script squares the returns to create a "Variance Proxy." This ensures that a massive drop in volume is treated with the same statistical weight as a massive spike in volume—both represent a significant change in the volatility of participation.
3. GARCH-Style Smoothing (EWMA)
Standard Moving Averages (SMA) treat all data points in the lookback period equally. However, volatility is dynamic. This script uses an EWMA model with a tunable "Lambda" (Decay Factor).
- The Recursive Formula: The current calculation relies on a weighted average of the current variance and the previous period's smoothed variance.
- Memory Effect: This allows the indicator to "remember" recent volatility shocks while gradually letting their influence fade. This mimics the GARCH process of conditional variance.
4. Dynamic Statistical Thresholds
The final output is the Volatility (square root of variance). To make this data actionable, the script calculates a dynamic upper and lower limit based on the standard deviation (Z-Score) of the volatility itself over a user-defined lookback period.
How to Use
The indicator plots a histogram that categorizes the market into four distinct volatility regimes:
1. High Volatility (Red Histogram)
Trigger: Volatility > High Band (Upper Standard Deviation).
Interpretation: This signals an extreme anomaly in volume stability. This is not just "high volume," but "erratic volume behavior." This often occurs at:
- Capitulation bottoms (panic selling).
- Euphoric tops (blow-off tops).
- Major news events or earnings releases.
2. Elevated Volatility (Maroon Histogram)
Trigger: Volatility > Mean Average.
Interpretation: The market is in an active state. Participation is changing rapidly, but within statistically normal bounds. This is common during healthy, trending moves where new participants are entering the market steadily.
3. Normal/Low Volatility (Green Histogram)
Trigger: Volatility is within the lower bands.
Interpretation: The market volume is stable. There are no sudden shocks in participation. This is typical of consolidation phases or "creeping" trends where the price drifts without significant volume conviction.
4. Extremely Low Volatility (Bright Green/Transparent)
Trigger: Volatility < Low Band.
Interpretation: The "calm before the storm." When volume volatility collapses to near-zero, it implies that the market has reached a state of equilibrium or disinterest. Historically, volatility is cyclical; periods of extreme compression often lead to violent expansion.
Settings and Configuration
Core Settings
- Use EWMA: When checked (Default), uses the recursive GARCH-style calculation. If unchecked, it reverts to a simple SMA of variance, which is less sensitive to recent shocks but more stable.
- Log Returns: Uses natural log for calculations. Highly recommended for assets with exponential growth or large volume ranges.
- Length: The baseline period for the calculation.
- Threshold Lookback: The number of bars used to calculate the Mean and Standard Deviation bands.
- EWMA Lambda: The decay factor (0.0 to 1.0). A value of 0.94 is standard for risk metrics.
-- Higher Lambda (e.g., 0.98): The indicator reacts slower and is smoother (long memory).
-- Lower Lambda (e.g., 0.80): The indicator reacts very fast to new data (short memory).
Visuals
- Show Thresholds: Toggles the visibility of the statistical bands on the chart.
- High Band (StdDev): The multiplier for the upper warning zone. Default is 1.5 deviations. Increasing this to 2.0 or 3.0 will filter for only the most extreme events.
Disclaimer This tool is for educational and technical analysis purposes only. Breakouts can fail (fake-outs), and past geometric patterns do not guarantee future price action. Always manage risk and use this tool in conjunction with other forms of analysis.
TRV & nTRV - Trimmed Range VolatilityGrid bots require stable volatility measurement - ATR becomes misleading when gaps and sudden spikes distort the average. TRV (Trimmed Range Volatility) is an advanced version of ATR: it filters outliers at the extremes (highest and lowest ranges) and remains unaffected by gaps. This provides real-time, accurate volatility measurement for grid bot setup.Grid bots require stable volatility measurement - ATR becomes misleading when gaps and sudden spikes distort the average. TRV (Trimmed Range Volatility) is an advanced version of ATR: it filters outliers at the extremes (highest and lowest ranges) and remains unaffected by gaps. This provides real-time, accurate volatility measurement for grid bot setup.
Why We Developed TRV?
When a gap or sudden spike occurs in the morning, this extreme movement affects standard ATR calculations for an extended period. Even if the price moves sideways for the rest of the day, ATR remains elevated. This causes grid bots to operate with unnecessarily wide spacing and execute fewer trades.
TRV Advantages:
✅ Unaffected by Gaps: Opening gaps don't distort the calculation
✅ Extreme Point Elimination: Filters the largest and smallest outlier candles
✅ Real-Time Accuracy: Shows current market volatility
✅ Grid Bot Optimization: Enables tighter and more efficient grid spacing
✅ Comparison Capability: Compare different stocks and timeframes with nTRV
Grid Bot Usage:
The TRV value is used directly to calculate the number of grid lines:
(Resistance - Support) / TRV = Number of Grid Lines
Example:
Resistance: $110
Support: $90
TRV: $2
Grid Count: (110-90)/2 = 10 grid lines
Features:
Two Filtering Modes: Manual (enter number) or Percentage-Based (automatic ratio)
Four Indicators in One: nTRV, TRV, ATR, and nATR all displayed on the same panel
nTRV: Normalized value (percentage-based, for stock comparison)
TRV: Absolute value (currency-based, for grid calculation)
ATR & nATR Included: Standard ATR and nATR for direct comparison with TRV
Comprehensive Analysis: Compare filtered (TRV) vs unfiltered (ATR) volatility side-by-side
Default: 10% top, 10% bottom outlier elimination
Conclusion:
TRV is an advanced version of ATR specifically designed for grid bot traders. By filtering outlier movements, it provides more stable and reliable volatility measurement. The indicator includes both TRV (filtered) and ATR (unfiltered) on the same chart, giving traders a comprehensive view to make informed decisions. This dual-display approach enables more efficient grid strategies and increased trading frequency.
ATR Trailing StopATR Trailing Stop (Dynamic Volatility Regimes)
==============================================
This indicator implements an adaptive ATR-based trailing stop for long positions. The stop automatically adjusts based on stock volatility, tightening during fast movements and widening during calm periods. It is designed as a trade management tool to help protect profits while staying aligned with strong trends.
How It Works
------------
* Tracks the highest high over a configurable lookback window and ensures this “top” never moves downward.
* Computes the trailing stop as:**Top – ATR × Dynamic Multiplier**
* The ATR multiplier changes depending on volatility:
* Low volatility → Wide stop (slower trailing)
* Medium volatility → Standard trailing
* High volatility → Tight stop (faster trailing)
* The trailing stop only moves upward; it never decreases.
* If price falls significantly below the stop (default: 5%), the system resets and begins trailing from a new top.
* An optional price-scale label displays:
* Current stop value
* Volatility regime (LOW / MID / HIGH)
* ATR percentage and active multiplier
Alerts
------
Two alert conditions are included:
### Trailing Stop – Near
Triggers when price moves within a user-defined percentage above the stop.
### Trailing Stop – Hit
Triggers when price touches or closes below the stop.
How to Use
----------
1. Add the indicator to any chart (daily timeframe recommended).
2. Configure:
* ATR length
* Lookback bars
* Volatility thresholds
* ATR multipliers
3. Set alerts for early warnings or stop-hit events.
4. Use the stop line as a dynamic risk-management tool to guide exit decisions and protect profits.
Notes
-----
* Designed for long-only trailing logic.
* This indicator does not generate entry signals; it is intended for stop management.






















