Adaptive RSI Pro# Adaptive RSI Pro / 自适应RSI专业版
[! (img.shields.io)](www.tradingview.com)
[! (img.shields.io)](www.tradingview.com)
[! (img.shields.io)](opensource.org)
Dynamic overbought/oversold thresholds + Multi-Timeframe analysis + Divergence detection + Signal statistics.
根据每个标的实际历史分布动态计算超买/超卖阈值,结合多时间框架分析、背离检测和信号统计。
**Pine Script v6** | **Last Update: 2025-12-17** | **v6.2**
---
## Emoji Legend / 信号图例
### Chart Signals / 图表信号
#### Buy Signals / 买入信号 (底部显示)
| Emoji | Signal Name | Condition | Priority | Action |
|-------|-------------|-----------|----------|--------|
| 🌟 | MTF + Extreme | 3+ timeframes oversold + Z<−2σ | ★★★★★ | **STRONG BUY** 强力买入 |
| 💎 | Divergence + Extreme | Bullish divergence in Z<−2σ zone | ★★★★☆ | **BUY** 买入 |
| 🔥 | Extreme Oversold | Z-Score crosses below −2σ (≈P2) | ★★★☆☆ | **BUY** 买入 |
| ⬆️ | Normal Oversold | Z-Score crosses below −1.5σ (≈P7) | ★★☆☆☆ | Consider buy 考虑买入 (默认隐藏) |
| ↗️ | Bullish Divergence | Price↓ RSI↑ (not in extreme zone) | ★☆☆☆☆ | Watch 观察 (潜在底部) |
#### Sell Signals / 卖出信号 (顶部显示)
| Emoji | Signal Name | Condition | Priority | Action |
|-------|-------------|-----------|----------|--------|
| 🌟 | MTF + Extreme | 3+ timeframes overbought + Z>+2σ | ★★★★★ | **STRONG SELL** 强力卖出 |
| 💎 | Divergence + Extreme | Bearish divergence in Z>+2σ zone | ★★★★☆ | **SELL** 卖出 |
| ❄️ | Extreme Overbought | Z-Score crosses above +2σ (≈P98) | ★★★☆☆ | **SELL** 卖出 |
| ⬇️ | Normal Overbought | Z-Score crosses above +1.5σ (≈P93) | ★★☆☆☆ | Consider sell 考虑卖出 (默认隐藏) |
| ↘️ | Bearish Divergence | Price↑ RSI↓ (not in extreme zone) | ★☆☆☆☆ | Watch 观察 (潜在顶部) |
> **Priority System / 优先级系统**: Only the highest priority signal is shown to prevent overlapping.
> 只显示最高优先级信号,避免叠加。
---
### Dashboard Status / 仪表盘状态
| Emoji | Status | Meaning |
|-------|--------|---------|
| 🟢 | EXTREME OVERSOLD | Z-Score < −2σ (≈P2.3), strong buy zone / 极端超卖区,强买区 |
| 🟡 | OVERSOLD | Z-Score < −1.5σ (≈P6.7), oversold / 超卖 |
| ⚪ | NEUTRAL | −1.5σ ≤ Z-Score ≤ +1.5σ, no signal / 中性,无信号 |
| 🟠 | OVERBOUGHT | Z-Score > +1.5σ (≈P93.3), overbought / 超买 |
| 🔴 | EXTREME OVERBOUGHT | Z-Score > +2σ (≈P97.7), strong sell zone / 极端超买区,强卖区 |
### MTF Status / 多周期状态
| Emoji | Meaning |
|-------|---------|
| 🟢 | Timeframe oversold / 该周期超卖 |
| 🔴 | Timeframe overbought / 该周期超买 |
| ⚪ | Timeframe neutral / 该周期中性 |
### Divergence Status / 背离状态
| Emoji | Meaning |
|-------|---------|
| 🟢 BULL DIV | Bullish divergence detected / 检测到看涨背离 |
| 🔴 BEAR DIV | Bearish divergence detected / 检测到看跌背离 |
| — | No divergence / 无背离 |
---
### Alert Emojis / 警报图标
| Emoji | Alert Type | Description |
|-------|------------|-------------|
| 🎯 | Smart Alert | V6 Unified Alert System / V6统一警报系统 |
---
## Overview / 概述
Traditional RSI uses fixed 30/70 thresholds, but different assets have different volatility characteristics.
传统RSI使用固定的30/70阈值,但不同标的有不同的波动特性。
**Solution**: Calculate thresholds using historical percentiles (P5-P95) + advanced features.
**解决方案**:使用历史百分位(P5-P95)计算阈值 + 高级功能。
---
## Features / 功能特性
### 🎯 Adaptive Thresholds / 自适应阈值
- **Z-Score Based Signals**: Uses statistical Z-Score (±2σ for extreme, ±1.5σ for normal) for consistent cross-asset performance
使用统计Z-Score(极端±2σ,普通±1.5σ)实现跨资产一致性
- **Percentile Lines**: Display P5/P10/P25/P50/P75/P90/P95 for visual reference
百分位线(P5-P95)作为视觉参考
- **Dual Display Modes**: Show Z-Score lines, Percentile lines, or both
双重显示模式:可选择显示Z值线、百分位线或两者
### 🔬 Auto-Adaptive Lookback / 自动自适应回看期
- **Statistical Formula**: Uses `n = (Z × σ / E)²` for optimal sample size calculation
统计公式:使用样本量公式自动计算最优回看期
- **Dual Volatility System**: Combines short-term (4× RSI length) and long-term volatility (configurable: 6M/1Y/2Y)
双重波动率系统:结合短期和长期波动率动态调整
- **Precision Control**: Choose High/Normal/Low precision (adjusts acceptable error margin)
精度控制:高/普通/低精度可选(调整统计误差容忍度)
- **Health Indicators**: Real-time validation of sample coverage, distribution spread, and statistical validity
健康度指标:实时验证样本覆盖率、分布宽度和统计有效性
### 📈 Auto-Adaptive Trend Filter / 自动自适应趋势过滤
- **Auto Mode**: Automatically selects optimal filter based on RSI volatility percentiles
自动模式:根据RSI波动率百分位自动选择最优过滤器
- **5 Filter Modes**: Fixed 50, Adaptive P50, SMA(RSI), BB(RSI), or Auto
5种过滤模式:固定50、自适应P50、RSI均线、布林带或自动
- **Smart Selection**: Low volatility → Fixed 50, Medium → Adaptive P50, High → BB(RSI)
智能选择:低波动→固定50,中波动→自适应P50,高波动→布林带
### 🌍 Multi-Timeframe RSI / 多时间框架RSI
- **3 Configurable Timeframes**: View RSI status across multiple timeframes (default: 1h/4h/D)
3个可配置时间框架:跨周期查看RSI状态(默认:1小时/4小时/日线)
- **Auto-Skip Duplicates**: Automatically detects and skips timeframes matching current chart
自动跳过重复:自动检测并跳过与当前图表相同的时间框架
- **Resonance Detection**: Triggers when 3+ valid timeframes agree (oversold/overbought)
共振检测:当3个以上有效时间框架一致时触发强信号
>
> **MTF Signal Confirmation Timing / 信号确认时机**
>
> - Current timeframe signals update in real-time, confirmed on bar close
> - Higher timeframe signals (e.g., Daily on 1H chart) only update after that timeframe's bar closes
> - **Best Practice**: Wait for current timeframe bar close before acting on MTF resonance signals
>
> - 当前图表周期的信号:实时更新,K线收盘确认
> - 高周期信号(如日线):仅在该周期K线收盘后更新
> - **最佳实践**:MTF共振信号建议在当前周期K线收盘后再做交易决策
### 💎 Auto-Adaptive Divergence Detection / 自动自适应背离检测
- **Auto Mode**: Automatically selects parameters based on asset volatility (using ATR)
自动模式:基于资产波动率(ATR)自动选择参数
- **4 Preset Modes**: Low Vol (3/40), Normal (5/60), High Vol (7/80), Crypto (10/120)
4种预设模式:低波动/普通/高波动/加密货币,分别对应不同的回看/范围参数
- **Extreme Zone Detection**: Distinguishes divergence in extreme zones (💎) vs normal zones (↗️↘️)
极端区域检测:区分极端区域背离(💎)和普通背离(↗️↘️)
- **Bullish/Bearish Divergence**: Price lower low + RSI higher low / Price higher high + RSI lower high
看涨/看跌背离:价格新低+RSI未新低 / 价格新高+RSI未新高
### 📊 Layered Signal Statistics / 分层信号统计
- **4-Tier Classification**: MTF Resonance (🌟) > Divergence+Extreme (💎) > Extreme Only (🔥❄️) > Normal (⬆️⬇️)
四层分级:多周期共振 > 背离+极端 > 仅极端 > 普通信号
- **Independent Tracking**: Each signal tier has separate count, average return, and win rate
独立跟踪:每层信号独立统计次数、平均收益、胜率
- **Signal Cooldown**: Optional cooldown period (default 5 bars) to prevent duplicate counting
信号冷却:可选冷却期(默认5根K线)防止重复计数
- **Real Forward Testing**: Calculates actual returns N bars after signal (configurable 5-100 bars)
真实前瞻测试:计算信号后N根K线的实际收益(可配置5-100)
---
## Z-Score 与 百分位:双重视角 / Dual Perspective
This indicator displays **both Z-Score and Percentile** to provide complementary views of the same RSI distribution.
本指标**同时显示Z-Score和百分位**,为同一RSI分布提供互补视角。
### Why Both? / 为什么同时显示?
**Fundamental Connection / 本质关联**:
两者都是描述RSI在历史分布中位置的统计方法。
Both are statistical methods describing RSI's position in historical distribution.
- **Z-Score(标准分数)**: `(RSI - 均值) / 标准差` - 基于正态分布假设
Based on normal distribution assumption.
- **百分位(Percentile)**: RSI在历史数据中的排名位置 - 不假设分布类型
RSI's ranking position in historical data - no distribution assumption.
**Complementary Advantages / 互补优势**:
| Dimension 维度 | Z-Score | Percentile 百分位 |
|------|---------|------------|
| **Cross-asset Consistency / 跨资产一致性** | ✅ Excellent 优秀 - BTC和SPY都用±2σ | ⚠️ Varies by volatility 因波动率不同而异 |
| **Statistical Rigor / 统计学严谨性** | ✅ Confidence intervals 置信区间、假设检验 | ⚠️ Non-parametric 非参数统计 |
| **Intuitive / 直观易懂** | ⚠️ Stats knowledge needed 需要统计学知识 | ✅ "Below 95% of history" "低于95%历史值" |
| **Use Case / 适用场景** | 📊 Quant backtesting 量化回测、信号触发 | 📈 Visualization 可视化、用户理解 |
### Conversion Reference / 转换对照表
**Quick Reference / 快速对照**(Assuming normal distribution / 假设正态分布):
| Z-Score | Percentile 百分位 | Meaning 含义 | Signal 信号类型 |
|---------|--------|---------------|----------|
| **±2.5σ** | **P0.6 / P99.4** | Extreme anomaly (outside 99% CI) / 极端异常(99%置信区间外) | Rare opportunity 罕见机会 |
| **±2.0σ** | **P2.3 / P97.7** | Extreme OB/OS (outside 95% CI) / 极端超买/超卖(95%置信区间外) | 🔥❄️ Extreme 极端信号 |
| ±1.5σ | P6.7 / P93.3 | Notable deviation / 显著偏离 | ⬆️⬇️ Normal 普通信号(默认) |
| ±1.0σ | P15.9 / P84.1 | Mildly strong/weak / 轻度偏强/偏弱 | — |
| 0σ | P50 | Median / 中位数 | — |
### Dashboard Dual Display / 仪表盘双重显示
**新版Dashboard已实现自动转换**:
```
┌─────────────────────────────────┐
│ ADAPTIVE RSI PRO 28.5 │
├─────────────────────────────────┤
│ Z-Score −2.15σ (≈P2) │ ← Z值 + 近似百分位
│ Percentile P5 (−1.5σ ~ −2σ) │ ← 百分位 + 对应Z值范围
│ Status 🟢 EXTREME OVERSOLD │
└─────────────────────────────────┘
```
**理解方式**:
- **从Z值看**:−2.15σ 表示超过95%置信区间,统计异常 → 对应约P2
- **从百分位看**:P5 表示低于95%历史值,极端超卖 → 对应约−1.5σ到−2σ之间
### Threshold Line Modes / 阈值线模式
**Unified Mode (Recommended) / Unified模式(推荐)** - Balances rigor and intuitiveness / 兼顾严谨性和直观性:
- Draws: Z-Score threshold lines (±2σ, ±1.5σ) / 绘制:Z-Score阈值线(±2σ、±1.5σ)
- Labels: Corresponding percentiles (≈P98, ≈P93, ≈P7, ≈P2) / 标注:对应百分位(≈P98、≈P93、≈P7、≈P2)
- Advantage: Instantly understand statistical meaning and historical position / 优势:一眼看懂统计意义和历史位置
**Other Modes / 其他模式**:
- `Z-Score`: Statistical threshold lines only / 仅显示统计学阈值线
- `Percentile`: Percentile lines only / 仅显示百分位线
- `Both`: Display both types (denser) / 同时显示两类线(较密集)
### Practical Examples / 实际应用示例
**Scenario 1: Identifying Extreme Opportunities / 场景1:识别极端机会**
```
Current RSI / 当前RSI: 25.3
Dashboard shows / Dashboard显示:
Z-Score: −2.35σ (≈P1)
Percentile: P5 (< −2σ)
Status: 🟢 EXTREME OVERSOLD
Interpretation / 解读:
• Statistical perspective / 统计学视角: Beyond 99% confidence interval (|Z| > 2.3) / 超过99%置信区间,极端异常
• Intuitive perspective / 直观视角: Lower than 99% of historical values / 低于99%的历史值都低,罕见超卖
• Conclusion / 结论: Strong buy signal 🔥 / 强力买入信号 🔥
```
**Scenario 2: Normal Signal Judgment / 场景2:普通信号判断**
```
Current RSI / 当前RSI: 63.8
Dashboard shows / Dashboard显示:
Z-Score: +1.52σ (≈P94)
Percentile: P90 (+1.5σ ~ +2σ)
Status: 🟠 OVERBOUGHT
Interpretation / 解读:
• Statistical perspective / 统计学视角: ~1.5 std dev, notably high but not extreme / 约1.5倍标准差,显著偏高但未极端
• Intuitive perspective / 直观视角: Higher than 90% of historical values / 高于90%的历史值,轻度超买
• Conclusion / 结论: Consider reducing position, not forced sell ⬇️ / 考虑减仓,非强制卖出 ⬇️
```
### Dashboard Display Logic / Dashboard显示逻辑
**Z-Score Row Display / Z-Score行显示**:
- Always shows current Z-value (2 decimal places) / 始终显示当前Z值(精确到2位小数)
- Auto-calculates approximate percentile: `≈P ` / 自动计算对应的近似百分位:`≈P `
- Uses Error Function for precise conversion / 使用误差函数(Error Function)精确转换
**Percentile Row Display / Percentile行显示**:
- Shows RSI's percentile range (P5, P10, P25, etc.) / 显示RSI所处的百分位区间(P5, P10, P25等)
- Labels corresponding Z-value range (e.g., `−1.5σ ~ −2σ`) / 标注对应的Z值范围(如:`−1.5σ ~ −2σ`)
- Helps understand what "P10" means statistically / 帮助理解"P10"的统计意义
**Color Association / 颜色关联**:
- Both rows use same status color (green/yellow/white/orange/red) / 两行使用相同的状态颜色(绿/黄/白/橙/红)
- Visually reinforces "same indicator, different expressions" / 视觉上强化"同一指标的不同表达"概念
---
### Dashboard Setups / 仪表盘配置
#### Full Mode (PC/Tablet)
Shows detailed stats, MTF status, and divergence info.
显示详细统计、MTF状态和背离信息。
#### Mobile Mode (Phone) / 手机模式
Simplified 3-row layout optimized for small screens.
极简3行布局,专为手机屏幕优化。
- Row 1: RSI Value / 第1行:RSI数值
- Row 2: Signal Status (Emoji) / 第2行:信号状态 (Emoji)
- Row 3: Trend/Filter Status / 第3行:趋势/过滤状态
### 📈 Dashboard Example / 面板示例
```
┌─────────────────────────────────┐
│ ADAPTIVE RSI PRO 35.2 │
├─────────────────────────────────┤
│ Status 🟢 EXTREME OVERSOLD │
│ Percentile P10 ↓ DOWN │
│ Lookback 456 ✅✅✅ │
├─────────────────────────────────├ (Full Mode Only)
│ ── MTF ── │
│ 1h | 4h | D 🟢 | ⚪ | 🟢 │
│ Resonance 🟢 3/4 OVERSOLD │
├─────────────────────────────────┤
│ Divergence 🟢 BULL (5/60) │
├─────────────────────────────────┤
│ ── STATS ── (20 bars) │
│ 🌟 MTF Buy(12) +4.2% | 83% │
│ 🌟 MTF Sell(8) +3.8% | 75% │
│ 💎 Div Buy(15) +3.5% | 80% │
│ 💎 Div Sell(11) +2.9% | 73% │
│ 🔥 Ext Buy(45) +2.1% | 67% │
│ ❄️ Ext Sell(38) +1.8% | 63% │
└─────────────────────────────────┘
```
**Health Indicators / 健康度指标**:
- ✅✅✅ = All healthy (所有健康): Sample coverage ≥ 80%, Distribution spread ≥ 15, Statistical validity ≥ 90%
- ⚠️ present = Warning (警告): One or more health checks failed, consider using Custom mode with larger lookback
---
## Chart Lines Guide / 图表线条指南
! (images/annotated_rsi_indicator.png)
### 📊 主要线条 / Main Lines
| 线条 | 颜色/样式 | 含义 | 作用 |
|------|----------|------|------|
| **RSI主线** | 黄色粗线 | 当前RSI值 | 实时跟踪相对强弱指标 |
| **P50 自适应中位数** | 白色阶梯线 | 动态中线 | 根据历史数据自动调整的中位数,比固定50更准确 |
### 🔴 超买阈值线 / Overbought Thresholds (上方红色)
| 线条 | Z-Score | 百分位 | 样式 | 信号 |
|------|---------|--------|------|------|
| **极端超买线** | +2σ | ≈P98 | 实线 | 触发 ❄️ 极端超买信号(强卖出) |
| **普通超买线** | +1.5σ | ≈P93 | 圆点虚线 | 触发 ⬇️ 普通超买信号(考虑卖出) |
### 🟢 超卖阈值线 / Oversold Thresholds (下方绿色)
| 线条 | Z-Score | 百分位 | 样式 | 信号 |
|------|---------|--------|------|------|
| **极端超卖线** | -2σ | ≈P2 | 实线 | 触发 🔥 极端超卖信号(强买入) |
| **普通超卖线** | -1.5σ | ≈P7 | 圆点虚线 | 触发 ⬆️ 普通超卖信号(考虑买入) |
### ⚪ 固定参考线 / Fixed Reference Lines
| 线条 | 位置 | 样式 | 作用 |
|------|------|------|------|
| **0线** | 底部 | 灰色点线 | RSI下边界 |
| **50线** | 中间 | 灰色点线 | 传统固定中线参考 |
| **100线** | 顶部 | 灰色点线 | RSI上边界 |
### 🎨 渐变填充区域 / Gradient Fill Zones
- **红色渐变**(上方):超买区域,颜色越深表示越极端
- P95-P90(深红)> P90-P75(中红)> P75-P50(浅红)
- **绿色渐变**(下方):超卖区域,颜色越深表示越极端
- P10-P5(深绿)> P25-P10(中绿)> P50-P25(浅绿)
### 💡 关键要点 / Key Points
**线条样式区分 / Line Style Distinction:**
- **实线** = 极端信号(±2σ),优先级高,统计上95%置信区间外
- **圆点虚线** = 普通信号(±1.5σ),优先级较低,显著偏离但未极端
**动态 vs 固定 / Dynamic vs Fixed:**
- **彩色线**(红/绿)= 根据历史波动动态调整,适应不同资产特性
- **灰色虚线** = 固定不变的参考线,用于传统RSI对比
**视觉层次 / Visual Hierarchy:**
- 线条粗细:RSI主线(最粗)> 极端阈值(粗)> 普通阈值(细)> 参考线(最细)
- 透明度:核心线条(不透明)> 百分位线(半透明)> 填充区(高透明)
---
## Settings / 设置
### RSI Settings / RSI设置
| Setting | Default | Description |
|---------|---------|-------------|
| RSI Length | 14 | RSI calculation period / RSI计算周期 |
| RSI Source | Close | Price source / 价格源 |
### Adaptive Settings / 自适应设置
| Setting | Default | Description |
|---------|---------|-------------|
| Lookback Mode | Auto | Auto (statistical formula) / Custom / 自动/自定义 |
| Custom Lookback | 252 | Only used in Custom mode / 仅自定义模式使用 |
| Precision | Normal | High/Normal/Low: Adjusts error tolerance / 精度等级 |
| History Depth | 1 Year | 6 Months / 1 Year / 2 Years for volatility calculation / 波动率历史深度 |
### Visual Settings / 视觉设置
| Setting | Default | Description |
|---------|---------|-------------|
| Threshold Line Mode | **Unified** | Unified(推荐)/Z-Score/Percentile/Both / 阈值线模式 |
| Show Gradient Fill | ON | Display background gradients / 显示背景渐变 |
| Show Dashboard | ON | Display dashboard panel / 显示仪表盘面板 |
| Dashboard Mode | Full | Full/Lite/Mobile(Phone) / 面板模式 |
| Dashboard Size | Normal | Tiny/Small/Normal/Large / 面板大小 |
| Dashboard Transparency | 30 | 0-100% transparency level / 透明度 |
| Bullish Color | #00E676 | Custom color for bullish signals / 牛市信号颜色 |
| Bearish Color | #FF5252 | Custom color for bearish signals / 熊市信号颜色 |
| RSI Line Color | #FFEB3B | RSI line color / RSI主线颜色 |
### Trend Filter / 趋势过滤
| Setting | Default | Description |
|---------|---------|-------------|
| Enable Trend Filter | OFF | Only trigger signals in trend direction / 趋势方向过滤 |
| Filter Mode | Auto | Auto/Fixed 50/Adaptive P50/SMA(RSI)/BB(RSI) / 过滤模式 |
### Alert Settings / 警报设置
| Setting | Default | Description |
|---------|---------|-------------|
| **🎯 Smart Alert** | **ON** | **V6 Unified Alert System** / V6统一警报系统 |
| Show Normal Signals | OFF | Display ⬆️⬇️ on chart / 图表显示普通信号 |
| Normal Signal Threshold | 1.5σ | Z-Score threshold (1.0-2.0σ) / 普通信号阈值 |
| Enable Signal Cooldown | ON | Prevent duplicate signal counting / 防止重复信号 |
| Cooldown Period | 5 bars | Bars between same signal type / 冷却K线数 |
### Multi-Timeframe / 多时间框架
| Setting | Default | Description |
|---------|---------|-------------|
| Enable | ON | Show MTF analysis / 显示MTF分析 |
| MTF Mode | **Auto** | **Auto** (Fractal Breakdown) / **Manual** (Fixed) / 自动/手动模式 |
| TF1/TF2/TF3 | 60/240/D | Timeframes (Manual mode only) / 时间框架(仅手动模式)|
### Signal Statistics / 信号统计
| Setting | Default | Description |
|---------|---------|-------------|
| Enable | ON | Track performance / 跟踪表现 |
| Forward Bars | 20 | Bars for return calculation / 收益计算K线数 |
### Divergence Detection / 背离检测
| Setting | Default | Description |
|---------|---------|-------------|
| Enable Detection | ON | Detect divergences / 检测背离 |
| Divergence Mode | Auto | Auto/Low Vol/Normal/High Vol/Crypto/Custom / 背离模式 |
| Custom Lookback | 5 | Only in Custom mode / 仅自定义模式使用 |
| Custom Range | 60 | Only in Custom mode / 仅自定义模式使用 |
**Auto Mode Presets / 自动模式预设**:
- Low Vol (蓝筹/ETF): Lookback 3, Range 40
- Normal (一般股票): Lookback 5, Range 60
- High Vol (成长股): Lookback 7, Range 80
- Crypto (加密货币): Lookback 10, Range 120
---
## Alerts / 警报
### 🎯 Smart Alert (V6 Unified System)
**The only alert method / 唯一的警报方式** - 自动聚合所有信号到一条富文本消息
Automatically aggregates all signals into a single rich-text message.
**Setup Steps / 设置方法**:
1. Keep "🎯 Smart Alert" enabled in indicator settings (default) / 指标设置中保持 "🎯 Smart Alert" 开启(默认)
2. When creating alert, select **"Any alert() function call"** / 创建警报时选择 **"Any alert() function call"**
3. Done! You'll receive real-time aggregated alerts / 完成!您会收到实时的聚合警报
**Message Example / 消息示例**:
```
AAPL: 🟢 BUY SIGNALS → 🌟MTF共振 💎背离 🔥极端 | RSI:25.3 Z:-2.1σ (≈P2)
AAPL: 🔴 SELL SIGNALS → ❄️极端 | RSI:78.5 Z:2.3σ (≈P98)
```
**Features / 特性**:
- ✅ **Real-time trigger / 实时触发** - Sends when condition met within bar / K线运行中触发条件即发送
- ✅ **Anti-flicker / 防闪烁** - Uses `varip` to prevent duplicate alerts from signal flickering within same bar / 使用 `varip` 防止信号闪烁导致同一K线内重复警报
- ✅ **Signal upgrade detection / 信号升级检测** - Alerts when stronger signal appears (e.g., 🔥Extreme → 🌟MTF) even on same bar / 同一K线内出现更强信号时也会触发(如:🔥极端 → 🌟MTF共振)
- ✅ **Full context / 完整上下文** - Includes RSI value, Z-Score, approximate percentile / 包含RSI值、Z-Score、近似百分位
- ✅ **Auto-aggregation / 自动聚合** - One message contains all triggered signals / 一条消息包含所有触发的信号
- ✅ **Buy/Sell independent tracking / 买卖独立追踪** - Buy and Sell alerts tracked separately / 买入和卖出警报独立追踪,互不干扰
**Signal Priority Levels / 信号优先级**:
| Level 等级 | Signal 信号 | Description 描述 |
|------------|-------------|------------------|
| 4 (Highest) | 🌟 MTF Resonance | Multi-timeframe agreement / 多周期共振 |
| 3 | 💎 Divergence | Divergence + Extreme zone / 背离+极端区 |
| 2 | 🔥❄️ Extreme | Extreme oversold/overbought / 极端超卖/超买 |
| 1 (Lowest) | ⬆️⬇️ Normal | Normal oversold/overbought / 普通超卖/超买 |
---
## Usage Tips / 使用建议
| Timeframe | Lookback | Use Case |
|-----------|----------|----------|
| Daily | 252 | Swing trading / 波段交易 |
| 4H | 1000 | Short-term / 短线 |
| 1H | 2000 | Day trading / 日内交易 |
**Best Practices / 最佳实践:**
1. Focus on 🌟 and 💎 signals (highest priority) / 优先关注 🌟 和 💎 信号(最高优先级)
2. Use MTF resonance for high-confidence entries / 使用 MTF 共振确认高置信度入场
3. Check win rate in stats before trading / 交易前查看统计胜率
---
## Changelog / 更新日志
### v6.2 - Smart Alert Anti-Flicker / 智能防抖警报 (Current / 当前版本)
- 🛡️ **Anti-flicker Mechanism / 防闪烁机制**: Fixed issue where signal flickering caused multiple duplicate alerts within same bar. Now uses `varip` to track alert status per bar. / 修复信号闪烁导致同一K线内发送多次重复警报的问题,使用 `varip` 追踪每根K线的警报状态。
- 📈 **Signal Upgrade Detection / 信号升级检测**: Tracks signal priority level (MTF=4, Divergence=3, Extreme=2, Normal=1). Sends new alert when stronger signal appears on same bar. / 追踪信号优先级等级。同一K线内出现更强信号时会发送新警报。
- 🔄 **Independent Buy/Sell Tracking / 买卖独立追踪**: Buy and Sell alerts are tracked independently, allowing direction changes within same bar. / 买入和卖出警报独立追踪,允许同一K线内捕捉方向变化。
### v6.1 - Mobile Experience / 移动端体验
- 📱 **Mobile Dashboard / 手机端面板**: Added simplified "Mobile" mode optimized for phone screens (RSI + Signal Emoji only). / 新增简化的"Mobile"模式,针对手机屏幕优化(仅显示RSI+信号Emoji)。
- 🔥 **Persistent Zone Status / 持续区域状态**: Mobile Dashboard now shows persistent extreme zone indicators when no new signal but RSI remains in zone: `🔥持续` (Extreme Oversold), `❄️持续` (Extreme Overbought), `⬆️区` (Oversold), `⬇️区` (Overbought). / 手机端面板现在显示持续极端区域指示器:无新信号但RSI仍在区域内时显示持续状态。
- 🔧 **UX Improvements / 用户体验优化**: Optimized font sizes and layout for small screens. / 优化字体大小和小屏幕布局。
### v6.0 - Alert System Simplification & V6 Optimization / 警报系统简化与V6优化
- 🎯 **Smart Alert System / 智能警报系统简化**:
- **Unified entry / 唯一警报入口**: Removed all legacy alertcondition, unified to V6 Smart Alert / 移除所有legacy alertcondition,统一为V6 Smart Alert
- **Real-time trigger / 实时触发**: Changed to `alert.freq_once_per_bar` for intra-bar response / 改为 `alert.freq_once_per_bar` 实现K线内实时响应
- **Smart dedup / 智能去重**: Rising edge detection (`signal and not signal `) / 上升沿检测,只在新信号出现时触发
- **Auto-aggregation / 自动聚合**: Single message with all signals + RSI + Z-Score + Percentile / 单条消息包含所有触发信号 + RSI + Z-Score + 百分位
- **Simplified settings / 简化设置**: Removed "Extreme Alerts" and "Normal Alerts", only Smart Alert toggle / 移除 "Extreme Alerts" 和 "Normal Alerts",只保留Smart Alert开关
- 🛠 **Performance Optimization / 性能优化**:
- Reduced `request.security` calls by 50% using Tuple Requests / 使用元组请求减少50%的`request.security`调用
- Implemented `str.format()` for cleaner and faster string processing / 实现`str.format()`使字符串处理更简洁高效
- 🧹 **Code Cleanup / 代码清理**:
- Refactored timeframe display and alert logic / 重构时间框架显示和警报逻辑
- Fixed plot limit issues and tuple assignment syntax / 修复绑点限制问题和元组赋值语法
- Unified plot titles with percentile annotations / 统一绑点标题与百分位标注
### v5.0 - Adaptive Fractal MTF / 自适应分形MTF
- 🧠 **Adaptive Fractal MTF / 自适应分形MTF**: New "Auto" mode automatically selects lower timeframes for precision structure analysis (Internal Fractal Resonance). / 新增"Auto"模式,自动选择更低时间框架进行精确结构分析(内部分形共振)。
- Daily Chart → Analyzes 1H & 4H / 日线图 → 分析1小时和4小时
- 1H Chart → Analyzes 5m & 15m / 1小时图 → 分析5分钟和15分钟
- 15m Chart → Analyzes 1m & 5m / 15分钟图 → 分析1分钟和5分钟
- 🛠 **Code Refactoring / 代码重构**: Implemented Pine Script v6 UDTs (Objects) and Methods for robust signal statistics. / 实现Pine Script v6 UDT(对象)和方法,增强信号统计的健壮性。
- 🎨 **Dashboard Optimization / 面板优化**: Enhanced string formatting using `str.format` for cleaner display. / 使用`str.format`优化字符串格式,显示更简洁。
### v4.0 - Pine Script v6 Upgrade / Pine Script v6升级
- 🚀 Upgraded entire codebase to **Pine Script v6** engine / 将整个代码库升级到 **Pine Script v6** 引擎
- ⚡ Optimization for better performance and future-proofing / 性能优化,面向未来
- 🛠 Maintenance updates for latest TradingView standards / 维护更新以符合最新TradingView标准
### v3.0 - Auto-Adaptive Systems / 自动自适应系统
- ✨ Auto-adaptive lookback using formula `n = (Z × σ / E)²` / 使用统计公式 `n = (Z × σ / E)²` 自动计算回看期
- ✨ Auto-adaptive trend filter with 5 modes / 5种模式的自动自适应趋势过滤器
- ✨ Auto-adaptive divergence detection with 4 presets / 4种预设的自动自适应背离检测
- ✨ Layered statistics (MTF/Divergence/Extreme/Normal) / 分层统计系统(MTF/背离/极端/普通)
- ✨ Signal cooldown to prevent duplicate counting / 信号冷却机制防止重复计数
- ✨ Health indicators for lookback validation / 回看期健康度指标验证
- ✨ Dashboard modes (Lite/Full) with customization / 面板模式(Lite/Full)支持自定义大小和透明度
- ✨ Dual volatility system (short + long-term) / 双重波动率系统(短期+长期)
### v2.1 - Signal Optimization / 信号优化
- ✨ Consolidated signals with priority system / 信号合并与优先级系统(无重叠)
- ✨ Emoji-based signal display / 基于Emoji的信号显示
- ✨ MTF timeframe auto-skip for duplicates / MTF时间框架自动跳过重复
### v2.0 - Pro Edition / 专业版
- ✨ Added Trend Filter, MTF RSI, Statistics, Divergence / 新增趋势过滤、MTF RSI、统计、背离检测
- ✨ Z-Score based signal triggering / 基于Z-Score的信号触发
### v1.0 - Initial Release / 初始发布
- ✨ Adaptive percentile-based thresholds / 自适应百分位阈值
---
## License
MIT License - Feel free to use, modify, and share.
趋势分析
EMA13-EMA21 Difference Indicator# EMA13-EMA21 Difference Indicator
## Description
This indicator calculates the difference between the 13-period Exponential Moving Average (EMA13) and the 21-period Exponential Moving Average (EMA21), helping traders visually assess short-term market momentum.
**Core Logic:**
- When the difference is positive (green), the short-term EMA is above the long-term EMA, indicating a bullish trend
- When the difference is negative (red), the short-term EMA is below the long-term EMA, indicating a bearish trend
- Crossovers of the zero line can serve as potential trend reversal signals
**Use Cases:**
- Trend direction identification
- Momentum strength analysis
- Entry and exit timing assistance
**Disclaimer:**
This indicator is for reference only. It is recommended to combine it with other technical analysis tools for comprehensive judgment. This does not constitute investment advice.
50-Point Psych Levels (Multiples of 50)50-Point Psychological Levels (Multiples of 50)
This indicator plots static psychological price levels at fixed point intervals (default every 50 points) across the chart. These levels are commonly watched by traders as natural areas of reaction, balance, support, and resistance, especially on index futures such as NQ, ES, YM, and RTY.
The script automatically centers the levels around the current market price and draws them across a configurable range above and below price. All levels extend across the entire chart and are drawn once only, keeping the display clean and preventing redraw lag.
Key Features
Plots horizontal levels at fixed point spacing (default: 50 points)
Automatically anchors around the latest price
Configurable range above and below price
Customizable line color, width, and style
Lightweight, non-repainting, static reference levels
Best Use Cases
Identifying psychological support and resistance
Confluence with VWAP, EMA structure, ORB levels, and volume
Futures trading (NQ, ES, YM, RTY), indexes, and large-tick instruments
N Days Back Session DividerThis Pine Script acts as a smart vertical marker that identifies exactly where a trading day began a specific number of sessions ago. It is designed to ignore "dead time" (like weekends or holidays) by focusing on actual market activity.
Box Indicator - Auto Draw Previous Day's - High / Midline / LowThis indicator draws a box around the previous day’s high and low, calculates the midline, and displays them on the current day’s chart. It helps visualize key support/resistance levels from the prior trading day.
This script gives you a static reference box from the prior day’s trading range, including a midpoint. It’s useful for spotting potential reversal zones, breakout levels, or intraday targets based on yesterday’s price action.
Session ATR Progression Tracker📊 Session ATR Progression Tracker - SIYL Regression Trading Tool
Track how much of your instrument's 7-day Average True Range (ATR) has been covered during the current trading session. This indicator is specifically designed for regression traders who follow the "Stay In Your Lane" (SIYL) methodology, helping you identify when the probability of mean reversion significantly increases. If you are interested in more on that check out Rod Casselli and tradersdevgroup.com.
🎯 Key Features:
• Real-time ATR Coverage Percentage - See at a glance what percentage of the 7-day ATR has been covered in the current session
• SIYL-Optimized Thresholds - See at a glance when the instrument has achieved 80% and 100% ATR coverage, the proven thresholds where mean reversion probability increases (customizable)
• Flexible Session Modes:
- Daily: Resets at calendar day change
- Session: Uses exchange-defined trading sessions
- Custom Session: Set your exact session start/end times (perfect for futures traders and international markets)
• Visual Alerts - Color-coded display (gray → orange → red) and optional background highlighting
• Repositionable Display - Choose from 9 screen positions to avoid chart clutter
• Session Markers - Green triangles mark the start of each new session
• Detailed Stats - View current range, ATR value, session high/low, and session status
💡 Why Use This Indicator?
This tool is built around a proven concept: regression trading becomes significantly more effective once a session has achieved at least 80% of its 7-day ATR. At this threshold, the probability of price reverting to mean increases substantially, creating higher-probability trade setups for SIYL practitioners.
Benefits for regression traders:
- Identify optimal entry points when mean reversion probability is highest (≥80% ATR coverage)
- Avoid premature regression entries before adequate range has been established
- Recognize when daily moves have "earned their range" and are ripe for reversal
- Time fade-the-move and counter-trend strategies with statistical backing
- Improve win rates by trading only after proven probability thresholds are met
⚙️ Setup Instructions:
1. Add the indicator to your chart
2. Select your preferred "Reset Mode" (recommend "Custom Session" for futures/international markets)
3. If using Custom Session, enter your session times in 24-hour format (e.g., 0930-1600 for US stocks, 1700-1600 for CME futures)
4. Adjust alert thresholds if desired (default: 80% and 100% - proven SIYL thresholds)
5. Position the display where it's most visible on your chart
📈 Works Across All Markets:
Stocks • Futures • Forex • Indices • Crypto • Commodities
Perfect for regression traders, mean reversion specialists, and SIYL practitioners who want to trade with probability on their side by entering only after the session has "earned its range."
---
Tip: For futures contracts with overnight sessions that span calendar days (like MES, MNQ, MYM), use "Custom Session" mode with your exchange's official session times for accurate tracking.
[AlscapeLabs] HTF Candle Stack (Multi-Timeframe)
Overview
The HTF Candle Stack (Multi-TF) indicator is a powerful visualization tool designed to overlay high-timeframe (HTF) price action directly onto your current chart, independent of the chart's price scale. This gives traders a clear, aligned, and non-overlapping view of simultaneous price movements across customizable timeframes.
By stacking the candles horizontally next to the chart's price action, the indicator allows for quick identification of multi-timeframe correlation, trend confluence, and key levels without switching chart timeframes.
Key Features
6 Independent Stacks: Configure up to 6 separate timeframes (e.g., 5m, 15m, 1H, 4H, Daily, Weekly) to view the complete market fractals from micro to macro.
Price-Aligned Visualization : All HTF candle stacks are perfectly aligned with the main chart's vertical price axis
Replay Mode Safe : Includes dedicated logic to prevent "duplicate candles" during Bar Replay, ensuring accurate backtesting and historical analysis.
Toggleable Stacks : Each stack can be individually enabled or disabled via input settings
Dynamic Spacing : The distance between active stacks is automatically calculated and adjusted based on the visibility of the preceding stack.
Settings Guide
Stack Configuration (1 - 6)
Each of the six stacks has identical controls:
Show/Hide : Enable or disable this specific stack.
Timeframe : The specific HTF to display (e.g., "60" for 1 Hour, "D" for Daily).
[*} Count : How many candles to show in this stack (Current Active Candle + Past Closed Candles). Tip: Use higher counts (10-12) for lower TFs (Stack 1-2) and lower counts (2-4) for higher TFs (Stack 5-6)
Candle Color
Controls global coloring
Bullish / Bearish : Customize the body colors.
Wick : Separate control for wick color and transparency
Layout
Distance from Chart : How far (in bars) to the right the first stack begins
Space between Stacks : The gap (in bars) between each active stack.
Candle Width : The thickness of the HTF candles.
Labels
Displays a time-frame next to the active (live) candle in each stack
Show TF Labels : Enable or disable labels through all stacks
Text Color : Label text color
Background : Label background color
Style : Label position (Left, Down)
Size : Label text size (Tiny, Small, Normal, Large, Huge)
Developed by AlscapeLabs
X-Trend Macro Command CenterX-Trend Macro Command Center (MCC) | Institutional Grade Dashboard
📝 Description Body
The Invisible Engine of the Market Revealed.
Traders often focus solely on Price Action, ignoring the massive underwater currents that actually drive trends: Global Liquidity, Inflation, and Central Bank Policy. We created X-Trend Macro Command Center (MCC) to solve this problem.
This is not just an indicator. It is a fundamental heads-up display that bridges the gap between technical charts and macroeconomic reality.
💡 The Idea & Philosophy
Markets don't move in a vacuum. Bull runs are fueled by M2 Money Supply expansion and negative real yields. Crashes are triggered by liquidity crunches and aggressive rate hikes. X-Trend MCC was built to give retail traders the same "Macro Awareness" that institutional desks possess. It aggregates fragmented economic data from Federal Reserve databases (FRED) directly onto your chart in real-time.
🚀 Application & Logic
This tool is designed for Trend Traders, Crypto Investors, and Macro Analysts.
Identify the Regime: Instantly see if the environment is "RISK ON" (High Liquidity, Low Real Rates) or "RISK OFF" (Monetary Tightening).
Validate the Trend: Don't buy the dip if Liquidity (M2) is crashing. Don't short the rally if Real Yields are negative.
Multi-Region Analysis: Switch instantly between economic powerhouses (US, China, Japan) to see where the capital is flowing.
📊 Dashboard Metrics Explained
Every row in the Command Center tells a specific story about the economy:
Interest Rate: The "Gravity" of finance. Higher rates weigh down risk assets (Stocks/Crypto).
Inflation (YoY): The erosion of purchasing power. We calculate this dynamically based on CPI data.
Real Yield (The "Golden" Metric): Calculated as Interest Rate - Inflation.
Green: Real Yield is low/negative. Cash is trash, assets fly.
Red: Real Yield is high. Cash is King, assets struggle.
US Debt & GDP: Fiscal health indicators formatted in Trillions ($T). Watch the Debt-to-GDP ratio—if it spikes >120%, expect currency debasement.
M2 Money Supply: The fuel tank of the market. Tracks the total amount of money in circulation.
↗ Trend: Liquidity is entering the system (Bullish).
↘ Trend: Liquidity is drying up (Bearish).
🧩 The X-Trend Ecosystem
X-Trend MCC is just the tip of the iceberg. This module is part of the larger X-Trend Project — a comprehensive suite of algorithmic tools being developed to quantify market chaos. While our Price Action algorithms (Lite/Pro/Ultra) handle the Micro, the MCC handles the Macro.
Technical Note:
Data Sources: Direct connection to FRED (Federal Reserve Economic Data).
Zero Repainting: Historical data is requested strictly using closed bars to ensure accuracy.
Open Source: We believe in transparency. The code is open for study under MPL 2.0.
Build by Dev0880 | X-Trend © 2025
Pivot Trend [ChartPrime]The Pivot Trend indicator is a tool designed to identify potential trend reversals based on pivot points in the price action. It helps traders spot shifts in market sentiment and anticipate changes in price direction.
◈ User Inputs:
Left Bars: Specifies the number of bars to the left of the current bar to consider when calculating pivot points.
Right Bars: Specifies the number of bars to the right of the current bar to consider when calculating pivot points.
Offset: Adjusts the sensitivity of pivot point detection.
◈ Indicator Calculation:
The indicator calculates pivot points based on the highest and lowest prices within a specified range of bars. It then determines the trend direction based on whether the current price crossed above upper band or crossed below lower band.
Upper and Lower Bands
◈ Visualization:
Trend direction is indicated by the color of the plotted lines, with blue representing an upward trend and red representing a downward trend.
Buy and sell signals are marked on the chart with corresponding symbols (🅑 for buy signals and 🅢 for sell signals).
Buy and sell signals generated by the indicator can be used in conjunction with other technical analysis tools to confirm trading decisions and manage risk.
Overall, the Pivot Trend indicator offers traders a simple yet effective method for identifying potential trend changes and capturing trading opportunities in the market. Adjusting the input parameters allows for customization according to individual trading preferences and market conditions.
Trend Prediction Meter [PointAlgo]The Trend Prediction Meter & Levels is a composite market-bias and volatility visualization tool designed to summarize trend strength, momentum, price positioning, and volatility into a single normalized score.
It provides a structured framework to interpret directional bias and probable price expansion zones during active market conditions.
Concept Overview
Markets often reflect multiple conditions simultaneously—trend direction, momentum strength, price location within a range, and volatility.
This indicator combines these elements into a unified Bullish Score (0–100), displayed as a meter and supported by projected ATR-based levels.
Rather than focusing on a single signal, the script aims to present context about current market conditions.
Bullish Score Composition (0–100)
The meter represents a weighted blend of multiple market factors:
1. Trend Strength (EMA Structure)
Uses a fast and slow EMA to assess directional bias.
The distance between EMAs is normalized into a trend strength score.
Strong separation indicates directional conviction; compression suggests balance.
2. Momentum Strength (RSI Blend)
Combines a short-term and mid-term RSI.
Helps capture both immediate momentum and broader directional stability.
Higher readings indicate sustained bullish pressure, lower readings indicate bearish pressure.
3. Position Within Recent Range
Measures where price is trading relative to its recent high–low range.
Values near the top of the range reflect strength; values near the bottom reflect weakness.
Mid-range positioning indicates equilibrium.
4. Volume Participation
Compares current volume against its recent average.
Acts as a minor confidence modifier rather than a primary driver.
Each component is normalized and combined using fixed weights to produce a final Bullish Score between 0 and 100.
Bias Classification
The Bullish Score is translated into descriptive market states:
Extreme Bullish
Very Bullish
Bullish
Neutral
Bearish
Very Bearish
These labels describe current bias, not future certainty.
Meter Visualization
The meter plot dynamically changes color based on the score range.
A dashed midline at 50 represents balance.
Background shading highlights strong bullish or bearish dominance zones.
Crossovers of the 50-level indicate shifts in directional control.
ATR-Based Projection Levels:
To provide volatility context, the indicator calculates ATR-based upside and downside reference levels:
Two potential expansion levels (TP1 and TP2) are projected above and below price.
The distance of these levels adapts based on current bias strength.
These levels are contextual reference zones, not fixed targets.
Prediction Dashboard
An optional side table summarizes key readings at the most recent bar:
Symbol
Current bias label
Bullish Score
Current price
ATR value
Upside and downside projection levels
Directional comment (Upside favoured / Downside favoured / Balanced)
This dashboard is designed to provide a quick structural overview without requiring manual calculation.
Signals & Alerts
Built-in alerts are available for:
Bullish bias conditions
Bearish bias conditions
Bullish Score crossing above 50
Bullish Score crossing below 50
Alerts are informational and reflect internal state changes only.
Customization:
Users can adjust:
RSI lengths
EMA lengths
Range lookback period
ATR parameters
Display options for the meter and dashboard
This allows adaptation across different instruments and timeframes.
Usage Notes
Best suited for analytical interpretation rather than standalone decision-making.
Designed to complement price action, structure, or other indicators.
Works across multiple markets where volume and volatility data are available.
Disclaimer :
This indicator is intended for educational and analytical purposes only.
It does not provide investment, trading, or financial advice.
All signals and levels should be validated with independent analysis and appropriate risk management.
VR Volume Ratio + Divergence (Pro)成交量比率 (Volume Ratio, VR) 是一項通過分析股價上漲與下跌日的成交量,來研判市場資金氣氛的技術指標。本腳本基於傳統 VR 公式進行了優化,增加了**「趨勢變色」與「自動背離偵測」**功能,幫助交易者更精準地捕捉量價轉折點。
Introduction
Volume Ratio (VR) is a technical indicator that measures the strength of a trend by comparing the volume on up-days versus down-days. This script enhances the classic VR formula with "Trend Color Coding" and "Auto-Divergence Detection", helping traders identify volume-price reversals more accurately.
核心功能與參數
公式原理: VR = (Qu + Qf/2) / (Qd + Qf/2) * 100
Qu: 上漲日成交量 (Up volume)
Qd: 下跌日成交量 (Down volume)
Qf: 平盤日成交量 (Flat volume)
參數 (Length):預設為 26 日,這是市場公認最有效的短中線參數。
關鍵水位線 (Key Levels):
< 40% (底部區):量縮極致,市場情緒冰點,常對應股價底部,適合尋找買點。
100% (中軸):多空分界線。
> 260% (多頭警戒):進入強勢多頭行情,但需注意過熱。
> 450% (頭部區):成交量過大,市場情緒亢奮,通常為頭部訊號。
視覺優化 (Visuals):
紅漲綠跌:當 VR 數值大於前一日顯示為紅色(動能增強);小於前一日顯示為綠色(動能退潮)。
背離訊號 (Divergence):自動標記量價背離。
▲ 底背離 (Bullish):股價創新低,但 VR 指標墊高(主力吸籌)。
▼ 頂背離 (Bearish):股價創新高,但 VR 指標走弱(買氣衰竭)。
Features & Settings
Formula Logic: Calculated as VR = (Qu + Qf/2) / (Qd + Qf/2) * 100.
Default Length: 26, widely regarded as the optimal setting for short-to-medium term analysis.
Key Zones:
< 40% (Oversold/Bottom): Extreme low volume, often indicating a market bottom and potential buying opportunity.
100% (Neutral): The balance point between bulls and bears.
> 260% (Bullish Zone): Strong uptrend, volume is expanding.
> 450% (Overbought/Top): Extreme high volume, often indicating a market top and potential reversal.
Visual Enhancements:
Color Coding: Line turns Red when VR rises (Momentum Up) and Green when VR falls (Momentum Down).
Divergence Signals: Automatically marks divergence points on the chart.
▲ Bullish Divergence: Price makes a lower low, but VR makes a higher low (Accumulation).
▼ Bearish Divergence: Price makes a higher high, but VR makes a lower high (Distribution).
應用策略建議
抄底策略:當 VR 跌破 40% 後,指標線由綠翻紅,或出現「▲底背離」訊號時,為極佳的波段進場點。
逃頂策略:當 VR 衝過 450% 進入高檔區,一旦指標線由紅翻綠,或出現「▼頂背離」訊號時,建議分批獲利了結。
Strategy Guide
Bottom Fishing: Look for entries when VR drops below 40% and turns red, or when a "▲ Bullish Divergence" label appears.
Taking Profit: Consider selling when VR exceeds 450% and turns green, or when a "▼ Bearish Divergence" label appears.
Disclaimer: This tool is for informational purposes only and does not constitute financial advice. / 本腳本僅供參考,不構成投資建議。
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.
Supply and Demand Zones [BigBeluga]🔵 OVERVIEW
The Supply and Demand Zones indicator automatically identifies institutional order zones formed by high-volume price movements. It detects aggressive buying or selling events and marks the origin of these moves as demand or supply zones. Untested zones are plotted with thick solid borders, while tested zones become dashed, signaling reduced strength.
🔵 CONCEPTS
Supply Zones: Identified when 3 or more bearish candles form consecutively with above-average volume. The script then searches up to 5 bars back to find the last bullish candle and plots a supply zone from that candle’s low to its low plus ATR.
Demand Zones: Detected when 3 or more bullish candles appear with above-average volume. The script looks up to 5 bars back for a bearish candle and plots a demand zone from its high to its high minus ATR.
Volume Weighting: Each zone displays the cumulative bullish or bearish volume within the move leading to the zone.
Tested Zones: If price re-enters a zone and touches its boundary after being extended for 15 bars, the zone becomes dashed , indicating a potential weakening of that level.
Overlap Logic: Older overlapping zones are removed automatically to keep the chart clean and only show the most relevant supply/demand levels.
Zone Expiry: Zones are also deleted after they’re fully broken by price (i.e., price closes above supply or below demand).
🔵 FEATURES
Auto-detects supply and demand using volume and candle structure.
Extends valid zones to the right side of the chart.
Solid borders for fresh untested zones.
Dashed borders for tested zones (after 15 bars and contact).
Prevents overlapping zones of the same type.
Labels each zone with volume delta collected during zone formation.
Limits to 5 zones of each type for clarity.
Fully customizable supply and demand zone colors.
🔵 HOW TO USE
Use supply zones as potential resistance levels where sell-side pressure could emerge.
Use demand zones as potential support areas where buyers might step in again.
Pay attention to whether a zone is solid (untested) or dashed (tested).
Combine with other confluences like volume spikes, trend direction, or candlestick patterns.
Ideal for swing traders and scalpers identifying key reaction levels.
🔵 CONCLUSION
Supply and Demand Zones is a clean and logic-driven tool that visualizes critical liquidity zones formed by institutional moves. It tracks untested and tested levels, giving traders a visual edge to recognize where price might bounce or reverse due to historical order flow.
Momentum Burst Pullback System v66* Detects **momentum “bursts”** using:
* **Keltner breakout** (high above upper band for long, low below lower band for short), and/or
* **MACD histogram extreme** (highest/lowest in a lookback window, with correct sign).
* Optional **burst-zone extension** keeps the burst “active” for N extra bars after the burst.
* Marks bursts with **K** (Keltner) and **M** (MACD) labels:
* Core burst labels use one color, extension labels use a different color.
* Tracks the most recent burst as the **dominant side** (long or short), and stores burst “leg” anchors (high/low context).
* Adds **structure-based invalidation**:
* On a new **core burst**, it locks the most recent **confirmed swing** level (pivot):
* Long: locks the last confirmed **swing low**.
* Short: locks the last confirmed **swing high**.
* After the burst, if price **breaks that locked level**, the burst regime is **cancelled** (and any pending setup on that side is dropped).
* Finds **pullback setups** after a dominant burst (and not inside the active burst zone), within min/max bars:
* Long pullback requires a sequence of **lower highs** and price still below the burst high.
* Short pullback requires **higher lows** and price still above the burst low.
* Optional background shading highlights pullback bars.
* On pullback bars, plots **static TP/SL crosses** using ATR:
* Anchor is the pullback bar’s high (long) or low (short).
* TP/SL are ± ATR * multiple.
* TP plots are visually classified (bright vs faded) based on whether TP would exceed the prior burst extreme.
* Maintains a **state-machine entry + trailing stop**:
* Sets a “waiting” trigger on pullback.
* Enters when price breaks the trigger (high break for long, low break for short).
* Trails a stop using **R-multiples**, with different behavior pre-break-even, post-break-even, and near-TP.
* Optionally draws the trailing stop as horizontal line segments.
* Optionally shows a **last-bar label** with the most recent pullback’s TP and SL values.
strongResistanceActually it is education purpose. This indicator is designed to help traders clearly identify strong Support & Resistance (SNR) levels along with high-probability Buy & Sell..
The indicator works smoothly on lower timeframes for binary trading.
Future Ichimoku Cloud - HorizonIchimoku Horizon is an advanced Ichimoku indicator that projects future cloud formations and component lines, giving traders unprecedented visibility into potential support/resistance zones before they form.
1. Future Ichimoku Projections
Project Ichimoku components forward in time using simulated price evolution based on rolling Tenkan/Kijun windows
Manual forecast periods up to 125 bars (all 4 components) or 500 bars (cloud only)
Smart limit management automatically adjusts to TradingView's drawing object limits while maximizing visible projections
2. Preset & Custom Ichimoku Configurations
Choose from multiple common Ichimoku presets or fully customize your own
3. Multi-Timeframe Display & Projections
Display Ichimoku from higher/lower timeframes directly on your current timeframe chart
Automatic scaling adjusts Ichimoku periods correctly across timeframes
Intelligent handling of 24/7 markets (crypto/forex) vs traditional session-based markets
Built-in detection of problematic timeframe combinations with optional MTF cloud fetching for accuracy
Automatic notifications when future projections are unavailable due to MTF constraints
4. Tenkan & Kijun Range Windows
Visual range windows that display the exact high/low range used for Tenkan and Kijun calculations
Optional High/Low markers placed at the exact bars they occur
Optional countdown labels show how many bars remain until the current High/Low expires from the rolling window
Range windows scale up and down dynamically to match display timeframe
5. Comprehensive Alert Suite
Built-in alerts for all major Ichimoku events: TK crosses, E2E entires, Kumo breakouts, etc.
All alerts are cloud-aware and displacement-correct.
How It Works
The indicator uses the traditional Donchian channel method to calculate Ichimoku components, then extends this logic forward by simulating future price action within the calculation windows (no new highs or lows). This creates a forward-looking projection of where support and resistance zones will form.
The range display feature helps traders understand why the lines are where they are by showing the exact high/low points and countdown timers for when these points will expire from the calculation.
Who This Indicator Is For:
Ichimoku traders who want future-aware context
Multi-timeframe analysts seeking correctly aligned clouds
Traders who want to understand Tenkan/Kijun mechanics
Users who need precision without manual recalculation
Notes:
Maximum 500 drawing objects limit managed automatically
Due to Pinescript/TradingView limitations, future Tenkan/Kijun line width is only modifiable in the source code.
Liquidity Vacuum DetectorThis indicator identifies liquidity vacuum zones—price areas where the market previously moved quickly with little resistance. These zones often allow price to travel faster once re-entered, which is favorable for intraday options trading.
Vacuum zones are created during strong, clean impulse moves (large range, low overlap, thin participation). When price later enters a stored vacuum zone with volume expansion, the indicator prints a directional triangle to highlight a potential high-speed move.
Optional filters include VWAP directional bias and regular trading hours (RTH).
Designed as a trade filter and acceleration tool, not a predictive signal.
Best used in combination with key levels (PMH/PML, ORH/ORL, VWAP) and volume confirmation.
ETIQUETAS DE ANCLAJE.INTERVALO 9:00 AM/4.15PMThis indicator displays labels on the candlestick that range from 9:00 am to 4:15 pm, with 5-minute intervals, indicating the 5M periods on the chart.
Trend Quality Score (Options-Friendly)Trend Quality Score for options entry that signals with background coloring for good movement or chop, to avoid theta burn. Toggle for conservative, balanced or aggressive with triggers.
previous day/week high and lowsThis scrip plots the previous day high and lows, pre market high and lows, previous week high and low.
UNDETECTED FX - 250 Pip LevelsIndicator Description – UNDETECTED FX: 250-Pip Psychological Levels
This indicator automatically plots major 250-pip psychological levels on XAUUSD and highlights the price zones around them. These levels act as strong reaction points where liquidity, reversals, and institutional activity commonly occur.
What the Indicator Does
✔ Plots every 250-pip level starting from a user-defined base (e.g., 4050 → 4075 → 4100 → 4125 → …)
✔ Each level is represented by a thick black horizontal line for maximum visual clarity
✔ Around every 250-pip level, the indicator draws a liquidity zone
Top of zone: +200 pips
Bottom of zone: –200 pips
(configured as ± zoneHalf in settings)
✔ Uses extend: both, so levels stretch across the entire chart and stay fixed, no matter how far you scroll
✔ Zones are filled with a customizable color for clear premium/discount visualization
✔ The indicator never repaints and requires no updates after drawing — all levels are fixed on their price coordinates
Why It’s Useful
🔹 Helps quickly identify institutional levels where gold often reacts
🔹 Acts as a framework for scalping, intraday trading, and swing bias
🔹 Makes it easy to spot liquidity sweeps, rejections, and premium/discount areas
🔹 Clearly shows market structure breaks around key psychological levels
🔹 Forces discipline by creating predefined, fixed levels for trading decisions
Best Use Case
XAUUSD scalpers
Intraday traders who rely on precision entries
Traders who use psychological levels, liquidity grabs, or smart-money concepts
Anyone wanting a clean, non-cluttered chart with high-impact levels only






















