OPEN-SOURCE SCRIPT
Scout Regiment - OBV

# Scout Regiment - OBV Indicator
## English Documentation
### Overview
Scout Regiment - OBV (On-Balance Volume) is an advanced momentum indicator that combines volume and price movement to identify the strength of buying and selling pressure. This indicator features an oscillator-based approach with divergence detection to help traders spot potential trend reversals and confirm price movements.
### What is OBV?
On-Balance Volume (OBV) is a cumulative volume indicator that adds volume on up days and subtracts volume on down days:
- **Rising OBV**: Accumulation (buying pressure)
- **Falling OBV**: Distribution (selling pressure)
- **OBV Oscillator**: The difference between OBV and its smoothed moving average, making divergences easier to spot
### Key Features
#### 1. **OBV Oscillator Display**
Instead of displaying raw OBV values, this indicator shows the oscillator (difference between OBV and its smoothed line):
**Benefits:**
- Easier to identify divergences
- Clearer trend changes
- More sensitive to momentum shifts
- Zero line as reference point
**Visual Elements:**
- **Step Line**: Main OBV oscillator line
- Green: Positive oscillator (accumulation)
- Red: Negative oscillator (distribution)
- **Histogram**: Visual representation of oscillator strength
- Green bars: Above zero line
- Red bars: Below zero line
- **Zero Line**: White dotted horizontal line as reference
#### 2. **Smoothing Options**
Choose from multiple moving average types to smooth the OBV:
- **None**: Raw OBV (most sensitive)
- **SMA**: Simple Moving Average (equal weight)
- **EMA**: Exponential Moving Average (recent price emphasis) - Default
- **SMMA (RMA)**: Smoothed Moving Average (very smooth)
- **WMA**: Weighted Moving Average (linear weight)
- **VWMA**: Volume Weighted Moving Average (volume emphasis)
**Default Settings:**
- Type: EMA
- Length: 21 periods
- Best for: Most market conditions
#### 3. **Multi-Timeframe Analysis**
- Calculate OBV on any timeframe
- View higher timeframe momentum on lower timeframe charts
- Align trades with larger timeframe volume trends
- Empty field = Current chart timeframe
#### 4. **Visual Enhancements**
**Background Color**
- Light green: Positive oscillator (bullish volume pressure)
- Light red: Negative oscillator (bearish volume pressure)
- Optional display for cleaner charts
**Crossover Labels**
- "突破" (Breakout): When oscillator crosses above zero
- "跌破" (Breakdown): When oscillator crosses below zero
- Indicates potential trend changes
- Can be toggled on/off
#### 5. **Comprehensive Divergence Detection**
The indicator automatically detects four types of divergences:
**Regular Bullish Divergence (Yellow)**
- **Price**: Makes lower lows
- **OBV**: Makes higher lows
- **Signal**: Potential upward reversal
- **Label**: "看涨" (Bullish)
- **Use**: Enter long positions
**Regular Bearish Divergence (Blue)**
- **Price**: Makes higher highs
- **OBV**: Makes lower highs
- **Signal**: Potential downward reversal
- **Label**: "看跌" (Bearish)
- **Use**: Enter short positions or exit longs
**Hidden Bullish Divergence (Light Yellow)**
- **Price**: Makes higher lows
- **OBV**: Makes lower lows
- **Signal**: Trend continuation (uptrend)
- **Label**: "隐藏看涨" (Hidden Bullish)
- **Use**: Add to long positions
**Hidden Bearish Divergence (Light Blue)**
- **Price**: Makes lower highs
- **OBV**: Makes higher highs
- **Signal**: Trend continuation (downtrend)
- **Label**: "隐藏看跌" (Hidden Bearish)
- **Use**: Add to short positions
#### 6. **Customizable Divergence Detection**
**Pivot Lookback Settings:**
- **Left Lookback**: Bars to the left of pivot (default: 5)
- **Right Lookback**: Bars to the right of pivot (default: 5)
- Determines how "extreme" a point must be to qualify as a pivot
**Range Settings:**
- **Maximum Range**: Maximum bars between pivots (default: 60)
- **Minimum Range**: Minimum bars between pivots (default: 5)
- Filters out too-close or too-distant divergences
**Display Options:**
- Toggle regular divergences on/off
- Toggle hidden divergences on/off
- Toggle divergence labels on/off
- Show only the divergences you need
### Configuration Settings
#### Smoothing Settings
- **Smoothing Type**: Choose MA type (None/SMA/EMA/SMMA/WMA/VWMA)
- **Smoothing Length**: Number of periods for smoothing (default: 21)
#### Calculation Settings
- **Timeframe**: Select calculation timeframe (empty = current chart)
#### Display Settings
- **Show OBV Line**: Toggle step line display
- **Show OBV Histogram**: Toggle histogram display
- **Show Background Color**: Toggle background coloring
- **Show Crossover Labels**: Toggle breakout/breakdown labels
#### Divergence Settings
- **Pivot Right Lookback**: Right bars for pivot detection (default: 5)
- **Pivot Left Lookback**: Left bars for pivot detection (default: 5)
- **Range Maximum**: Max bars between divergences (default: 60)
- **Range Minimum**: Min bars between divergences (default: 5)
- **Show Regular Divergences**: Enable/disable regular divergences
- **Show Regular Labels**: Enable/disable regular divergence labels
- **Show Hidden Divergences**: Enable/disable hidden divergences
- **Show Hidden Labels**: Enable/disable hidden divergence labels
### How to Use
#### For Trend Confirmation
1. **Identify Trend with Price**
- Uptrend: Higher highs and higher lows
- Downtrend: Lower highs and lower lows
2. **Confirm with OBV Oscillator**
- Strong uptrend: OBV oscillator staying positive
- Strong downtrend: OBV oscillator staying negative
- Weak trend: OBV oscillator frequently crossing zero
3. **Volume Confirmation**
- Trend with increasing OBV = Strong trend
- Trend with decreasing OBV = Weak trend (watch for reversal)
#### For Divergence Trading
1. **Enable Divergence Detection**
- Start with regular divergences only
- Add hidden divergences for trend continuation
2. **Wait for Divergence Signal**
- Yellow label = Potential bullish reversal
- Blue label = Potential bearish reversal
3. **Confirm with Price Action**
- Wait for support/resistance break
- Look for candlestick confirmation
- Check higher timeframe alignment
4. **Enter Trade**
- Enter after confirmation
- Set stop loss beyond recent swing
- Target based on previous swing or support/resistance
#### For Breakout Trading
1. **Enable Crossover Labels**
- Identify when oscillator crosses zero line
2. **Confirm Volume Strength**
- Strong breakouts have large oscillator moves
- Weak breakouts barely cross zero
3. **Trade Direction**
- "突破" label = Enter long
- "跌破" label = Enter short
4. **Manage Position**
- Exit when oscillator crosses back
- Use price structure for stops
#### For Multi-Timeframe Analysis
1. **Set Higher Timeframe**
- Example: On 15min chart, set timeframe to 1H or 4H
2. **Identify Higher Timeframe Trend**
- Positive oscillator = Uptrend bias
- Negative oscillator = Downtrend bias
3. **Trade with the Trend**
- Only take long signals in uptrend
- Only take short signals in downtrend
4. **Time Entries**
- Use current timeframe for precise entry
- Confirm with higher timeframe direction
### Trading Strategies
#### Strategy 1: Regular Divergence Reversal
**Setup:**
1. Price in strong trend (up or down)
2. Regular divergence appears
3. Price reaches support/resistance level
**Entry:**
- Bullish: After "看涨" label, when price breaks above recent high
- Bearish: After "看跌" label, when price breaks below recent low
**Stop Loss:**
- Bullish: Below divergence low
- Bearish: Above divergence high
**Exit:**
- Take profit at next major support/resistance
- Or when opposite divergence appears
**Best For:** Swing trading, reversal trading
#### Strategy 2: Hidden Divergence Continuation
**Setup:**
1. Clear trend established
2. Price pulls back (retracement)
3. Hidden divergence appears
**Entry:**
- Bullish: After "隐藏看涨" label, when price resumes uptrend
- Bearish: After "隐藏看跌" label, when price resumes downtrend
**Stop Loss:**
- Behind the pullback swing point
**Exit:**
- Trail stop as trend continues
- Exit on regular divergence (reversal signal)
**Best For:** Trend following, adding to positions
#### Strategy 3: Zero Line Crossover
**Setup:**
1. Enable crossover labels
2. Oscillator crosses zero line
3. Confirm with price structure break
**Entry:**
- "突破" label = Buy signal
- "跌破" label = Sell signal
**Stop Loss:**
- Below/above recent swing
**Exit:**
- When oscillator crosses back over zero
- Or at predetermined target
**Best For:** Momentum trading, quick trades
#### Strategy 4: Multi-Timeframe Confluence
**Setup:**
1. Set indicator to higher timeframe (e.g., 4H on 1H chart)
2. Wait for higher TF oscillator to be positive (uptrend) or negative (downtrend)
3. Look for entries on current timeframe aligned with higher TF
**Entry:**
- Long: When both timeframes show positive oscillator or bullish divergence
- Short: When both timeframes show negative oscillator or bearish divergence
**Stop Loss:**
- Based on current timeframe structure
**Exit:**
- When higher timeframe oscillator turns negative (for longs) or positive (for shorts)
**Best For:** Swing trading, high-probability setups
### Best Practices
#### Volume Analysis
1. **Strong Moves Need Volume**
- Price increase + Rising OBV = Healthy uptrend
- Price increase + Falling OBV = Weak uptrend (warning)
2. **Watch for Confirmation**
- New highs with new OBV highs = Confirmed
- New highs without new OBV highs = Potential divergence
3. **Consider Context**
- Low volume periods (Asian session, holidays) = Less reliable
- High volume periods (News, London/NY overlap) = More reliable
#### Divergence Trading Tips
1. **Not All Divergences Work**
- Wait for price confirmation
- Stronger in oversold/overbought areas
- Better at support/resistance levels
2. **Multiple Divergences**
- Multiple divergences on same trend = Stronger signal
- Quick divergence failures = Ignore and wait for next
3. **Timeframe Matters**
- Higher timeframe divergences = More reliable
- Lower timeframe divergences = More frequent, less reliable
#### Smoothing Selection
1. **No Smoothing (None)**
- Most sensitive, more signals
- More noise, more false signals
- Best for: Scalping, very active trading
2. **EMA (Default)**
- Balanced approach
- Good for most strategies
- Best for: Swing trading, day trading
3. **SMMA (RMA)**
- Very smooth, fewer signals
- Less responsive to sudden changes
- Best for: Position trading, longer timeframes
### Indicator Combinations
**With Moving Averages:**
- Use EMAs for trend direction
- OBV for volume confirmation
- Enter when both align
**With RSI:**
- RSI for overbought/oversold
- OBV for volume confirmation
- Divergences on both = Stronger signal
**With Price Action:**
- Support/resistance for levels
- OBV for strength confirmation
- Breakouts with positive OBV = More likely to succeed
**With Bias Indicator:**
- Bias for price deviation
- OBV for volume confirmation
- Both showing divergence = High probability reversal
### Common Patterns
1. **Accumulation**: OBV rising while price consolidates (breakout likely)
2. **Distribution**: OBV falling while price consolidates (breakdown likely)
3. **Confirmation**: OBV and price both making new highs/lows (trend strong)
4. **Divergence**: OBV and price moving opposite directions (reversal warning)
5. **False Breakout**: Price breaks but OBV doesn't confirm (likely to fail)
### Performance Tips
- Disable unused display features for faster loading
- Start with regular divergences only, add hidden later
- Use histogram for quick visual reference
- Enable crossover labels for clear entry signals
- Test different smoothing lengths for your market
### Alert Conditions
The indicator includes alerts for:
- Regular bullish divergence detected
- Regular bearish divergence detected
- Hidden bullish divergence detected
- Hidden bearish divergence detected
**How to Set Alerts:**
1. Click on the indicator name
2. Select "Add Alert"
3. Choose condition
4. Configure notification method
---
## 中文说明文档
### 概述
Scout Regiment - OBV(能量潮)是一个高级动量指标,结合成交量和价格变动来识别买卖压力的强度。该指标采用振荡器方法并具有背离检测功能,帮助交易者发现潜在的趋势反转并确认价格走势。
### 什么是OBV?
能量潮(OBV)是一个累积成交量指标,在上涨日累加成交量,在下跌日减去成交量:
- **上升的OBV**:积累(买入压力)
- **下降的OBV**:派发(卖出压力)
- **OBV振荡器**:OBV与其平滑移动平均线之间的差值,使背离更容易识别
### 核心功能
#### 1. **OBV振荡器显示**
该指标不显示原始OBV值,而是显示振荡器(OBV与其平滑线之间的差值):
**优势:**
- 更容易识别背离
- 趋势变化更清晰
- 对动量变化更敏感
- 零线作为参考点
**视觉元素:**
- **阶梯线**:主OBV振荡器线
- 绿色:正振荡器(积累)
- 红色:负振荡器(派发)
- **柱状图**:振荡器强度的可视化表示
- 绿色柱:零线以上
- 红色柱:零线以下
- **零线**:白色虚线作为参考
#### 2. **平滑选项**
选择多种移动平均类型来平滑OBV:
- **None**:原始OBV(最敏感)
- **SMA**:简单移动平均(等权重)
- **EMA**:指数移动平均(强调近期价格)- 默认
- **SMMA (RMA)**:平滑移动平均(非常平滑)
- **WMA**:加权移动平均(线性权重)
- **VWMA**:成交量加权移动平均(强调成交量)
**默认设置:**
- 类型:EMA
- 长度:21周期
- 适合:大多数市场状况
#### 3. **多时间框架分析**
- 在任何时间框架上计算OBV
- 在低时间框架图表上查看高时间框架动量
- 使交易与更大时间框架的成交量趋势保持一致
- 空字段 = 当前图表时间框架
#### 4. **视觉增强**
**背景颜色**
- 浅绿色:正振荡器(看涨成交量压力)
- 浅红色:负振荡器(看跌成交量压力)
- 可选显示,图表更清爽
**穿越标签**
- "突破":振荡器向上穿越零线
- "跌破":振荡器向下穿越零线
- 指示潜在趋势变化
- 可开关
#### 5. **全面的背离检测**
指标自动检测四种类型的背离:
**常规看涨背离(黄色)**
- **价格**:创新低
- **OBV**:创更高的低点
- **信号**:潜在向上反转
- **标签**:"看涨"
- **用途**:进入多头仓位
**常规看跌背离(蓝色)**
- **价格**:创新高
- **OBV**:创更低的高点
- **信号**:潜在向下反转
- **标签**:"看跌"
- **用途**:进入空头仓位或退出多头
**隐藏看涨背离(浅黄色)**
- **价格**:创更高的低点
- **OBV**:创更低的低点
- **信号**:趋势延续(上升趋势)
- **标签**:"隐藏看涨"
- **用途**:加仓多头
**隐藏看跌背离(浅蓝色)**
- **价格**:创更低的高点
- **OBV**:创更高的高点
- **信号**:趋势延续(下降趋势)
- **标签**:"隐藏看跌"
- **用途**:加仓空头
#### 6. **可自定义的背离检测**
**枢轴回溯设置:**
- **左侧回溯**:枢轴点左侧K线数(默认:5)
- **右侧回溯**:枢轴点右侧K线数(默认:5)
- 决定一个点要多"极端"才能成为枢轴点
**范围设置:**
- **最大范围**:枢轴点之间最大K线数(默认:60)
- **最小范围**:枢轴点之间最小K线数(默认:5)
- 过滤太近或太远的背离
**显示选项:**
- 开关常规背离
- 开关隐藏背离
- 开关背离标签
- 只显示需要的背离
### 配置设置
#### 平滑设置
- **平滑类型**:选择MA类型(None/SMA/EMA/SMMA/WMA/VWMA)
- **平滑长度**:平滑周期数(默认:21)
#### 计算设置
- **时间周期**:选择计算时间框架(空 = 当前图表)
#### 显示设置
- **显示OBV点线**:切换阶梯线显示
- **显示OBV柱状图**:切换柱状图显示
- **显示背景颜色**:切换背景着色
- **显示突破标签**:切换突破/跌破标签
#### 背离设置
- **枢轴右侧回溯**:枢轴检测右侧K线数(默认:5)
- **枢轴左侧回溯**:枢轴检测左侧K线数(默认:5)
- **回看范围最大值**:背离之间最大K线数(默认:60)
- **回看范围最小值**:背离之间最小K线数(默认:5)
- **显示常规背离**:启用/禁用常规背离
- **显示常规背离标签**:启用/禁用常规背离标签
- **显示隐藏背离**:启用/禁用隐藏背离
- **显示隐藏背离标签**:启用/禁用隐藏背离标签
### 使用方法
#### 趋势确认
1. **用价格识别趋势**
- 上升趋势:更高的高点和更高的低点
- 下降趋势:更低的高点和更低的低点
2. **用OBV振荡器确认**
- 强劲上升趋势:OBV振荡器保持正值
- 强劲下降趋势:OBV振荡器保持负值
- 弱势趋势:OBV振荡器频繁穿越零线
3. **成交量确认**
- 趋势伴随上升的OBV = 强趋势
- 趋势伴随下降的OBV = 弱趋势(注意反转)
#### 背离交易
1. **启用背离检测**
- 先从常规背离开始
- 添加隐藏背离用于趋势延续
2. **等待背离信号**
- 黄色标签 = 潜在看涨反转
- 蓝色标签 = 潜在看跌反转
3. **用价格行为确认**
- 等待支撑/阻力突破
- 寻找K线确认
- 检查更高时间框架对齐
4. **进入交易**
- 确认后进入
- 在近期波动之外设置止损
- 基于前一波动或支撑/阻力设定目标
#### 突破交易
1. **启用穿越标签**
- 识别振荡器何时穿越零线
2. **确认成交量强度**
- 强突破有大振荡器移动
- 弱突破勉强穿越零线
3. **交易方向**
- "突破"标签 = 进入多头
- "跌破"标签 = 进入空头
4. **管理仓位**
- 振荡器反向穿越时退出
- 使用价格结构设置止损
#### 多时间框架分析
1. **设置更高时间框架**
- 例如:在15分钟图上,设置时间框架为1H或4H
2. **识别更高时间框架趋势**
- 正振荡器 = 上升趋势偏向
- 负振荡器 = 下降趋势偏向
3. **顺趋势交易**
- 仅在上升趋势中接受多头信号
- 仅在下降趋势中接受空头信号
4. **把握入场时机**
- 使用当前时间框架进行精确进入
- 用更高时间框架方向确认
### 交易策略
#### 策略1:常规背离反转
**设置:**
1. 价格处于强趋势(上涨或下跌)
2. 出现常规背离
3. 价格到达支撑/阻力水平
**入场:**
- 看涨:在"看涨"标签后,价格突破近期高点时
- 看跌:在"看跌"标签后,价格跌破近期低点时
**止损:**
- 看涨:背离低点之下
- 看跌:背离高点之上
**退出:**
- 在下一个主要支撑/阻力获利
- 或出现相反背离时
**适合:**波段交易、反转交易
#### 策略2:隐藏背离延续
**设置:**
1. 建立明确趋势
2. 价格回调(回撤)
3. 出现隐藏背离
**入场:**
- 看涨:在"隐藏看涨"标签后,价格恢复上升趋势时
- 看跌:在"隐藏看跌"标签后,价格恢复下降趋势时
**止损:**
- 在回调波动点之后
**退出:**
- 随着趋势延续移动止损
- 出现常规背离(反转信号)时退出
**适合:**趋势跟随、加仓
#### 策略3:零线穿越
**设置:**
1. 启用穿越标签
2. 振荡器穿越零线
3. 用价格结构突破确认
**入场:**
- "突破"标签 = 买入信号
- "跌破"标签 = 卖出信号
**止损:**
- 近期波动之下/之上
**退出:**
- 振荡器反向穿越零线时
- 或在预定目标
**适合:**动量交易、快速交易
#### 策略4:多时间框架汇合
**设置:**
1. 设置指标到更高时间框架(例如,在1H图上设置4H)
2. 等待更高TF振荡器为正(上升趋势)或负(下降趋势)
3. 在当前时间框架上寻找与更高TF一致的入场机会
**入场:**
- 多头:两个时间框架都显示正振荡器或看涨背离时
- 空头:两个时间框架都显示负振荡器或看跌背离时
**止损:**
- 基于当前时间框架结构
**退出:**
- 更高时间框架振荡器变为负(多头)或正(空头)时
**适合:**波段交易、高概率设置
### 最佳实践
#### 成交量分析
1. **强势波动需要成交量**
- 价格上涨 + 上升的OBV = 健康上升趋势
- 价格上涨 + 下降的OBV = 弱上升趋势(警告)
2. **注意确认**
- 新高伴随新OBV高点 = 已确认
- 新高没有新OBV高点 = 潜在背离
3. **考虑背景**
- 低成交量期(亚洲时段、假期)= 可靠性较低
- 高成交量期(新闻、伦敦/纽约重叠)= 更可靠
#### 背离交易技巧
1. **不是所有背离都有效**
- 等待价格确认
- 在超卖/超买区域更强
- 在支撑/阻力水平更好
2. **多重背离**
- 同一趋势上多个背离 = 更强信号
- 背离快速失败 = 忽略并等待下一个
3. **时间框架重要**
- 更高时间框架背离 = 更可靠
- 更低时间框架背离 = 更频繁,可靠性较低
#### 平滑选择
1. **无平滑(None)**
- 最敏感,更多信号
- 更多噪音,更多假信号
- 适合:剥头皮、非常活跃的交易
2. **EMA(默认)**
- 平衡方法
- 适合大多数策略
- 适合:波段交易、日内交易
3. **SMMA (RMA)**
- 非常平滑,更少信号
- 对突然变化响应较慢
- 适合:仓位交易、更长时间框架
### 指标组合
**与移动平均线配合:**
- 使用EMA确定趋势方向
- OBV确认成交量
- 两者一致时进入
**与RSI配合:**
- RSI用于超买超卖
- OBV用于成交量确认
- 两者都背离 = 更强信号
**与价格行为配合:**
- 支撑/阻力确定水平
- OBV确认强度
- 正OBV的突破 = 更可能成功
**与Bias指标配合:**
- Bias用于价格偏离
- OBV用于成交量确认
- 两者都显示背离 = 高概率反转
### 常见形态
1. **积累**:OBV上升而价格盘整(突破可能)
2. **派发**:OBV下降而价格盘整(跌破可能)
3. **确认**:OBV和价格都创新高/新低(趋势强劲)
4. **背离**:OBV和价格反向移动(反转警告)
5. **假突破**:价格突破但OBV不确认(可能失败)
### 性能提示
- 禁用未使用的显示功能以加快加载
- 先从常规背离开始,稍后添加隐藏背离
- 使用柱状图快速视觉参考
- 启用穿越标签以获得清晰的入场信号
- 为您的市场测试不同的平滑长度
### 警报条件
指标包含以下警报:
- 检测到常规看涨背离
- 检测到常规看跌背离
- 检测到隐藏看涨背离
- 检测到隐藏看跌背离
**如何设置警报:**
1. 点击指标名称
2. 选择"添加警报"
3. 选择条件
4. 配置通知方法
---
## Technical Support
For questions or issues, please refer to the TradingView community or contact the indicator creator.
## 技术支持
如有问题,请参考TradingView社区或联系指标创建者。
## English Documentation
### Overview
Scout Regiment - OBV (On-Balance Volume) is an advanced momentum indicator that combines volume and price movement to identify the strength of buying and selling pressure. This indicator features an oscillator-based approach with divergence detection to help traders spot potential trend reversals and confirm price movements.
### What is OBV?
On-Balance Volume (OBV) is a cumulative volume indicator that adds volume on up days and subtracts volume on down days:
- **Rising OBV**: Accumulation (buying pressure)
- **Falling OBV**: Distribution (selling pressure)
- **OBV Oscillator**: The difference between OBV and its smoothed moving average, making divergences easier to spot
### Key Features
#### 1. **OBV Oscillator Display**
Instead of displaying raw OBV values, this indicator shows the oscillator (difference between OBV and its smoothed line):
**Benefits:**
- Easier to identify divergences
- Clearer trend changes
- More sensitive to momentum shifts
- Zero line as reference point
**Visual Elements:**
- **Step Line**: Main OBV oscillator line
- Green: Positive oscillator (accumulation)
- Red: Negative oscillator (distribution)
- **Histogram**: Visual representation of oscillator strength
- Green bars: Above zero line
- Red bars: Below zero line
- **Zero Line**: White dotted horizontal line as reference
#### 2. **Smoothing Options**
Choose from multiple moving average types to smooth the OBV:
- **None**: Raw OBV (most sensitive)
- **SMA**: Simple Moving Average (equal weight)
- **EMA**: Exponential Moving Average (recent price emphasis) - Default
- **SMMA (RMA)**: Smoothed Moving Average (very smooth)
- **WMA**: Weighted Moving Average (linear weight)
- **VWMA**: Volume Weighted Moving Average (volume emphasis)
**Default Settings:**
- Type: EMA
- Length: 21 periods
- Best for: Most market conditions
#### 3. **Multi-Timeframe Analysis**
- Calculate OBV on any timeframe
- View higher timeframe momentum on lower timeframe charts
- Align trades with larger timeframe volume trends
- Empty field = Current chart timeframe
#### 4. **Visual Enhancements**
**Background Color**
- Light green: Positive oscillator (bullish volume pressure)
- Light red: Negative oscillator (bearish volume pressure)
- Optional display for cleaner charts
**Crossover Labels**
- "突破" (Breakout): When oscillator crosses above zero
- "跌破" (Breakdown): When oscillator crosses below zero
- Indicates potential trend changes
- Can be toggled on/off
#### 5. **Comprehensive Divergence Detection**
The indicator automatically detects four types of divergences:
**Regular Bullish Divergence (Yellow)**
- **Price**: Makes lower lows
- **OBV**: Makes higher lows
- **Signal**: Potential upward reversal
- **Label**: "看涨" (Bullish)
- **Use**: Enter long positions
**Regular Bearish Divergence (Blue)**
- **Price**: Makes higher highs
- **OBV**: Makes lower highs
- **Signal**: Potential downward reversal
- **Label**: "看跌" (Bearish)
- **Use**: Enter short positions or exit longs
**Hidden Bullish Divergence (Light Yellow)**
- **Price**: Makes higher lows
- **OBV**: Makes lower lows
- **Signal**: Trend continuation (uptrend)
- **Label**: "隐藏看涨" (Hidden Bullish)
- **Use**: Add to long positions
**Hidden Bearish Divergence (Light Blue)**
- **Price**: Makes lower highs
- **OBV**: Makes higher highs
- **Signal**: Trend continuation (downtrend)
- **Label**: "隐藏看跌" (Hidden Bearish)
- **Use**: Add to short positions
#### 6. **Customizable Divergence Detection**
**Pivot Lookback Settings:**
- **Left Lookback**: Bars to the left of pivot (default: 5)
- **Right Lookback**: Bars to the right of pivot (default: 5)
- Determines how "extreme" a point must be to qualify as a pivot
**Range Settings:**
- **Maximum Range**: Maximum bars between pivots (default: 60)
- **Minimum Range**: Minimum bars between pivots (default: 5)
- Filters out too-close or too-distant divergences
**Display Options:**
- Toggle regular divergences on/off
- Toggle hidden divergences on/off
- Toggle divergence labels on/off
- Show only the divergences you need
### Configuration Settings
#### Smoothing Settings
- **Smoothing Type**: Choose MA type (None/SMA/EMA/SMMA/WMA/VWMA)
- **Smoothing Length**: Number of periods for smoothing (default: 21)
#### Calculation Settings
- **Timeframe**: Select calculation timeframe (empty = current chart)
#### Display Settings
- **Show OBV Line**: Toggle step line display
- **Show OBV Histogram**: Toggle histogram display
- **Show Background Color**: Toggle background coloring
- **Show Crossover Labels**: Toggle breakout/breakdown labels
#### Divergence Settings
- **Pivot Right Lookback**: Right bars for pivot detection (default: 5)
- **Pivot Left Lookback**: Left bars for pivot detection (default: 5)
- **Range Maximum**: Max bars between divergences (default: 60)
- **Range Minimum**: Min bars between divergences (default: 5)
- **Show Regular Divergences**: Enable/disable regular divergences
- **Show Regular Labels**: Enable/disable regular divergence labels
- **Show Hidden Divergences**: Enable/disable hidden divergences
- **Show Hidden Labels**: Enable/disable hidden divergence labels
### How to Use
#### For Trend Confirmation
1. **Identify Trend with Price**
- Uptrend: Higher highs and higher lows
- Downtrend: Lower highs and lower lows
2. **Confirm with OBV Oscillator**
- Strong uptrend: OBV oscillator staying positive
- Strong downtrend: OBV oscillator staying negative
- Weak trend: OBV oscillator frequently crossing zero
3. **Volume Confirmation**
- Trend with increasing OBV = Strong trend
- Trend with decreasing OBV = Weak trend (watch for reversal)
#### For Divergence Trading
1. **Enable Divergence Detection**
- Start with regular divergences only
- Add hidden divergences for trend continuation
2. **Wait for Divergence Signal**
- Yellow label = Potential bullish reversal
- Blue label = Potential bearish reversal
3. **Confirm with Price Action**
- Wait for support/resistance break
- Look for candlestick confirmation
- Check higher timeframe alignment
4. **Enter Trade**
- Enter after confirmation
- Set stop loss beyond recent swing
- Target based on previous swing or support/resistance
#### For Breakout Trading
1. **Enable Crossover Labels**
- Identify when oscillator crosses zero line
2. **Confirm Volume Strength**
- Strong breakouts have large oscillator moves
- Weak breakouts barely cross zero
3. **Trade Direction**
- "突破" label = Enter long
- "跌破" label = Enter short
4. **Manage Position**
- Exit when oscillator crosses back
- Use price structure for stops
#### For Multi-Timeframe Analysis
1. **Set Higher Timeframe**
- Example: On 15min chart, set timeframe to 1H or 4H
2. **Identify Higher Timeframe Trend**
- Positive oscillator = Uptrend bias
- Negative oscillator = Downtrend bias
3. **Trade with the Trend**
- Only take long signals in uptrend
- Only take short signals in downtrend
4. **Time Entries**
- Use current timeframe for precise entry
- Confirm with higher timeframe direction
### Trading Strategies
#### Strategy 1: Regular Divergence Reversal
**Setup:**
1. Price in strong trend (up or down)
2. Regular divergence appears
3. Price reaches support/resistance level
**Entry:**
- Bullish: After "看涨" label, when price breaks above recent high
- Bearish: After "看跌" label, when price breaks below recent low
**Stop Loss:**
- Bullish: Below divergence low
- Bearish: Above divergence high
**Exit:**
- Take profit at next major support/resistance
- Or when opposite divergence appears
**Best For:** Swing trading, reversal trading
#### Strategy 2: Hidden Divergence Continuation
**Setup:**
1. Clear trend established
2. Price pulls back (retracement)
3. Hidden divergence appears
**Entry:**
- Bullish: After "隐藏看涨" label, when price resumes uptrend
- Bearish: After "隐藏看跌" label, when price resumes downtrend
**Stop Loss:**
- Behind the pullback swing point
**Exit:**
- Trail stop as trend continues
- Exit on regular divergence (reversal signal)
**Best For:** Trend following, adding to positions
#### Strategy 3: Zero Line Crossover
**Setup:**
1. Enable crossover labels
2. Oscillator crosses zero line
3. Confirm with price structure break
**Entry:**
- "突破" label = Buy signal
- "跌破" label = Sell signal
**Stop Loss:**
- Below/above recent swing
**Exit:**
- When oscillator crosses back over zero
- Or at predetermined target
**Best For:** Momentum trading, quick trades
#### Strategy 4: Multi-Timeframe Confluence
**Setup:**
1. Set indicator to higher timeframe (e.g., 4H on 1H chart)
2. Wait for higher TF oscillator to be positive (uptrend) or negative (downtrend)
3. Look for entries on current timeframe aligned with higher TF
**Entry:**
- Long: When both timeframes show positive oscillator or bullish divergence
- Short: When both timeframes show negative oscillator or bearish divergence
**Stop Loss:**
- Based on current timeframe structure
**Exit:**
- When higher timeframe oscillator turns negative (for longs) or positive (for shorts)
**Best For:** Swing trading, high-probability setups
### Best Practices
#### Volume Analysis
1. **Strong Moves Need Volume**
- Price increase + Rising OBV = Healthy uptrend
- Price increase + Falling OBV = Weak uptrend (warning)
2. **Watch for Confirmation**
- New highs with new OBV highs = Confirmed
- New highs without new OBV highs = Potential divergence
3. **Consider Context**
- Low volume periods (Asian session, holidays) = Less reliable
- High volume periods (News, London/NY overlap) = More reliable
#### Divergence Trading Tips
1. **Not All Divergences Work**
- Wait for price confirmation
- Stronger in oversold/overbought areas
- Better at support/resistance levels
2. **Multiple Divergences**
- Multiple divergences on same trend = Stronger signal
- Quick divergence failures = Ignore and wait for next
3. **Timeframe Matters**
- Higher timeframe divergences = More reliable
- Lower timeframe divergences = More frequent, less reliable
#### Smoothing Selection
1. **No Smoothing (None)**
- Most sensitive, more signals
- More noise, more false signals
- Best for: Scalping, very active trading
2. **EMA (Default)**
- Balanced approach
- Good for most strategies
- Best for: Swing trading, day trading
3. **SMMA (RMA)**
- Very smooth, fewer signals
- Less responsive to sudden changes
- Best for: Position trading, longer timeframes
### Indicator Combinations
**With Moving Averages:**
- Use EMAs for trend direction
- OBV for volume confirmation
- Enter when both align
**With RSI:**
- RSI for overbought/oversold
- OBV for volume confirmation
- Divergences on both = Stronger signal
**With Price Action:**
- Support/resistance for levels
- OBV for strength confirmation
- Breakouts with positive OBV = More likely to succeed
**With Bias Indicator:**
- Bias for price deviation
- OBV for volume confirmation
- Both showing divergence = High probability reversal
### Common Patterns
1. **Accumulation**: OBV rising while price consolidates (breakout likely)
2. **Distribution**: OBV falling while price consolidates (breakdown likely)
3. **Confirmation**: OBV and price both making new highs/lows (trend strong)
4. **Divergence**: OBV and price moving opposite directions (reversal warning)
5. **False Breakout**: Price breaks but OBV doesn't confirm (likely to fail)
### Performance Tips
- Disable unused display features for faster loading
- Start with regular divergences only, add hidden later
- Use histogram for quick visual reference
- Enable crossover labels for clear entry signals
- Test different smoothing lengths for your market
### Alert Conditions
The indicator includes alerts for:
- Regular bullish divergence detected
- Regular bearish divergence detected
- Hidden bullish divergence detected
- Hidden bearish divergence detected
**How to Set Alerts:**
1. Click on the indicator name
2. Select "Add Alert"
3. Choose condition
4. Configure notification method
---
## 中文说明文档
### 概述
Scout Regiment - OBV(能量潮)是一个高级动量指标,结合成交量和价格变动来识别买卖压力的强度。该指标采用振荡器方法并具有背离检测功能,帮助交易者发现潜在的趋势反转并确认价格走势。
### 什么是OBV?
能量潮(OBV)是一个累积成交量指标,在上涨日累加成交量,在下跌日减去成交量:
- **上升的OBV**:积累(买入压力)
- **下降的OBV**:派发(卖出压力)
- **OBV振荡器**:OBV与其平滑移动平均线之间的差值,使背离更容易识别
### 核心功能
#### 1. **OBV振荡器显示**
该指标不显示原始OBV值,而是显示振荡器(OBV与其平滑线之间的差值):
**优势:**
- 更容易识别背离
- 趋势变化更清晰
- 对动量变化更敏感
- 零线作为参考点
**视觉元素:**
- **阶梯线**:主OBV振荡器线
- 绿色:正振荡器(积累)
- 红色:负振荡器(派发)
- **柱状图**:振荡器强度的可视化表示
- 绿色柱:零线以上
- 红色柱:零线以下
- **零线**:白色虚线作为参考
#### 2. **平滑选项**
选择多种移动平均类型来平滑OBV:
- **None**:原始OBV(最敏感)
- **SMA**:简单移动平均(等权重)
- **EMA**:指数移动平均(强调近期价格)- 默认
- **SMMA (RMA)**:平滑移动平均(非常平滑)
- **WMA**:加权移动平均(线性权重)
- **VWMA**:成交量加权移动平均(强调成交量)
**默认设置:**
- 类型:EMA
- 长度:21周期
- 适合:大多数市场状况
#### 3. **多时间框架分析**
- 在任何时间框架上计算OBV
- 在低时间框架图表上查看高时间框架动量
- 使交易与更大时间框架的成交量趋势保持一致
- 空字段 = 当前图表时间框架
#### 4. **视觉增强**
**背景颜色**
- 浅绿色:正振荡器(看涨成交量压力)
- 浅红色:负振荡器(看跌成交量压力)
- 可选显示,图表更清爽
**穿越标签**
- "突破":振荡器向上穿越零线
- "跌破":振荡器向下穿越零线
- 指示潜在趋势变化
- 可开关
#### 5. **全面的背离检测**
指标自动检测四种类型的背离:
**常规看涨背离(黄色)**
- **价格**:创新低
- **OBV**:创更高的低点
- **信号**:潜在向上反转
- **标签**:"看涨"
- **用途**:进入多头仓位
**常规看跌背离(蓝色)**
- **价格**:创新高
- **OBV**:创更低的高点
- **信号**:潜在向下反转
- **标签**:"看跌"
- **用途**:进入空头仓位或退出多头
**隐藏看涨背离(浅黄色)**
- **价格**:创更高的低点
- **OBV**:创更低的低点
- **信号**:趋势延续(上升趋势)
- **标签**:"隐藏看涨"
- **用途**:加仓多头
**隐藏看跌背离(浅蓝色)**
- **价格**:创更低的高点
- **OBV**:创更高的高点
- **信号**:趋势延续(下降趋势)
- **标签**:"隐藏看跌"
- **用途**:加仓空头
#### 6. **可自定义的背离检测**
**枢轴回溯设置:**
- **左侧回溯**:枢轴点左侧K线数(默认:5)
- **右侧回溯**:枢轴点右侧K线数(默认:5)
- 决定一个点要多"极端"才能成为枢轴点
**范围设置:**
- **最大范围**:枢轴点之间最大K线数(默认:60)
- **最小范围**:枢轴点之间最小K线数(默认:5)
- 过滤太近或太远的背离
**显示选项:**
- 开关常规背离
- 开关隐藏背离
- 开关背离标签
- 只显示需要的背离
### 配置设置
#### 平滑设置
- **平滑类型**:选择MA类型(None/SMA/EMA/SMMA/WMA/VWMA)
- **平滑长度**:平滑周期数(默认:21)
#### 计算设置
- **时间周期**:选择计算时间框架(空 = 当前图表)
#### 显示设置
- **显示OBV点线**:切换阶梯线显示
- **显示OBV柱状图**:切换柱状图显示
- **显示背景颜色**:切换背景着色
- **显示突破标签**:切换突破/跌破标签
#### 背离设置
- **枢轴右侧回溯**:枢轴检测右侧K线数(默认:5)
- **枢轴左侧回溯**:枢轴检测左侧K线数(默认:5)
- **回看范围最大值**:背离之间最大K线数(默认:60)
- **回看范围最小值**:背离之间最小K线数(默认:5)
- **显示常规背离**:启用/禁用常规背离
- **显示常规背离标签**:启用/禁用常规背离标签
- **显示隐藏背离**:启用/禁用隐藏背离
- **显示隐藏背离标签**:启用/禁用隐藏背离标签
### 使用方法
#### 趋势确认
1. **用价格识别趋势**
- 上升趋势:更高的高点和更高的低点
- 下降趋势:更低的高点和更低的低点
2. **用OBV振荡器确认**
- 强劲上升趋势:OBV振荡器保持正值
- 强劲下降趋势:OBV振荡器保持负值
- 弱势趋势:OBV振荡器频繁穿越零线
3. **成交量确认**
- 趋势伴随上升的OBV = 强趋势
- 趋势伴随下降的OBV = 弱趋势(注意反转)
#### 背离交易
1. **启用背离检测**
- 先从常规背离开始
- 添加隐藏背离用于趋势延续
2. **等待背离信号**
- 黄色标签 = 潜在看涨反转
- 蓝色标签 = 潜在看跌反转
3. **用价格行为确认**
- 等待支撑/阻力突破
- 寻找K线确认
- 检查更高时间框架对齐
4. **进入交易**
- 确认后进入
- 在近期波动之外设置止损
- 基于前一波动或支撑/阻力设定目标
#### 突破交易
1. **启用穿越标签**
- 识别振荡器何时穿越零线
2. **确认成交量强度**
- 强突破有大振荡器移动
- 弱突破勉强穿越零线
3. **交易方向**
- "突破"标签 = 进入多头
- "跌破"标签 = 进入空头
4. **管理仓位**
- 振荡器反向穿越时退出
- 使用价格结构设置止损
#### 多时间框架分析
1. **设置更高时间框架**
- 例如:在15分钟图上,设置时间框架为1H或4H
2. **识别更高时间框架趋势**
- 正振荡器 = 上升趋势偏向
- 负振荡器 = 下降趋势偏向
3. **顺趋势交易**
- 仅在上升趋势中接受多头信号
- 仅在下降趋势中接受空头信号
4. **把握入场时机**
- 使用当前时间框架进行精确进入
- 用更高时间框架方向确认
### 交易策略
#### 策略1:常规背离反转
**设置:**
1. 价格处于强趋势(上涨或下跌)
2. 出现常规背离
3. 价格到达支撑/阻力水平
**入场:**
- 看涨:在"看涨"标签后,价格突破近期高点时
- 看跌:在"看跌"标签后,价格跌破近期低点时
**止损:**
- 看涨:背离低点之下
- 看跌:背离高点之上
**退出:**
- 在下一个主要支撑/阻力获利
- 或出现相反背离时
**适合:**波段交易、反转交易
#### 策略2:隐藏背离延续
**设置:**
1. 建立明确趋势
2. 价格回调(回撤)
3. 出现隐藏背离
**入场:**
- 看涨:在"隐藏看涨"标签后,价格恢复上升趋势时
- 看跌:在"隐藏看跌"标签后,价格恢复下降趋势时
**止损:**
- 在回调波动点之后
**退出:**
- 随着趋势延续移动止损
- 出现常规背离(反转信号)时退出
**适合:**趋势跟随、加仓
#### 策略3:零线穿越
**设置:**
1. 启用穿越标签
2. 振荡器穿越零线
3. 用价格结构突破确认
**入场:**
- "突破"标签 = 买入信号
- "跌破"标签 = 卖出信号
**止损:**
- 近期波动之下/之上
**退出:**
- 振荡器反向穿越零线时
- 或在预定目标
**适合:**动量交易、快速交易
#### 策略4:多时间框架汇合
**设置:**
1. 设置指标到更高时间框架(例如,在1H图上设置4H)
2. 等待更高TF振荡器为正(上升趋势)或负(下降趋势)
3. 在当前时间框架上寻找与更高TF一致的入场机会
**入场:**
- 多头:两个时间框架都显示正振荡器或看涨背离时
- 空头:两个时间框架都显示负振荡器或看跌背离时
**止损:**
- 基于当前时间框架结构
**退出:**
- 更高时间框架振荡器变为负(多头)或正(空头)时
**适合:**波段交易、高概率设置
### 最佳实践
#### 成交量分析
1. **强势波动需要成交量**
- 价格上涨 + 上升的OBV = 健康上升趋势
- 价格上涨 + 下降的OBV = 弱上升趋势(警告)
2. **注意确认**
- 新高伴随新OBV高点 = 已确认
- 新高没有新OBV高点 = 潜在背离
3. **考虑背景**
- 低成交量期(亚洲时段、假期)= 可靠性较低
- 高成交量期(新闻、伦敦/纽约重叠)= 更可靠
#### 背离交易技巧
1. **不是所有背离都有效**
- 等待价格确认
- 在超卖/超买区域更强
- 在支撑/阻力水平更好
2. **多重背离**
- 同一趋势上多个背离 = 更强信号
- 背离快速失败 = 忽略并等待下一个
3. **时间框架重要**
- 更高时间框架背离 = 更可靠
- 更低时间框架背离 = 更频繁,可靠性较低
#### 平滑选择
1. **无平滑(None)**
- 最敏感,更多信号
- 更多噪音,更多假信号
- 适合:剥头皮、非常活跃的交易
2. **EMA(默认)**
- 平衡方法
- 适合大多数策略
- 适合:波段交易、日内交易
3. **SMMA (RMA)**
- 非常平滑,更少信号
- 对突然变化响应较慢
- 适合:仓位交易、更长时间框架
### 指标组合
**与移动平均线配合:**
- 使用EMA确定趋势方向
- OBV确认成交量
- 两者一致时进入
**与RSI配合:**
- RSI用于超买超卖
- OBV用于成交量确认
- 两者都背离 = 更强信号
**与价格行为配合:**
- 支撑/阻力确定水平
- OBV确认强度
- 正OBV的突破 = 更可能成功
**与Bias指标配合:**
- Bias用于价格偏离
- OBV用于成交量确认
- 两者都显示背离 = 高概率反转
### 常见形态
1. **积累**:OBV上升而价格盘整(突破可能)
2. **派发**:OBV下降而价格盘整(跌破可能)
3. **确认**:OBV和价格都创新高/新低(趋势强劲)
4. **背离**:OBV和价格反向移动(反转警告)
5. **假突破**:价格突破但OBV不确认(可能失败)
### 性能提示
- 禁用未使用的显示功能以加快加载
- 先从常规背离开始,稍后添加隐藏背离
- 使用柱状图快速视觉参考
- 启用穿越标签以获得清晰的入场信号
- 为您的市场测试不同的平滑长度
### 警报条件
指标包含以下警报:
- 检测到常规看涨背离
- 检测到常规看跌背离
- 检测到隐藏看涨背离
- 检测到隐藏看跌背离
**如何设置警报:**
1. 点击指标名称
2. 选择"添加警报"
3. 选择条件
4. 配置通知方法
---
## Technical Support
For questions or issues, please refer to the TradingView community or contact the indicator creator.
## 技术支持
如有问题,请参考TradingView社区或联系指标创建者。
Script de código abierto
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Exención de responsabilidad
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
Script de código abierto
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Exención de responsabilidad
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.