在腳本中搜尋"股价站上60月线"
Emre AOI Zonen Daily & Weekly (mit Alerts, max 60 Pips)This TradingView indicator automatically highlights Areas of Interest (AOI) for Forex or other markets on Daily and Weekly timeframes. It identifies zones based on the high and low of the previous period, but only includes zones with a width of 60 pips or less.
Features:
Daily AOI Zones in blue, Weekly AOI Zones in yellow with 20% opacity, so candlesticks remain visible.
Persistent zones: AOI boxes stay on the chart until the price breaks the zone.
Multiple zones: Supports storing multiple Daily and Weekly AOIs simultaneously.
Break Alerts: Sends alerts whenever a Daily or Weekly AOI is broken, helping traders spot key levels in real-time.
Fully automated: No manual drawing needed; zones are updated and extended automatically.
Use Case:
Ideal for traders using a top-down approach, combining Weekly trend analysis with Daily entry signals. Helps identify support/resistance, supply/demand zones, and critical price levels efficiently.
EMA band 12/60/150/200EMA band consisting of 12/60/150/200
Specifically for Indian stock market, can be used for other trading scripts after testing.
Best use case : on Daily TF.
Bull run entry criteria, Not bear market or Bottom catching.
15-Minute and 60-Minute ORB with Wicks15 and 60 minute ORBs for each trading day. Simple, yet effective.
EMA (10,20,60) + Bollinger BandsCombination of bollinger bands and exponential moving averages (10, 20, 60)
The coloring is optimized for dark background, and it is editable
This indicator combined 3 exponential moving average lines and bollinger bands . The EMA lines can be add or deleted in pine editor, and its parameters can be changed too. Same to the bollinger bands . Defaulted value for BB is 20SMA with 2 standard deviations.
Useful as a supplmentary indicators
EMA30,60,100 EMA 30 (orange),60(red),100(green)
Bullish: green below the other two
Bearish: green above other two
when lines cross, no clear trend.
When Price touches the orange = entry point
Thanks to CFXtrader for the basic script
[STRATEGY]EMA 30/60 Cross Strategystrategy based on EMA 30/60 cross
works best on 4hr timeframes & high-midcaps
120/60 Trend ModelCombination of 120 & 60 EMAs used to determine entries as well as the over all trend.
Guppy MMA 3, 5, 8, 10, 12, 15 and 30, 35, 40, 45, 50, 60Guppy Multiple Moving Average
Short Term EMA 3, 5, 8, 10, 12, 15
Long Term EMA 30, 35, 40, 45, 50, 60
Use for SFTS Class
Scout Regiment - MACD# Scout Regiment - MACD Indicator
## English Documentation
### Overview
Scout Regiment - MACD is an advanced implementation of the Moving Average Convergence Divergence indicator with enhanced features including dual divergence detection (histogram and MACD line), customizable moving average types, multi-timeframe analysis, and sophisticated visual elements. This indicator provides traders with comprehensive momentum analysis and high-probability reversal signals.
### What is MACD?
MACD (Moving Average Convergence Divergence) is a trend-following momentum indicator that shows the relationship between two moving averages:
- **MACD Line**: Difference between fast and slow EMAs
- **Signal Line**: Moving average of the MACD line
- **Histogram**: Difference between MACD line and signal line
- **Purpose**: Identifies trend direction, momentum strength, and potential reversals
### Key Features
#### 1. **Enhanced MACD Display**
**Three Core Components:**
**MACD Line** (Default: Blue/Orange, 2px)
- Fast EMA (13) minus Slow EMA (34)
- Shows momentum direction
- Color changes based on position relative to signal line:
- Blue: Above signal line (bullish)
- Orange: Below signal line (bearish)
- Can be toggled on/off
**Signal Line** (Default: White/Blue with transparency, 2px)
- EMA (9) of the MACD line
- Serves as trigger line for crossover signals
- Color varies based on settings
- Essential for identifying entry/exit points
**Histogram** (Default: 4-color gradient, 4px columns)
- Difference between MACD and signal line
- Visual representation of momentum strength
- Advanced 4-color scheme:
- **Dark Green (#26A69A)**: Positive and increasing (strong bullish)
- **Light Green (#B2DFDB)**: Positive but decreasing (weakening bullish)
- **Dark Red (#FF5252)**: Negative and decreasing (strong bearish)
- **Light Red (#FFCDD2)**: Negative but increasing (weakening bearish)
- Histogram tells the "story" of momentum changes
#### 2. **Customizable Moving Average Types**
**Oscillator MA Type** (MACD Line calculation):
- **EMA** (Exponential) - Default, more responsive
- **SMA** (Simple) - Smoother, less responsive
**Signal Line MA Type**:
- **EMA** (Exponential) - Default, faster signals
- **SMA** (Simple) - Slower, fewer false signals
**Flexibility**: Mix and match for different trading styles
- EMA/EMA: Most responsive (day trading)
- SMA/SMA: Smoothest (swing trading)
- EMA/SMA or SMA/EMA: Balanced approaches
#### 3. **Multi-Timeframe Capability**
**Current Chart Period** (Default: Enabled)
- Uses current timeframe automatically
- Simplest option for most traders
**Custom Timeframe Selection**
- Calculate MACD on any timeframe
- Display higher timeframe MACD on lower timeframe charts
- Example: View 1H MACD on 15min chart
- **Use Case**: Align lower timeframe trades with higher timeframe momentum
#### 4. **Visual Enhancement Features**
**Golden Cross / Death Cross Markers**
- Circles mark crossover points
- Color matches MACD line color
- Clearly identifies entry/exit signals
- Can be toggled on/off
**Zero Line** (White, 2px solid)
- Reference for positive/negative momentum
- Critical level for trend identification
- MACD above zero = Bullish bias
- MACD below zero = Bearish bias
**Color Transitions**
- MACD line changes color at signal line crosses
- Histogram shows momentum acceleration/deceleration
- Provides early warning of trend changes
#### 5. **Dual Divergence Detection System**
This indicator features TWO separate divergence detection systems:
**A. Histogram Divergence Detection**
- **Purpose**: Earlier divergence signals (most sensitive)
- **Detects**: Regular bullish and bearish divergences
- **Label**: "H涨" (Histogram Up), "H跌" (Histogram Down)
- **Special Feature**: Same-sign requirement option
- Top divergence: Both histogram points must be positive
- Bottom divergence: Both histogram points must be negative
- Filters out less reliable divergences
**B. MACD Line Divergence Detection**
- **Purpose**: Stronger, more reliable divergences
- **Detects**: Regular bullish and bearish divergences
- **Label**: "M涨" (MACD Up), "M跌" (MACD Down)
- **Use**: Confirmation of histogram divergences or standalone
**Divergence Types Explained:**
**Regular Bullish Divergence (Yellow)**
- **Price**: Lower lows
- **Indicator**: Higher lows (histogram OR MACD line)
- **Signal**: Potential upward reversal
- **Best**: Near support levels, oversold conditions
- **Entry**: After price breaks above recent resistance
**Regular Bearish Divergence (Blue)**
- **Price**: Higher highs
- **Indicator**: Lower highs (histogram OR MACD line)
- **Signal**: Potential downward reversal
- **Best**: Near resistance levels, overbought conditions
- **Entry**: After price breaks below recent support
#### 6. **Advanced Divergence Parameters**
**Histogram Divergence Settings:**
- **Price Reference**: Wicks (default) or Bodies
- **Right Lookback**: Bars to right of pivot (default: 2)
- **Left Lookback**: Bars to left of pivot (default: 5)
- **Max Range**: Maximum bars between divergences (default: 60)
- **Min Range**: Minimum bars between divergences (default: 5)
- **Same Sign Requirement**: Ensures both histogram points have same sign
- **Show Regular Divergence**: Toggle display
- **Show Labels**: Toggle divergence labels
**MACD Line Divergence Settings:**
- **Price Reference**: Wicks (default) or Bodies
- **Right Lookback**: Bars to right of pivot (default: 1)
- **Left Lookback**: Bars to left of pivot (default: 5)
- **Max Range**: Maximum bars between divergences (default: 60)
- **Min Range**: Minimum bars between divergences (default: 5)
- **Show Regular Divergence**: Toggle display
- **Show Labels**: Toggle divergence labels
**Independent Control**: Adjust histogram and MACD line divergences separately
### Configuration Settings
#### MACD Basic Settings
- **Fast EMA Period**: Fast moving average length (default: 13)
- **Slow EMA Period**: Slow moving average length (default: 34)
- **Signal Line Period**: Signal line length (default: 9)
- **Use Current Chart Period**: Auto-adjust to current timeframe
- **Select Period**: Choose custom timeframe
- **Show MACD & Signal Lines**: Toggle lines display
- **Show Cross Markers**: Toggle golden/death cross dots
- **Show Histogram**: Toggle histogram display
- **Show Crossover Color Change**: Enable MACD line color change
- **Show Histogram Colors**: Enable 4-color histogram scheme
- **Oscillator MA Type**: Choose SMA or EMA for MACD
- **Signal Line MA Type**: Choose SMA or EMA for signal
#### Histogram Divergence Settings
- **Show Histogram Divergence**: Enable histogram divergence detection
- **Price Reference**: Wicks or Bodies for price comparison
- **Right/Left Lookback**: Pivot detection parameters
- **Max/Min Range**: Distance constraints between pivots
- **Show Regular Divergence**: Display histogram divergence lines
- **Show Labels**: Display histogram divergence labels
- **Require Same Sign**: Enforce histogram sign consistency
#### MACD Line Divergence Settings
- **Show MACD Line Divergence**: Enable MACD line divergence detection
- **Price Reference**: Wicks or Bodies for price comparison
- **Right/Left Lookback**: Pivot detection parameters
- **Max/Min Range**: Distance constraints between pivots
- **Show Regular Divergence**: Display MACD line divergence lines
- **Show Labels**: Display MACD line divergence labels
### How to Use
#### For Basic Trend Following
1. **Enable Core Components**
- MACD line, signal line, and histogram
- Enable cross markers
2. **Identify Trend**
- MACD above zero = Uptrend
- MACD below zero = Downtrend
3. **Watch for Crossovers**
- Golden cross (MACD crosses above signal) = Buy signal
- Death cross (MACD crosses below signal) = Sell signal
4. **Confirm with Histogram**
- Increasing histogram = Strengthening trend
- Decreasing histogram = Weakening trend
#### For Divergence Trading
1. **Enable Both Divergence Systems**
- Histogram divergence (early signals)
- MACD line divergence (confirmation)
2. **Wait for Divergence Signals**
- "H涨" or "H跌" = Early warning
- "M涨" or "M跌" = Confirmation
3. **Best Divergences**
- Both histogram AND MACD line showing divergence
- Divergence at key support/resistance levels
- Multiple divergences on same trend
4. **Entry Timing**
- Wait for price structure break
- Enter on pullback after confirmation
- Use MACD crossover as trigger
#### For Multi-Timeframe Analysis
1. **Set Higher Timeframe**
- Example: 4H MACD on 1H chart
- Uncheck "Use Current Chart Period"
- Select desired timeframe
2. **Identify Higher TF Trend**
- MACD position relative to zero
- MACD vs signal line relationship
3. **Trade with HTF Direction**
- Only take long signals if HTF MACD bullish
- Only take short signals if HTF MACD bearish
4. **Use Current TF for Entries**
- Higher TF for bias
- Current TF for precise timing
#### For Histogram Analysis
1. **Enable 4-Color Histogram**
- Watch color transitions
- Dark colors = Strong momentum
- Light colors = Weakening momentum
2. **Momentum Stages**
- Dark green → Light green = Bullish losing steam
- Light red → Dark red = Bearish gaining strength
3. **Trade Transitions**
- Light green to light red = Momentum shift (potential reversal)
- Entry on confirmation crossover
### Trading Strategies
#### Strategy 1: Classic MACD Crossover
**Setup:**
- Standard settings (13/34/9)
- Enable MACD, signal line, and cross markers
- Clear trend on higher timeframe
**Entry:**
- **Long**: Golden cross (circle marker) above zero line
- **Short**: Death cross (circle marker) below zero line
**Confirmation:**
- Histogram color supporting direction
- Volume increase helps
**Stop Loss:**
- Below recent swing low (long)
- Above recent swing high (short)
**Exit:**
- Opposite crossover
- MACD crosses zero line against position
**Best For:** Trend following, clear trending markets
#### Strategy 2: Zero Line Bounce
**Setup:**
- Enable all components
- Established trend (MACD staying one side of zero)
- Wait for pullback to zero line
**Entry:**
- **Long**: MACD touches zero from above, bounces up with golden cross
- **Short**: MACD touches zero from below, bounces down with death cross
**Confirmation:**
- Histogram color change
- Price at support/resistance
**Stop Loss:**
- Just beyond zero line (opposite side)
**Exit:**
- Target previous extreme
- Or opposite crossover
**Best For:** Trend continuation, strong markets
#### Strategy 3: Dual Divergence Confirmation
**Setup:**
- Enable both histogram and MACD line divergences
- Price at extreme (high/low)
- Wait for divergence signals
**Entry:**
- **Long**: Both "H涨" AND "M涨" labels appear
- **Short**: Both "H跌" AND "M跌" labels appear
**Confirmation:**
- Price breaks structure
- Volume increase
- Golden/death cross confirms
**Stop Loss:**
- Beyond divergence pivot point
**Exit:**
- MACD crosses zero line
- Or opposite divergence appears
**Best For:** Reversal trading, swing trading
#### Strategy 4: Histogram Color Transition
**Setup:**
- Enable 4-color histogram
- Focus on color changes
- Price in trend
**Entry:**
- **Long**: Light red → Light green transition + golden cross
- **Short**: Light green → Light red transition + death cross
**Rationale:**
- Light colors show momentum exhaustion
- Color flip = momentum shift
- Early entry before full trend reversal
**Stop Loss:**
- Recent swing point
**Exit:**
- Histogram color turns light against position
- Or at predetermined target
**Best For:** Scalping, day trading, early entries
#### Strategy 5: Multi-Timeframe Momentum
**Setup:**
- Display higher timeframe MACD (e.g., 4H on 1H chart)
- Current chart shows current momentum
- Higher TF shows overall bias
**Entry:**
- **Long**: HTF MACD above zero + current TF golden cross
- **Short**: HTF MACD below zero + current TF death cross
**Confirmation:**
- HTF histogram supporting direction
- Both timeframes aligned
**Stop Loss:**
- Based on current timeframe structure
**Exit:**
- Current TF opposite crossover
- Or HTF MACD momentum weakens
**Best For:** Swing trading, high-probability setups
#### Strategy 6: Histogram-Only Divergence Scout
**Setup:**
- Enable only histogram divergence
- Use "same sign requirement"
- Focus on early signals
**Entry:**
- **Long**: "H涨" label + price at support
- **Short**: "H跌" label + price at resistance
**Confirmation:**
- Wait for MACD/signal crossover
- Or price structure break
**Advantage:**
- Earliest divergence signals
- Get in before crowd
**Risk:**
- More false signals than MACD line divergence
- Requires strict confirmation
**Stop Loss:**
- Tight stop beyond entry bar
**Exit:**
- Quick targets (30-50% of expected move)
- Or trail stop
**Best For:** Active traders, scalpers seeking early entries
### Best Practices
#### MACD Period Selection
**Standard (13/34/9)** - Default
- Balanced for most markets
- Good for day trading and swing trading
- Widely used, works with general market psychology
**Faster (8/21/5 or 12/26/9)**
- More responsive
- More signals, more noise
- Best for: Scalping, volatile markets
- Risk: More false signals
**Slower (21/55/13)**
- Smoother signals
- Fewer but stronger signals
- Best for: Swing trading, position trading
- Benefit: Higher reliability
#### Histogram vs MACD Line Divergences
**Histogram Divergence:**
- ✅ Earlier signals
- ✅ Catch moves before others
- ❌ More false signals
- ❌ Requires confirmation
- **Best for**: Active traders, scalpers
**MACD Line Divergence:**
- ✅ More reliable
- ✅ Stronger divergences
- ❌ Later signals
- ❌ May miss early moves
- **Best for**: Swing traders, conservative traders
**Both Together:**
- ✅ Maximum confidence
- ✅ Histogram for alert, MACD for confirmation
- ✅ Highest probability setups
- **Best for**: All traders seeking quality over quantity
#### Same Sign Requirement Feature
**Enabled (Recommended):**
- Filters low-quality divergences
- Top divergence: Both histogram points positive
- Bottom divergence: Both histogram points negative
- Results in fewer but more reliable signals
**Disabled:**
- More divergence signals
- Includes zero-line crossing divergences
- Higher false signal rate
- Only for experienced traders
#### Price Reference: Wicks vs Bodies
**Wicks (Default):**
- Uses high/low prices
- Catches all extremes
- More divergences detected
- Best for: Most trading styles
**Bodies:**
- Uses open/close prices
- Filters out spike movements
- Fewer but cleaner divergences
- Best for: Noisy markets, crypto
#### Visual Settings Recommendations
**For Beginners:**
- Enable: MACD line, signal line, histogram
- Enable: Cross markers
- Enable: Histogram colors
- Disable: Both divergence systems initially
- Focus: Learn basic crossovers first
**For Intermediate:**
- All basic components
- Add: Histogram divergence only
- Use: Same sign requirement
- Focus: Early reversal signals
**For Advanced:**
- All components
- Both divergence systems
- Custom parameters per market
- Multi-timeframe analysis
- Focus: High-probability confluence setups
### Indicator Combinations
**With Moving Averages (EMAs):**
- EMAs (21/55/144) show trend
- MACD shows momentum
- Enter when both align
- Exit when MACD turns first
**With RSI:**
- RSI for overbought/oversold
- MACD for momentum confirmation
- Divergence on both = Extremely strong signal
- RSI + MACD divergence = High probability trade
**With Volume:**
- Volume confirms MACD signals
- Crossover + volume spike = Valid breakout
- Divergence + volume divergence = Strong reversal
**With Support/Resistance:**
- S/R levels for entry/exit targets
- MACD divergence at levels = Highest probability
- MACD crossover at level = Strong confirmation
**With Bias Indicator:**
- Bias shows price deviation from EMA
- MACD shows momentum
- Both diverging = Powerful reversal signal
- Bias extreme + MACD divergence = High conviction trade
**With OBV:**
- OBV shows volume trend
- MACD shows price momentum
- OBV + MACD divergence = Volume not supporting price
- Strong reversal indication
**With KSI (RSI/CCI):**
- KSI for oscillator extremes
- MACD for momentum direction
- KSI extreme + MACD divergence = Reversal likely
- All aligned = Maximum confidence
### Common MACD Patterns
1. **Bullish Cross Above Zero**: Strong uptrend continuation signal
2. **Bearish Cross Below Zero**: Strong downtrend continuation signal
3. **Zero Line Rejection**: Price respects zero as support/resistance
4. **Histogram Peak**: Momentum climax, watch for reversal
5. **Double Divergence**: Two divergences without reversal = Very strong signal when it finally reverses
6. **Histogram Convergence**: Histogram narrowing = Trend losing steam
7. **Signal Line Hug**: MACD stays close to signal = Consolidation, expect breakout
### Performance Tips
- Start with default settings (13/34/9 EMA/EMA)
- Test one divergence system at a time
- Use same sign requirement initially
- Enable cross markers for clear signals
- Adjust lookback parameters per market volatility
- Higher timeframe MACD more reliable than lower
- Combine histogram early signal with MACD line confirmation
- Don't trade every divergence - wait for best setups
### Alert Conditions
While not explicitly coded, you can set custom alerts on:
- MACD crossing above/below signal line
- MACD crossing above/below zero line
- Histogram crossing zero
- When divergence labels appear (using visual alerts)
---
## 中文说明文档
### 概述
Scout Regiment - MACD 是移动平均线收敛发散指标的高级实现版本,具有增强功能,包括双重背离检测(直方图和MACD线)、可自定义的移动平均类型、多时间框架分析和复杂的视觉元素。该指标为交易者提供全面的动量分析和高概率反转信号。
### 什么是MACD?
MACD(移动平均线收敛发散)是一个趋势跟随动量指标,显示两条移动平均线之间的关系:
- **MACD线**:快速和慢速EMA之间的差值
- **信号线**:MACD线的移动平均
- **直方图**:MACD线和信号线之间的差值
- **用途**:识别趋势方向、动量强度和潜在反转
### 核心功能
#### 1. **增强的MACD显示**
**三个核心组件:**
**MACD线**(默认:蓝色/橙色,2像素)
- 快速EMA(13)减去慢速EMA(34)
- 显示动量方向
- 根据相对于信号线的位置改变颜色:
- 蓝色:信号线上方(看涨)
- 橙色:信号线下方(看跌)
- 可开关显示
**信号线**(默认:白色/蓝色带透明度,2像素)
- MACD线的EMA(9)
- 作为交叉信号的触发线
- 颜色根据设置变化
- 识别进出场点的关键
**直方图**(默认:4色渐变,4像素柱)
- MACD和信号线之间的差值
- 动量强度的视觉表示
- 高级4色方案:
- **深绿色(#26A69A)**:正值且增加(强劲看涨)
- **浅绿色(#B2DFDB)**:正值但减少(看涨减弱)
- **深红色(#FF5252)**:负值且减少(强劲看跌)
- **浅红色(#FFCDD2)**:负值但增加(看跌减弱)
- 直方图讲述动量变化的"故事"
#### 2. **可自定义的移动平均类型**
**振荡器MA类型**(MACD线计算):
- **EMA**(指数)- 默认,反应更快
- **SMA**(简单)- 更平滑,反应较慢
**信号线MA类型**:
- **EMA**(指数)- 默认,更快信号
- **SMA**(简单)- 更慢,假信号更少
**灵活性**:混合搭配以适应不同交易风格
- EMA/EMA:最灵敏(日内交易)
- SMA/SMA:最平滑(波段交易)
- EMA/SMA或SMA/EMA:平衡方法
#### 3. **多时间框架功能**
**当前图表周期**(默认:启用)
- 自动使用当前时间框架
- 大多数交易者的最简单选项
**自定义时间框架选择**
- 在任何时间框架上计算MACD
- 在低时间框架图表上显示高时间框架MACD
- 示例:在15分钟图上查看1小时MACD
- **使用场景**:使低时间框架交易与高时间框架动量保持一致
#### 4. **视觉增强功能**
**金叉/死叉标记**
- 圆点标记交叉点
- 颜色与MACD线颜色匹配
- 清晰识别进出场信号
- 可开关
**零线**(白色,2像素实线)
- 正负动量的参考
- 趋势识别的关键水平
- MACD在零线上方 = 看涨偏向
- MACD在零线下方 = 看跌偏向
**颜色转换**
- MACD线在信号线交叉处改变颜色
- 直方图显示动量加速/减速
- 提供趋势变化的早期警告
#### 5. **双重背离检测系统**
该指标具有两个独立的背离检测系统:
**A. 直方图背离检测**
- **用途**:更早的背离信号(最敏感)
- **检测**:常规看涨和看跌背离
- **标签**:"H涨"(直方图上涨)、"H跌"(直方图下跌)
- **特殊功能**:同符号要求选项
- 顶背离:两个直方图点都必须为正
- 底背离:两个直方图点都必须为负
- 过滤不太可靠的背离
**B. MACD线背离检测**
- **用途**:更强、更可靠的背离
- **检测**:常规看涨和看跌背离
- **标签**:"M涨"(MACD上涨)、"M跌"(MACD下跌)
- **用途**:确认直方图背离或独立使用
**背离类型说明:**
**常规看涨背离(黄色)**
- **价格**:更低的低点
- **指标**:更高的低点(直方图或MACD线)
- **信号**:潜在向上反转
- **最佳**:在支撑水平附近、超卖状况
- **入场**:价格突破近期阻力后
**常规看跌背离(蓝色)**
- **价格**:更高的高点
- **指标**:更低的高点(直方图或MACD线)
- **信号**:潜在向下反转
- **最佳**:在阻力水平附近、超买状况
- **入场**:价格跌破近期支撑后
#### 6. **高级背离参数**
**直方图背离设置:**
- **价格参考**:影线(默认)或实体
- **右侧回溯**:枢轴点右侧K线数(默认:2)
- **左侧回溯**:枢轴点左侧K线数(默认:5)
- **最大范围**:背离之间最大K线数(默认:60)
- **最小范围**:背离之间最小K线数(默认:5)
- **同符号要求**:确保两个直方图点符号相同
- **显示常规背离**:切换显示
- **显示标签**:切换背离标签
**MACD线背离设置:**
- **价格参考**:影线(默认)或实体
- **右侧回溯**:枢轴点右侧K线数(默认:1)
- **左侧回溯**:枢轴点左侧K线数(默认:5)
- **最大范围**:背离之间最大K线数(默认:60)
- **最小范围**:背离之间最小K线数(默认:5)
- **显示常规背离**:切换显示
- **显示标签**:切换背离标签
**独立控制**:分别调整直方图和MACD线背离
### 配置设置
#### MACD基础设置
- **快速EMA周期**:快速移动平均长度(默认:13)
- **慢速EMA周期**:慢速移动平均长度(默认:34)
- **信号线周期**:信号线长度(默认:9)
- **使用当前图表周期**:自动调整到当前时间框架
- **选择周期**:选择自定义时间框架
- **显示MACD线和信号线**:切换线条显示
- **显示金叉死叉圆点标记**:切换金叉/死叉圆点
- **显示直方图**:切换直方图显示
- **显示穿越变化MACD线**:启用MACD线颜色变化
- **显示直方图颜色**:启用4色直方图方案
- **振荡器MA类型**:为MACD选择SMA或EMA
- **信号线MA类型**:为信号线选择SMA或EMA
#### 直方图背离设置
- **显示直方图背离信号**:启用直方图背离检测
- **价格参考**:影线或实体用于价格比较
- **右侧/左侧回溯**:枢轴检测参数
- **最大/最小范围**:枢轴之间的距离约束
- **显示直方图常规背离**:显示直方图背离线
- **显示直方图常规背离标签**:显示直方图背离标签
- **要求背离点柱状图同符号**:强制直方图符号一致性
#### MACD线背离设置
- **显示MACD线背离信号**:启用MACD线背离检测
- **价格参考**:影线或实体用于价格比较
- **右侧/左侧回溯**:枢轴检测参数
- **最大/最小范围**:枢轴之间的距离约束
- **显示线常规背离**:显示MACD线背离线
- **显示线常规背离标签**:显示MACD线背离标签
### 使用方法
#### 基础趋势跟随
1. **启用核心组件**
- MACD线、信号线和直方图
- 启用交叉标记
2. **识别趋势**
- MACD在零线上方 = 上升趋势
- MACD在零线下方 = 下降趋势
3. **观察交叉**
- 金叉(MACD向上穿越信号线)= 买入信号
- 死叉(MACD向下穿越信号线)= 卖出信号
4. **用直方图确认**
- 直方图增加 = 趋势加强
- 直方图减少 = 趋势减弱
#### 背离交易
1. **启用两个背离系统**
- 直方图背离(早期信号)
- MACD线背离(确认)
2. **等待背离信号**
- "H涨"或"H跌" = 早期警告
- "M涨"或"M跌" = 确认
3. **最佳背离**
- 直方图和MACD线都显示背离
- 在关键支撑/阻力水平的背离
- 同一趋势上多个背离
4. **入场时机**
- 等待价格结构突破
- 确认后回调时进入
- 使用MACD交叉作为触发
#### 多时间框架分析
1. **设置更高时间框架**
- 示例:在1小时图上显示4小时MACD
- 取消勾选"使用当前图表周期"
- 选择所需时间框架
2. **识别更高TF趋势**
- MACD相对于零线的位置
- MACD与信号线的关系
3. **顺HTF方向交易**
- 仅在HTF MACD看涨时接受多头信号
- 仅在HTF MACD看跌时接受空头信号
4. **使用当前TF入场**
- 更高TF确定偏向
- 当前TF精确定时
#### 直方图分析
1. **启用4色直方图**
- 观察颜色转换
- 深色 = 强动量
- 浅色 = 动量减弱
2. **动量阶段**
- 深绿色→浅绿色 = 看涨失去动力
- 浅红色→深红色 = 看跌获得力量
3. **交易转换**
- 浅绿色到浅红色 = 动量转变(潜在反转)
- 确认交叉时入场
### 交易策略
#### 策略1:经典MACD交叉
**设置:**
- 标准设置(13/34/9)
- 启用MACD、信号线和交叉标记
- 更高时间框架明确趋势
**入场:**
- **多头**:零线上方金叉(圆点标记)
- **空头**:零线下方死叉(圆点标记)
**确认:**
- 直方图颜色支持方向
- 成交量增加有帮助
**止损:**
- 近期波动低点之下(多头)
- 近期波动高点之上(空头)
**离场:**
- 相反交叉
- MACD反向穿越零线
**适合:**趋势跟随、明确趋势市场
#### 策略2:零线反弹
**设置:**
- 启用所有组件
- 已建立趋势(MACD保持在零线一侧)
- 等待回调至零线
**入场:**
- **多头**:MACD从上方触及零线,向上反弹并金叉
- **空头**:MACD从下方触及零线,向下反弹并死叉
**确认:**
- 直方图颜色变化
- 价格在支撑/阻力位
**止损:**
- 零线对面一侧
**离场:**
- 目标前一极值
- 或相反交叉
**适合:**趋势延续、强势市场
#### 策略3:双重背离确认
**设置:**
- 启用直方图和MACD线背离
- 价格在极值(高点/低点)
- 等待背离信号
**入场:**
- **多头**:"H涨"和"M涨"标签都出现
- **空头**:"H跌"和"M跌"标签都出现
**确认:**
- 价格突破结构
- 成交量增加
- 金叉/死叉确认
**止损:**
- 背离枢轴点之外
**离场:**
- MACD穿越零线
- 或出现相反背离
**适合:**反转交易、波段交易
#### 策略4:直方图颜色转换
**设置:**
- 启用4色直方图
- 关注颜色变化
- 价格处于趋势
**入场:**
- **多头**:浅红色→浅绿色转换 + 金叉
- **空头**:浅绿色→浅红色转换 + 死叉
**原理:**
- 浅色显示动量衰竭
- 颜色翻转 = 动量转变
- 完全趋势反转前的早期入场
**止损:**
- 近期波动点
**离场:**
- 直方图颜色变为反向浅色
- 或预定目标
**适合:**剥头皮、日内交易、早期入场
#### 策略5:多时间框架动量
**设置:**
- 显示更高时间框架MACD(例如,在1小时图上显示4小时)
- 当前图表显示当前动量
- 更高TF显示整体偏向
**入场:**
- **多头**:HTF MACD在零线上方 + 当前TF金叉
- **空头**:HTF MACD在零线下方 + 当前TF死叉
**确认:**
- HTF直方图支持方向
- 两个时间框架对齐
**止损:**
- 基于当前时间框架结构
**离场:**
- 当前TF相反交叉
- 或HTF MACD动量减弱
**适合:**波段交易、高概率设置
#### 策略6:仅直方图背离侦察
**设置:**
- 仅启用直方图背离
- 使用"同符号要求"
- 关注早期信号
**入场:**
- **多头**:"H涨"标签 + 价格在支撑位
- **空头**:"H跌"标签 + 价格在阻力位
**确认:**
- 等待MACD/信号线交叉
- 或价格结构突破
**优势:**
- 最早的背离信号
- 在大众之前进入
**风险:**
- 比MACD线背离假信号更多
- 需要严格确认
**止损:**
- 入场K线之外紧密止损
**离场:**
- 快速目标(预期波动的30-50%)
- 或移动止损
**适合:**活跃交易者、寻求早期入场的剥头皮交易者
### 最佳实践
#### MACD周期选择
**标准(13/34/9)** - 默认
- 大多数市场的平衡
- 适合日内交易和波段交易
- 广泛使用,符合一般市场心理
**更快(8/21/5或12/26/9)**
- 更灵敏
- 更多信号,更多噪音
- 最适合:剥头皮、波动市场
- 风险:更多假信号
**更慢(21/55/13)**
- 更平滑的信号
- 信号较少但更强
- 最适合:波段交易、仓位交易
- 优势:更高可靠性
#### 直方图vs MACD线背离
**直方图背离:**
- ✅ 更早信号
- ✅ 在其他人之前捕捉波动
- ❌ 更多假信号
- ❌ 需要确认
- **最适合**:活跃交易者、剥头皮交易者
**MACD线背离:**
- ✅ 更可靠
- ✅ 更强的背离
- ❌ 信号较晚
- ❌ 可能错过早期波动
- **最适合**:波段交易者、保守交易者
**两者结合:**
- ✅ 最大信心
- ✅ 直方图警报,MACD确认
- ✅ 最高概率设置
- **最适合**:所有寻求质量而非数量的交易者
#### 同符号要求功能
**启用(推荐):**
- 过滤低质量背离
- 顶背离:两个直方图点都为正
- 底背离:两个直方图点都为负
- 产生更少但更可靠的信号
**禁用:**
- 更多背离信号
- 包括零线穿越背离
- 假信号率更高
- 仅适合有经验的交易者
#### 价格参考:影线vs实体
**影线(默认):**
- 使用最高/最低价
- 捕捉所有极值
- 检测到更多背离
- 最适合:大多数交易风格
**实体:**
- 使用开盘/收盘价
- 过滤突刺波动
- 背离更少但更干净
- 最适合:噪音市场、加密货币
#### 视觉设置建议
**新手:**
- 启用:MACD线、信号线、直方图
- 启用:交叉标记
- 启用:直方图颜色
- 禁用:初始禁用两个背离系统
- 重点:先学习基本交叉
**中级:**
- 所有基本组件
- 添加:仅直方图背离
- 使用:同符号要求
- 重点:早期反转信号
**高级:**
- 所有组件
- 两个背离系统
- 每个市场自定义参数
- 多时间框架分析
- 重点:高概率汇合设置
### 指标组合
**与移动平均线(EMA)配合:**
- EMA(21/55/144)显示趋势
- MACD显示动量
- 两者一致时进入
- MACD先转向时退出
**与RSI配合:**
- RSI用于超买超卖
- MACD用于动量确认
- 两者都背离 = 极强信号
- RSI + MACD背离 = 高概率交易
**与成交量配合:**
- 成交量确认MACD信号
- 交叉 + 成交量激增 = 有效突破
- 背离 + 成交量背离 = 强反转
**与支撑/阻力配合:**
- 支撑阻力水平用于进出目标
- 水平处的MACD背离 = 最高概率
- 水平处的MACD交叉 = 强确认
**与Bias指标配合:**
- Bias显示价格相对EMA的偏离
- MACD显示动量
- 两者都背离 = 强大反转信号
- Bias极值 + MACD背离 = 高信念交易
**与OBV配合:**
- OBV显示成交量趋势
- MACD显示价格动量
- OBV + MACD背离 = 成交量不支持价格
- 强反转迹象
**与KSI(RSI/CCI)配合:**
- KSI用于振荡器极值
- MACD用于动量方向
- KSI极值 + MACD背离 = 可能反转
- 全部对齐 = 最大信心
### 常见MACD形态
1. **零线上方看涨交叉**:强上升趋势延续信号
2. **零线下方看跌交叉**:强下降趋势延续信号
3. **零线拒绝**:价格将零线作为支撑/阻力
4. **直方图峰值**:动量高潮,注意反转
5. **双重背离**:两次背离未反转 = 最终反转时非常强
6. **直方图收敛**:直方图变窄 = 趋势失去动力
7. **信号线紧贴**:MACD紧贴信号线 = 盘整,预期突破
### 性能提示
- 从默认设置开始(13/34/9 EMA/EMA)
- 一次测试一个背离系统
- 初始使用同符号要求
- 启用交叉标记以获得清晰信号
- 根据市场波动性调整回溯参数
- 更高时间框架MACD比更低的更可靠
- 结合直方图早期信号与MACD线确认
- 不要交易每个背离 - 等待最佳设置
### 警报条件
虽然没有明确编码,但您可以设置自定义警报:
- MACD向上/向下穿越信号线
- MACD向上/向下穿越零线
- 直方图穿越零线
- 背离标签出现时(使用视觉警报)
---
## Technical Support
For questions or issues, please refer to the TradingView community or contact the indicator creator.
## 技术支持
如有问题,请参考TradingView社区或联系指标创建者。
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社区或联系指标创建者。
Scout Regiment - KSI# Scout Regiment - KSI Indicator
## English Documentation
### Overview
Scout Regiment - KSI (Key Stochastic Indicators) is a comprehensive momentum oscillator that combines three powerful technical indicators - RSI, CCI, and Williams %R - into a single, unified display. This multi-indicator approach provides traders with diverse perspectives on market momentum, overbought/oversold conditions, and potential reversal points through advanced divergence detection.
### What is KSI?
KSI stands for "Key Stochastic Indicators" - a composite momentum indicator that:
- Displays multiple oscillators normalized to a 0-100 scale
- Uses standardized bands (20/50/80) for consistent interpretation
- Combines RSI for trend, CCI for cycle, and Williams %R for reversal detection
- Provides enhanced divergence detection specifically for RSI
### Key Features
#### 1. **Triple Oscillator System**
**① RSI (Relative Strength Index)** - Primary Indicator
- **Purpose**: Measures momentum and identifies overbought/oversold conditions
- **Default Length**: 22 periods
- **Display**: Blue line (2px)
- **Key Levels**:
- Above 50: Bullish momentum
- Below 50: Bearish momentum
- Above 80: Overbought
- Below 20: Oversold
- **Special Features**:
- Background color indication (green/red)
- Crossover labels at 50 level
- Full divergence detection (4 types)
**② CCI (Commodity Channel Index)** - Dual Period
- **Purpose**: Identifies cyclical trends and extreme conditions
- **Dual Display**:
- CCI(33): Short-term cycle - Green line (1px)
- CCI(77): Medium-term cycle - Orange line (1px)
- **Default Source**: HLC3 (typical price)
- **Normalized Scale**: Mapped from ±100 to 0-100 for consistency
- **Interpretation**:
- Above 80: Strong upward momentum
- Below 20: Strong downward momentum
- 50 level: Neutral
- Divergence between periods: Trend change warning
**③ Williams %R** - Optional
- **Purpose**: Identifies overbought/oversold extremes
- **Default Length**: 28 periods
- **Display**: Magenta line (2px)
- **Scale**: Inverted and normalized to 0-100
- **Best For**: Short-term reversal signals
- **Default**: Disabled (enable when needed for extra confirmation)
#### 2. **Standardized Band System**
**Three-Level Structure:**
- **Upper Band (80)**: Overbought zone
- Strong momentum area
- Watch for reversal signals
- Divergences here are most reliable
- **Middle Line (50)**: Equilibrium
- Separates bullish/bearish zones
- Crossovers indicate momentum shifts
- Key decision level
- **Lower Band (20)**: Oversold zone
- Weak momentum area
- Look for bounce signals
- Divergences here signal potential reversals
**Band Fill**: Dark background between 20-80 for visual clarity
#### 3. **RSI Visual Enhancements**
**Background Color Indication**
- Green background: RSI above 50 (bullish bias)
- Red background: RSI below 50 (bearish bias)
- Optional display for cleaner charts
- Helps identify overall momentum direction
**Crossover Labels**
- "突破" (Breakout): RSI crosses above 50
- "跌破" (Breakdown): RSI crosses below 50
- Marks momentum shift points
- Can be toggled on/off
#### 4. **Advanced RSI Divergence Detection**
The indicator includes comprehensive divergence detection for RSI only (most reliable oscillator):
**Regular Bullish Divergence (Yellow)**
- **Price**: Lower lows
- **RSI**: Higher lows
- **Signal**: Potential upward reversal
- **Label**: "涨" (Up)
- **Most Common**: Near oversold levels (below 30)
**Regular Bearish Divergence (Blue)**
- **Price**: Higher highs
- **RSI**: Lower highs
- **Signal**: Potential downward reversal
- **Label**: "跌" (Down)
- **Most Common**: Near overbought levels (above 70)
**Hidden Bullish Divergence (Light Yellow)**
- **Price**: Higher lows
- **RSI**: Lower lows
- **Signal**: Uptrend continuation
- **Label**: "隐涨" (Hidden Up)
- **Use**: Add to existing longs
**Hidden Bearish Divergence (Light Blue)**
- **Price**: Lower highs
- **RSI**: Higher highs
- **Signal**: Downtrend continuation
- **Label**: "隐跌" (Hidden Down)
- **Use**: Add to existing shorts
**Divergence Parameters** (Fully Customizable):
- **Right Lookback**: Bars to right of pivot (default: 5)
- **Left Lookback**: Bars to left of pivot (default: 5)
- **Max Range**: Maximum bars between pivots (default: 60)
- **Min Range**: Minimum bars between pivots (default: 5)
### Configuration Settings
#### KSI Display Settings
- **Show RSI**: Toggle RSI indicator
- **Show CCI**: Toggle both CCI lines
- **Show Williams %R**: Toggle Williams %R (optional)
#### RSI Settings
- **RSI Length**: Period for calculation (default: 22)
- **Data Source**: Price source (default: close)
- **Show Background**: Toggle green/red background
- **Show Cross Labels**: Toggle 50-level crossover labels
#### RSI Divergence Settings
- **Right Lookback**: Pivot detection right side
- **Left Lookback**: Pivot detection left side
- **Max Range**: Maximum lookback distance
- **Min Range**: Minimum lookback distance
- **Show Regular Divergence**: Enable regular divergence lines
- **Show Regular Labels**: Enable regular divergence labels
- **Show Hidden Divergence**: Enable hidden divergence lines
- **Show Hidden Labels**: Enable hidden divergence labels
#### CCI Settings
- **CCI Length**: Short-term period (default: 33)
- **CCI Mid Length**: Medium-term period (default: 77)
- **Data Source**: Price calculation (default: HLC3)
- **Show CCI(33)**: Toggle short-term CCI
- **Show CCI(77)**: Toggle medium-term CCI
#### Williams %R Settings
- **Length**: Calculation period (default: 28)
- **Data Source**: Price source (default: close)
### How to Use
#### For Basic Momentum Trading
1. **Enable RSI Only** (primary indicator)
- Focus on 50-level crossovers
- Enable crossover labels for signals
2. **Identify Momentum Direction**
- RSI > 50 = Bullish momentum
- RSI < 50 = Bearish momentum
- Background color confirms direction
3. **Look for Extremes**
- RSI > 80 = Overbought (consider selling)
- RSI < 20 = Oversold (consider buying)
4. **Trade Setup**
- Enter long when RSI crosses above 50 from oversold
- Enter short when RSI crosses below 50 from overbought
#### For Divergence Trading
1. **Enable RSI with Divergence Detection**
- Turn on regular divergence
- Optionally add hidden divergence
2. **Wait for Divergence Signal**
- Yellow label = Bullish divergence
- Blue label = Bearish divergence
3. **Confirm with Price Structure**
- Wait for support/resistance break
- Look for candlestick patterns
- Check volume confirmation
4. **Enter Position**
- Enter after confirmation
- Stop beyond divergence pivot
- Target next key level
#### For Multi-Oscillator Confirmation
1. **Enable All Three Indicators**
- RSI (momentum)
- CCI dual (cycle analysis)
- Williams %R (extremes)
2. **Look for Alignment**
- All above 50 = Strong bullish
- All below 50 = Strong bearish
- Mixed signals = Consolidation
3. **Identify Extremes**
- All indicators > 80 = Extreme overbought
- All indicators < 20 = Extreme oversold
4. **Trade Reversals**
- Enter counter-trend when all aligned at extremes
- Confirm with divergence if available
- Use tight stops
#### For CCI Dual-Period Analysis
1. **Enable Both CCI Lines**
- CCI(33) = Short-term
- CCI(77) = Medium-term
2. **Watch for Crossovers**
- Green crosses above orange = Bullish acceleration
- Green crosses below orange = Bearish acceleration
3. **Analyze Divergence Between Periods**
- Short-term rising, medium falling = Potential reversal
- Both rising together = Strong trend
4. **Trade Accordingly**
- Follow crossover direction
- Exit when lines converge
### Trading Strategies
#### Strategy 1: RSI 50-Level Crossover
**Setup:**
- Enable RSI with background and labels
- Wait for clear trend
- Look for retracement to 50 level
**Entry:**
- Long: "突破" label appears after pullback
- Short: "跌破" label appears after bounce
**Stop Loss:**
- Long: Below recent swing low
- Short: Above recent swing high
**Exit:**
- Opposite crossover label
- Or predetermined target (2:1 risk-reward)
**Best For:** Trend following, clear markets
#### Strategy 2: RSI Divergence Reversal
**Setup:**
- Enable RSI with regular divergence
- Wait for extreme levels (>70 or <30)
- Look for divergence signal
**Entry:**
- Long: Yellow "涨" label at oversold level
- Short: Blue "跌" label at overbought level
**Confirmation:**
- Wait for price to break structure
- Check for volume increase
- Look for candlestick reversal pattern
**Stop Loss:**
- Beyond divergence pivot point
**Exit:**
- Take partial profit at 50 level
- Exit remainder at opposite extreme or divergence
**Best For:** Swing trading, range-bound markets
#### Strategy 3: Triple Oscillator Confluence
**Setup:**
- Enable all three indicators
- Wait for all to reach extreme (>80 or <20)
- Look for alignment
**Entry:**
- Long: All three below 20, first one crosses above 20
- Short: All three above 80, first one crosses below 80
**Confirmation:**
- All indicators must align
- Price at support/resistance
- Volume spike helps
**Stop Loss:**
- Fixed percentage or ATR-based
**Exit:**
- When any indicator crosses 50 level
- Or at predetermined target
**Best For:** High-probability reversals, volatile markets
#### Strategy 4: CCI Dual-Period System
**Setup:**
- Enable both CCI lines only
- Disable RSI and Williams %R for clarity
- Watch for crossovers
**Entry:**
- Long: CCI(33) crosses above CCI(77) below 50 line
- Short: CCI(33) crosses below CCI(77) above 50 line
**Confirmation:**
- Both should be moving in entry direction
- Price breaking key level helps
**Stop Loss:**
- When CCIs cross back in opposite direction
**Exit:**
- Both CCIs enter opposite extreme zone
- Or trailing stop
**Best For:** Catching trend continuations, momentum trading
#### Strategy 5: Hidden Divergence Continuation
**Setup:**
- Enable RSI with hidden divergence
- Confirm existing trend
- Wait for pullback
**Entry:**
- Uptrend: "隐涨" label during pullback
- Downtrend: "隐跌" label during bounce
**Confirmation:**
- Price holds key moving average
- Trend structure intact
**Stop Loss:**
- Beyond pullback extreme
**Exit:**
- Regular divergence appears (reversal warning)
- Or trend structure breaks
**Best For:** Adding to positions, trend trading
### Best Practices
#### Choosing Which Indicators to Display
**For Beginners:**
- Use RSI only
- Enable background color and labels
- Focus on 50-level crossovers
- Simple and effective
**For Intermediate Traders:**
- RSI + Regular Divergence
- Add CCI for confirmation
- Use dual perspectives
- Better accuracy
**For Advanced Traders:**
- All three indicators
- Full divergence detection
- Multi-timeframe analysis
- Maximum information
#### Oscillator Priority
**Primary**: RSI (22)
- Most reliable
- Best divergence detection
- Good for all timeframes
- Use this as your main decision maker
**Secondary**: CCI (33/77)
- Adds cycle analysis
- Great for confirmation
- Dual-period crossovers valuable
- Use to confirm RSI signals
**Tertiary**: Williams %R (28)
- Extreme readings useful
- More volatile
- Best for short-term
- Use sparingly for extra confirmation
#### Timeframe Considerations
**Lower Timeframes (1m-15m):**
- More signals, less reliable
- Use tight divergence parameters
- Focus on RSI crossovers
- Quick entries and exits
**Medium Timeframes (30m-4H):**
- Balanced signal frequency
- Default settings work well
- Best for divergence trading
- Swing trading optimal
**Higher Timeframes (Daily+):**
- Fewer but stronger signals
- Widen divergence ranges
- All indicators more reliable
- Position trading best
#### Divergence Trading Tips
1. **Wait for Confirmation**
- Divergence alone isn't enough
- Need price structure break
- Volume helps validate
2. **Best at Extremes**
- Divergences near 80/20 levels most reliable
- Mid-level divergences often fail
- Combine with support/resistance
3. **Multiple Divergences**
- Second divergence stronger than first
- Third divergence extremely powerful
- Watch for "triple divergence"
4. **Timeframe Alignment**
- Check higher timeframe for direction
- Trade divergences in direction of larger trend
- Counter-trend divergences riskier
### Indicator Combinations
**With Moving Averages:**
- Use EMAs (21/55/144) for trend
- KSI for entry timing
- Enter when both align
**With Volume:**
- Volume confirms breakouts
- Divergence + volume divergence = Stronger
- Low volume at extremes = Reversal likely
**With Support/Resistance:**
- Price levels for targets
- KSI for entry timing
- Divergences at levels = Highest probability
**With Bias Indicator:**
- Bias shows price deviation
- KSI shows momentum
- Both diverging = Strong reversal signal
**With OBV Indicator:**
- OBV shows volume trend
- KSI shows price momentum
- Volume/momentum divergence powerful
### Common Patterns
1. **Bullish Reversal**: All oscillators oversold + RSI bullish divergence
2. **Bearish Reversal**: All oscillators overbought + RSI bearish divergence
3. **Trend Acceleration**: RSI > 50, both CCIs rising, Williams %R not extreme
4. **Weakening Trend**: RSI declining while price rising (pre-divergence warning)
5. **Strong Trend**: All oscillators stay above/below 50 for extended period
6. **Consolidation**: Oscillators crossing 50 frequently without extremes
7. **Exhaustion**: Multiple oscillators at extreme + hidden divergence failure
### Performance Tips
- Start simple: RSI only
- Add indicators gradually as you learn
- Disable unused features for cleaner charts
- Use labels strategically (not always on)
- Test different RSI lengths for your market
- Adjust divergence parameters based on volatility
### Alert Conditions
The indicator includes alerts for:
- RSI crossing above 50
- RSI crossing below 50
- RSI regular bullish divergence
- RSI regular bearish divergence
- RSI hidden bullish divergence
- RSI hidden bearish divergence
---
## 中文说明文档
### 概述
Scout Regiment - KSI(关键随机指标)是一个综合性动量振荡器,将三个强大的技术指标 - RSI、CCI和威廉指标 - 组合到一个统一的显示中。这种多指标方法为交易者提供了市场动量、超买超卖状况和通过高级背离检测发现潜在反转点的多元视角。
### 什么是KSI?
KSI代表"关键随机指标" - 一个综合动量指标:
- 显示多个振荡器,标准化到0-100刻度
- 使用标准化波段(20/50/80)便于一致解读
- 结合RSI用于趋势、CCI用于周期、威廉指标用于反转检测
- 专门为RSI提供增强的背离检测
### 核心功能
#### 1. **三重振荡器系统**
**① RSI(相对强弱指数)** - 主要指标
- **用途**:测量动量并识别超买超卖状况
- **默认长度**:22周期
- **显示**:蓝色线(2像素)
- **关键水平**:
- 50以上:看涨动量
- 50以下:看跌动量
- 80以上:超买
- 20以下:超卖
- **特殊功能**:
- 背景颜色指示(绿色/红色)
- 50水平穿越标签
- 完整背离检测(4种类型)
**② CCI(顺势指标)** - 双周期
- **用途**:识别周期性趋势和极端状况
- **双重显示**:
- CCI(33):短期周期 - 绿色线(1像素)
- CCI(77):中期周期 - 橙色线(1像素)
- **默认数据源**:HLC3(典型价格)
- **标准化刻度**:从±100映射到0-100以保持一致性
- **解读**:
- 80以上:强劲上升动量
- 20以下:强劲下降动量
- 50水平:中性
- 周期间背离:趋势变化警告
**③ 威廉指标 %R** - 可选
- **用途**:识别超买超卖极值
- **默认长度**:28周期
- **显示**:洋红色线(2像素)
- **刻度**:反转并标准化到0-100
- **最适合**:短期反转信号
- **默认**:禁用(需要额外确认时启用)
#### 2. **标准化波段系统**
**三层结构:**
- **上轨(80)**:超买区域
- 强动量区域
- 注意反转信号
- 此处的背离最可靠
- **中线(50)**:均衡线
- 分隔看涨/看跌区域
- 穿越表示动量转变
- 关键决策水平
- **下轨(20)**:超卖区域
- 弱动量区域
- 寻找反弹信号
- 此处的背离预示潜在反转
**波段填充**:20-80之间的深色背景,增强视觉清晰度
#### 3. **RSI视觉增强**
**背景颜色指示**
- 绿色背景:RSI在50以上(看涨偏向)
- 红色背景:RSI在50以下(看跌偏向)
- 可选显示,图表更清爽
- 帮助识别整体动量方向
**穿越标签**
- "突破":RSI向上穿越50
- "跌破":RSI向下穿越50
- 标记动量转变点
- 可开关
#### 4. **高级RSI背离检测**
指标仅为RSI(最可靠的振荡器)提供全面背离检测:
**常规看涨背离(黄色)**
- **价格**:更低的低点
- **RSI**:更高的低点
- **信号**:潜在向上反转
- **标签**:"涨"
- **最常见**:在超卖水平附近(30以下)
**常规看跌背离(蓝色)**
- **价格**:更高的高点
- **RSI**:更低的高点
- **信号**:潜在向下反转
- **标签**:"跌"
- **最常见**:在超买水平附近(70以上)
**隐藏看涨背离(浅黄色)**
- **价格**:更高的低点
- **RSI**:更低的低点
- **信号**:上升趋势延续
- **标签**:"隐涨"
- **用途**:加仓现有多头
**隐藏看跌背离(浅蓝色)**
- **价格**:更低的高点
- **RSI**:更高的高点
- **信号**:下降趋势延续
- **标签**:"隐跌"
- **用途**:加仓现有空头
**背离参数**(完全可自定义):
- **右侧回溯**:枢轴点右侧K线数(默认:5)
- **左侧回溯**:枢轴点左侧K线数(默认:5)
- **最大范围**:枢轴点之间最大K线数(默认:60)
- **最小范围**:枢轴点之间最小K线数(默认:5)
### 配置设置
#### KSI显示设置
- **显示RSI**:切换RSI指标
- **显示CCI**:切换两条CCI线
- **显示威廉指标 %R**:切换威廉指标(可选)
#### RSI设置
- **RSI长度**:计算周期(默认:22)
- **数据源**:价格源(默认:收盘价)
- **显示背景**:切换绿色/红色背景
- **显示穿越标签**:切换50水平穿越标签
#### RSI背离设置
- **右侧回溯**:枢轴检测右侧
- **左侧回溯**:枢轴检测左侧
- **回溯范围最大值**:最大回溯距离
- **回溯范围最小值**:最小回溯距离
- **显示常规背离**:启用常规背离线
- **显示常规背离标签**:启用常规背离标签
- **显示隐藏背离**:启用隐藏背离线
- **显示隐藏背离标签**:启用隐藏背离标签
#### CCI设置
- **CCI长度**:短期周期(默认:33)
- **CCI中期长度**:中期周期(默认:77)
- **数据源**:价格计算(默认:HLC3)
- **显示CCI(33)**:切换短期CCI
- **显示CCI(77)**:切换中期CCI
#### 威廉指标 %R 设置
- **长度**:计算周期(默认:28)
- **数据源**:价格源(默认:收盘价)
### 使用方法
#### 基础动量交易
1. **仅启用RSI**(主要指标)
- 关注50水平穿越
- 启用穿越标签获取信号
2. **识别动量方向**
- RSI > 50 = 看涨动量
- RSI < 50 = 看跌动量
- 背景颜色确认方向
3. **寻找极值**
- RSI > 80 = 超买(考虑卖出)
- RSI < 20 = 超卖(考虑买入)
4. **交易设置**
- RSI从超卖区向上穿越50时做多
- RSI从超买区向下穿越50时做空
#### 背离交易
1. **启用RSI和背离检测**
- 打开常规背离
- 可选添加隐藏背离
2. **等待背离信号**
- 黄色标签 = 看涨背离
- 蓝色标签 = 看跌背离
3. **用价格结构确认**
- 等待支撑/阻力突破
- 寻找K线形态
- 检查成交量确认
4. **进入仓位**
- 确认后进入
- 止损设在背离枢轴点之外
- 目标下一个关键水平
#### 多振荡器确认
1. **启用全部三个指标**
- RSI(动量)
- CCI双周期(周期分析)
- 威廉指标 %R(极值)
2. **寻找一致性**
- 全部在50以上 = 强劲看涨
- 全部在50以下 = 强劲看跌
- 信号混合 = 盘整
3. **识别极值**
- 所有指标 > 80 = 极度超买
- 所有指标 < 20 = 极度超卖
4. **交易反转**
- 所有指标在极值一致时逆势进入
- 可能的话用背离确认
- 使用紧密止损
#### CCI双周期分析
1. **启用两条CCI线**
- CCI(33) = 短期
- CCI(77) = 中期
2. **观察穿越**
- 绿色线穿越橙色线向上 = 看涨加速
- 绿色线穿越橙色线向下 = 看跌加速
3. **分析周期间背离**
- 短期上升,中期下降 = 潜在反转
- 两者同时上升 = 强趋势
4. **相应交易**
- 跟随穿越方向
- 线条汇合时退出
### 交易策略
#### 策略1:RSI 50水平穿越
**设置:**
- 启用RSI及背景和标签
- 等待明确趋势
- 寻找回调至50水平
**入场:**
- 多头:回调后出现"突破"标签
- 空头:反弹后出现"跌破"标签
**止损:**
- 多头:近期波动低点之下
- 空头:近期波动高点之上
**离场:**
- 出现相反穿越标签
- 或预定目标(2:1风险收益比)
**适合:**趋势跟随、明确市场
#### 策略2:RSI背离反转
**设置:**
- 启用RSI和常规背离
- 等待极端水平(>70或<30)
- 寻找背离信号
**入场:**
- 多头:超卖水平出现黄色"涨"标签
- 空头:超买水平出现蓝色"跌"标签
**确认:**
- 等待价格突破结构
- 检查成交量增加
- 寻找K线反转形态
**止损:**
- 背离枢轴点之外
**离场:**
- 在50水平部分获利
- 其余在相反极值或背离处离场
**适合:**波段交易、震荡市场
#### 策略3:三重振荡器汇合
**设置:**
- 启用全部三个指标
- 等待全部达到极值(>80或<20)
- 寻找一致性
**入场:**
- 多头:三个全部低于20,第一个向上穿越20
- 空头:三个全部高于80,第一个向下穿越80
**确认:**
- 所有指标必须一致
- 价格在支撑/阻力位
- 成交量激增有帮助
**止损:**
- 固定百分比或基于ATR
**离场:**
- 任一指标穿越50水平时
- 或在预定目标
**适合:**高概率反转、波动市场
#### 策略4:CCI双周期系统
**设置:**
- 仅启用两条CCI线
- 禁用RSI和威廉指标以保持清晰
- 观察穿越
**入场:**
- 多头:CCI(33)在50线下方向上穿越CCI(77)
- 空头:CCI(33)在50线上方向下穿越CCI(77)
**确认:**
- 两者都应朝入场方向移动
- 价格突破关键水平有帮助
**止损:**
- CCI反向穿越时
**离场:**
- 两条CCI进入相反极值区域
- 或移动止损
**适合:**捕捉趋势延续、动量交易
#### 策略5:隐藏背离延续
**设置:**
- 启用RSI和隐藏背离
- 确认现有趋势
- 等待回调
**入场:**
- 上升趋势:回调期间出现"隐涨"标签
- 下降趋势:反弹期间出现"隐跌"标签
**确认:**
- 价格守住关键移动平均线
- 趋势结构完整
**止损:**
- 回调极值之外
**离场:**
- 出现常规背离(反转警告)
- 或趋势结构破坏
**适合:**加仓、趋势交易
### 最佳实践
#### 选择显示哪些指标
**新手:**
- 仅使用RSI
- 启用背景颜色和标签
- 关注50水平穿越
- 简单有效
**中级交易者:**
- RSI + 常规背离
- 添加CCI确认
- 使用双重视角
- 更高准确度
**高级交易者:**
- 全部三个指标
- 完整背离检测
- 多时间框架分析
- 信息最大化
#### 振荡器优先级
**主要**:RSI (22)
- 最可靠
- 最佳背离检测
- 适用所有时间框架
- 用作主要决策依据
**次要**:CCI (33/77)
- 添加周期分析
- 确认效果好
- 双周期穿越有价值
- 用于确认RSI信号
**第三**:威廉指标 %R (28)
- 极值读数有用
- 更波动
- 最适合短期
- 谨慎使用以获额外确认
#### 时间框架考虑
**低时间框架(1分钟-15分钟):**
- 更多信号,可靠性较低
- 使用紧密背离参数
- 关注RSI穿越
- 快速进出
**中等时间框架(30分钟-4小时):**
- 信号频率平衡
- 默认设置效果好
- 最适合背离交易
- 波段交易最优
**高时间框架(日线+):**
- 信号较少但更强
- 扩大背离范围
- 所有指标更可靠
- 最适合仓位交易
#### 背离交易技巧
1. **等待确认**
- 仅背离不够
- 需要价格结构突破
- 成交量帮助验证
2. **极值处最佳**
- 80/20水平附近的背离最可靠
- 中间水平背离常失败
- 结合支撑/阻力
3. **多重背离**
- 第二次背离强于第一次
- 第三次背离极其强大
- 注意"三重背离"
4. **时间框架对齐**
- 检查更高时间框架方向
- 顺大趋势方向交易背离
- 逆势背离风险更大
### 指标组合
**与移动平均线配合:**
- 使用EMA(21/55/144)确定趋势
- KSI用于入场时机
- 两者一致时进入
**与成交量配合:**
- 成交量确认突破
- 背离 + 成交量背离 = 更强
- 极值处低成交量 = 可能反转
**与支撑/阻力配合:**
- 价格水平作为目标
- KSI用于入场时机
- 水平处的背离 = 最高概率
**与Bias指标配合:**
- Bias显示价格偏离
- KSI显示动量
- 两者都背离 = 强反转信号
**与OBV指标配合:**
- OBV显示成交量趋势
- KSI显示价格动量
- 成交量/动量背离强大
### 常见形态
1. **看涨反转**:所有振荡器超卖 + RSI看涨背离
2. **看跌反转**:所有振荡器超买 + RSI看跌背离
3. **趋势加速**:RSI > 50,两条CCI上升,威廉指标不极端
4. **趋势减弱**:价格上升时RSI下降(背离前警告)
5. **强趋势**:所有振荡器长时间保持在50上方/下方
6. **盘整**:振荡器频繁穿越50无极值
7. **衰竭**:多个振荡器在极值 + 隐藏背离失败
### 性能提示
- 从简单开始:仅RSI
- 学习时逐渐添加指标
- 禁用未使用功能以保持图表清晰
- 策略性使用标签(不总是开启)
- 为您的市场测试不同RSI长度
- 根据波动性调整背离参数
### 警报条件
指标包含以下警报:
- RSI向上穿越50
- RSI向下穿越50
- RSI常规看涨背离
- RSI常规看跌背离
- RSI隐藏看涨背离
- RSI隐藏看跌背离
---
## Technical Support
For questions or issues, please refer to the TradingView community or contact the indicator creator.
## 技术支持
如有问题,请参考TradingView社区或联系指标创建者。
Scout Regiment - Bias# Scout Regiment - Bias Indicator
## English Documentation
### Overview
Scout Regiment - Bias is a technical indicator that measures the deviation (bias) between the current price and exponential moving averages (EMAs). It helps traders identify overbought/oversold conditions, trend strength, and potential reversal points through divergence detection.
### What is Bias?
Bias measures how far the price has moved away from a moving average, expressed as a percentage:
- **Positive Bias**: Price is above the EMA (potential overbought)
- **Negative Bias**: Price is below the EMA (potential oversold)
- **Formula**: Bias = (Price - EMA) / EMA × 100
### Key Features
#### 1. **Triple EMA Bias Lines**
The indicator calculates bias from three different EMAs:
- **EMA 55 Bias** (Default: Green/Red, 1px line)
- Short-term bias measurement
- Quick response to price changes
- Best for intraday and swing trading
- **EMA 144 Bias** (Pink, 2px line)
- Medium-term bias measurement
- Balanced response to price movements
- Ideal for swing trading
- **EMA 233 Bias** (White, 2px line)
- Long-term bias measurement
- Slower response, more stable
- Best for position trading
**Color Coding:**
- Green: Price above EMA (bullish)
- Red: Price below EMA (bearish)
#### 2. **Visual Components**
**Histogram Display**
- Shows EMA 55 bias as a histogram for easy visualization
- Green bars: Price above EMA 55
- Red bars: Price below EMA 55
- Can be toggled on/off
**Background Color**
- Light green background: Bullish bias (price above EMA 55)
- Light red background: Bearish bias (price below EMA 55)
- Optional display for cleaner charts
**Zero Line**
- White horizontal line at 0%
- Reference point for positive/negative bias
- Crossovers indicate trend changes
**Crossover Labels**
- "突破" (Breakout): When bias crosses above zero
- "跌破" (Breakdown): When bias crosses below zero
- Can be enabled/disabled for clarity
#### 3. **Divergence Detection**
The indicator automatically detects regular divergences for all three bias lines:
**Bullish Divergence (Yellow Labels)**
- Price makes lower lows
- Bias makes higher lows
- Suggests potential upward reversal
- Labels: "55涨", "144涨", "233涨"
**Bearish Divergence (Blue Labels)**
- Price makes higher highs
- Bias makes lower highs
- Suggests potential downward reversal
- Labels: "55跌", "144跌", "233跌"
**Divergence Parameters** (Customizable for each EMA):
- Left Lookback: Bars to the left of pivot (default: 5)
- Right Lookback: Bars to the right of pivot (default: 1)
- Max Lookback Range: Maximum distance between pivots (default: 60)
- Min Lookback Range: Minimum distance between pivots (default: 5)
### Configuration Settings
#### Bias Settings
- **EMA Periods**: Customize lengths for EMA 55, 144, and 233
- **Price Source**: Choose calculation source (default: close)
- **Enable/Disable**: Toggle each bias line independently
#### Display Settings
- **Show Histogram**: Toggle histogram display
- **Show Background Color**: Toggle background coloring
- **Show Crossover Labels**: Toggle breakout/breakdown labels
#### Divergence Settings (Per EMA)
- Individual controls for EMA 55, 144, and 233 divergences
- Customizable lookback parameters for precision tuning
- Adjustable range settings for different market conditions
### How to Use
#### For Trend Trading
1. **Identify Trend Direction**
- Price above zero = Uptrend
- Price below zero = Downtrend
2. **Confirm with Multiple Timeframes**
- EMA 55: Short-term trend
- EMA 144: Medium-term trend
- EMA 233: Long-term trend
3. **Trade in Direction of Bias**
- All three lines positive = Strong uptrend
- All three lines negative = Strong downtrend
#### For Mean Reversion Trading
1. **Identify Extremes**
- High positive bias (>5-10%) = Overbought
- High negative bias (<-5 to -10%) = Oversold
2. **Wait for Confirmation**
- Look for bias to turn back toward zero
- Watch for crossover labels
3. **Enter on Reversal**
- Enter long when extreme negative bias starts rising
- Enter short when extreme positive bias starts falling
#### For Divergence Trading
1. **Spot Divergence Labels**
- Yellow labels = Bullish divergence (potential buy)
- Blue labels = Bearish divergence (potential sell)
2. **Confirm with Price Action**
- Wait for price to confirm with structure break
- Look for support/resistance reactions
3. **Use Multiple EMAs**
- EMA 55 divergence: Quick reversals
- EMA 144 divergence: Reliable signals
- EMA 233 divergence: Major trend changes
#### For Multi-Timeframe Analysis
1. **Check Long-term Bias** (EMA 233)
- Determines overall market direction
2. **Find Medium-term Entry** (EMA 144)
- Look for pullbacks in long-term trend
3. **Time Short-term Entry** (EMA 55)
- Enter when short-term aligns with longer timeframes
### Trading Strategies
#### Strategy 1: Triple Confirmation
- Wait for all three bias lines to be positive (or negative)
- Enter in direction of unanimous bias
- Exit when any line crosses zero
- Best for: Strong trending markets
#### Strategy 2: Divergence Trading
- Enable all divergence detection
- Take trades only when divergence appears
- Confirm with price structure
- Best for: Range-bound and reversal setups
#### Strategy 3: Zero Line Crossover
- Enable crossover labels
- Enter long on "突破" labels
- Enter short on "跌破" labels
- Use stop loss at recent swing points
- Best for: Trend following
#### Strategy 4: Extreme Reversion
- Wait for bias to reach extremes (>10% or <-10%)
- Enter counter-trend when bias reverses
- Exit at zero line
- Best for: Ranging markets
### Best Practices
1. **Combine with Price Action**
- Don't trade bias alone
- Confirm with support/resistance
- Look for candlestick patterns
2. **Use Multiple Timeframes**
- Check higher timeframe bias
- Trade in direction of larger trend
- Use lower timeframe for entry timing
3. **Manage Risk**
- Set stop losses beyond recent swings
- Don't fight extreme bias in strong trends
- Reduce position size at extremes
4. **Customize for Your Market**
- Volatile assets: Use wider ranges
- Stable assets: Use tighter ranges
- Adjust EMA periods for your timeframe
5. **Watch for False Signals**
- Multiple small divergences = Less reliable
- Divergences at extremes = More reliable
- Confirm with other indicators
### Indicator Combinations
**With Volume:**
- High bias + Low volume = Weak move
- High bias + High volume = Strong move
**With Moving Averages:**
- Check if price is above/below key EMAs
- Bias confirms EMA trend strength
**With RSI/MACD:**
- Multiple indicator divergence = Stronger signal
- Use bias for overbought/oversold confirmation
### Performance Tips
- Disable unused features for faster loading
- Use histogram for quick visual reference
- Enable background color for trend clarity
- Use divergence detection selectively
### Common Patterns
1. **Bias Expansion**: Bias increasing = Strong trend
2. **Bias Contraction**: Bias decreasing = Trend weakening
3. **Zero Line Bounce**: Price respects EMA as support/resistance
4. **Extreme Bias**: Over-extension, watch for reversal
5. **Divergence Cluster**: Multiple EMAs diverging = High probability reversal
### Alert Conditions
You can set alerts for:
- Bias crossing above/below zero
- Extreme bias levels
- Divergence detection
- All three bias lines aligned
---
## 中文说明文档
### 概述
Scout Regiment - Bias 是一个技术指标,用于测量当前价格与指数移动平均线(EMA)之间的偏离程度(乖离率)。它帮助交易者识别超买超卖状况、趋势强度,以及通过背离检测发现潜在的反转点。
### 什么是乖离率?
乖离率衡量价格偏离移动平均线的程度,以百分比表示:
- **正乖离**:价格高于EMA(可能超买)
- **负乖离**:价格低于EMA(可能超卖)
- **计算公式**:乖离率 = (价格 - EMA) / EMA × 100
### 核心功能
#### 1. **三重EMA乖离率线**
指标计算三条不同EMA的乖离率:
- **EMA 55 乖离率**(默认:绿色/红色,1像素线)
- 短期乖离测量
- 对价格变化反应快速
- 适合日内和波段交易
- **EMA 144 乖离率**(粉色,2像素线)
- 中期乖离测量
- 对价格波动反应平衡
- 最适合波段交易
- **EMA 233 乖离率**(白色,2像素线)
- 长期乖离测量
- 反应较慢,更稳定
- 适合仓位交易
**颜色编码:**
- 绿色:价格高于EMA(看涨)
- 红色:价格低于EMA(看跌)
#### 2. **视觉组件**
**柱状图显示**
- 以柱状图形式显示EMA 55乖离率,便于可视化
- 绿色柱:价格高于EMA 55
- 红色柱:价格低于EMA 55
- 可开关显示
**背景颜色**
- 浅绿色背景:看涨乖离(价格高于EMA 55)
- 浅红色背景:看跌乖离(价格低于EMA 55)
- 可选显示,图表更清爽
**零轴**
- 零点位置的白色横线
- 正负乖离的参考点
- 穿越表示趋势变化
**穿越标签**
- "突破":乖离率向上穿越零轴
- "跌破":乖离率向下穿越零轴
- 可启用/禁用以保持清晰
#### 3. **背离检测**
指标自动检测所有三条乖离率线的常规背离:
**看涨背离(黄色标签)**
- 价格创新低
- 乖离率创更高的低点
- 暗示潜在向上反转
- 标签:"55涨"、"144涨"、"233涨"
**看跌背离(蓝色标签)**
- 价格创新高
- 乖离率创更低的高点
- 暗示潜在向下反转
- 标签:"55跌"、"144跌"、"233跌"
**背离参数**(每个EMA可自定义):
- 左侧回溯:枢轴点左侧K线数(默认:5)
- 右侧回溯:枢轴点右侧K线数(默认:1)
- 最大回溯范围:枢轴点之间最大距离(默认:60)
- 最小回溯范围:枢轴点之间最小距离(默认:5)
### 配置设置
#### Bias设置
- **EMA周期**:自定义EMA 55、144和233的长度
- **价格源**:选择计算源(默认:收盘价)
- **启用/禁用**:独立切换每条乖离率线
#### 显示设置
- **显示柱状图**:切换柱状图显示
- **显示背景颜色**:切换背景着色
- **显示突破标签**:切换突破/跌破标签
#### 背离设置(按EMA)
- EMA 55、144和233背离的独立控制
- 可自定义回溯参数用于精确调整
- 可调整范围设置以适应不同市场状况
### 使用方法
#### 趋势交易
1. **识别趋势方向**
- 价格高于零 = 上升趋势
- 价格低于零 = 下降趋势
2. **多时间框架确认**
- EMA 55:短期趋势
- EMA 144:中期趋势
- EMA 233:长期趋势
3. **顺乖离方向交易**
- 三条线全部为正 = 强劲上升趋势
- 三条线全部为负 = 强劲下降趋势
#### 均值回归交易
1. **识别极值**
- 高正乖离(>5-10%)= 超买
- 高负乖离(<-5至-10%)= 超卖
2. **等待确认**
- 等待乖离率回归零轴
- 观察穿越标签
3. **在反转时进场**
- 极端负乖离开始上升时做多
- 极端正乖离开始下降时做空
#### 背离交易
1. **发现背离标签**
- 黄色标签 = 看涨背离(潜在买入)
- 蓝色标签 = 看跌背离(潜在卖出)
2. **用价格行为确认**
- 等待价格通过结构突破确认
- 观察支撑/阻力反应
3. **使用多个EMA**
- EMA 55背离:快速反转
- EMA 144背离:可靠信号
- EMA 233背离:重大趋势变化
#### 多时间框架分析
1. **检查长期乖离**(EMA 233)
- 确定整体市场方向
2. **寻找中期入场**(EMA 144)
- 在长期趋势中寻找回调
3. **把握短期入场时机**(EMA 55)
- 短期与长期时间框架一致时进场
### 交易策略
#### 策略1:三重确认
- 等待三条乖离率线全部为正(或负)
- 顺一致乖离方向入场
- 任一线穿越零轴时离场
- 适合:强趋势市场
#### 策略2:背离交易
- 启用所有背离检测
- 仅在出现背离时交易
- 用价格结构确认
- 适合:震荡和反转设置
#### 策略3:零轴穿越
- 启用穿越标签
- 在"突破"标签时做多
- 在"跌破"标签时做空
- 在近期波动点设置止损
- 适合:趋势跟随
#### 策略4:极值回归
- 等待乖离率达到极值(>10%或<-10%)
- 乖离率反转时逆趋势入场
- 在零轴离场
- 适合:震荡市场
### 最佳实践
1. **结合价格行为**
- 不要单独使用乖离率交易
- 用支撑/阻力确认
- 寻找K线形态
2. **使用多时间框架**
- 检查更高时间框架的乖离
- 顺大趋势方向交易
- 用低时间框架把握入场时机
3. **风险管理**
- 在近期波动之外设置止损
- 不要在强趋势中对抗极端乖离
- 在极值处减少仓位
4. **针对您的市场定制**
- 波动大的资产:使用更宽的范围
- 稳定的资产:使用更紧的范围
- 根据时间框架调整EMA周期
5. **警惕假信号**
- 多个小背离 = 可靠性较低
- 极值处的背离 = 更可靠
- 用其他指标确认
### 指标组合
**与成交量配合:**
- 高乖离 + 低成交量 = 弱势波动
- 高乖离 + 高成交量 = 强势波动
**与移动平均线配合:**
- 检查价格是否在关键EMA上方/下方
- 乖离率确认EMA趋势强度
**与RSI/MACD配合:**
- 多指标背离 = 更强信号
- 使用乖离率确认超买超卖
### 性能提示
- 禁用未使用的功能以加快加载
- 使用柱状图快速视觉参考
- 启用背景颜色以清晰显示趋势
- 有选择地使用背离检测
### 常见形态
1. **乖离扩张**:乖离率增大 = 强趋势
2. **乖离收缩**:乖离率减小 = 趋势减弱
3. **零轴反弹**:价格将EMA作为支撑/阻力
4. **极端乖离**:过度延伸,注意反转
5. **背离集群**:多个EMA背离 = 高概率反转
### 警报条件
您可以为以下情况设置警报:
- 乖离率向上/向下穿越零轴
- 极端乖离水平
- 背离检测
- 三条乖离率线对齐
---
## Technical Support
For questions or issues, please refer to the TradingView community or contact the indicator creator.
## 技术支持
如有问题,请参考TradingView社区或联系指标创建者。
LibTmFrLibrary "LibTmFr"
This is a utility library for handling timeframes and
multi-timeframe (MTF) analysis in Pine Script. It provides a
collection of functions designed to handle common tasks related
to period detection, session alignment, timeframe construction,
and time calculations, forming a foundation for
MTF indicators.
Key Capabilities:
1. **MTF Period Engine:** The library includes functions for
managing higher-timeframe (HTF) periods.
- **Period Detection (`isNewPeriod`):** Detects the first bar
of a given timeframe. It includes custom logic to handle
multi-month and multi-year intervals where
`timeframe.change()` may not be sufficient.
- **Bar Counting (`sinceNewPeriod`):** Counts the number of
bars that have passed in the current HTF period or
returns the final count for a completed historical period.
2. **Automatic Timeframe Selection:** Offers functions for building
a top-down analysis framework:
- **Automatic HTF (`autoHTF`):** Suggests a higher timeframe
(HTF) for broader context based on the current timeframe.
- **Automatic LTF (`autoLTF`):** Suggests an appropriate lower
timeframe (LTF) for granular intra-bar analysis.
3. **Timeframe Manipulation and Comparison:** Includes tools for
working with timeframe strings:
- **Build & Split (`buildTF`, `splitTF`):** Functions to
programmatically construct valid Pine Script timeframe
strings (e.g., "4H") and parse them back into their
numeric and unit components.
- **Comparison (`isHigherTF`, `isActiveTF`, `isLowerTF`):**
A set of functions to check if a given timeframe is
higher, lower, or the same as the script's active timeframe.
- **Multiple Validation (`isMultipleTF`):** Checks if a
higher timeframe is a practical multiple of the current
timeframe. This is based on the assumption that checking
if recent, completed HTF periods contained more than one
bar is a valid proxy for preventing data gaps.
4. **Timestamp Interpolation:** Contains an `interpTimestamp()`
function that calculates an absolute timestamp by
interpolating at a given percentage across a specified
range of bars (e.g., 50% of the way through the last
20 bars), enabling time calculations at a resolution
finer than the chart's native bars.
---
**DISCLAIMER**
This library is provided "AS IS" and for informational and
educational purposes only. It does not constitute financial,
investment, or trading advice.
The author assumes no liability for any errors, inaccuracies,
or omissions in the code. Using this library to build
trading indicators or strategies is entirely at your own risk.
As a developer using this library, you are solely responsible
for the rigorous testing, validation, and performance of any
scripts you create based on these functions. The author shall
not be held liable for any financial losses incurred directly
or indirectly from the use of this library or any scripts
derived from it.
buildTF(quantity, unit)
Builds a Pine Script timeframe string from a numeric quantity and a unit enum.
The resulting string can be used with `request.security()` or `input.timeframe`.
Parameters:
quantity (int) : series int Number to specifie how many `unit` the timeframe spans.
unit (series TFUnit) : series TFUnit The size category for the bars.
Returns: series string A Pine-style timeframe identifier, e.g.
"5S" → 5-seconds bars
"30" → 30-minute bars
"120" → 2-hour bars
"1D" → daily bars
"3M" → 3-month bars
"24M" → 2-year bars
splitTF(tf)
Splits a Pine‑timeframe identifier into numeric quantity and unit (TFUnit).
Parameters:
tf (string) : series string Timeframe string, e.g.
"5S", "30", "120", "1D", "3M", "24M".
Returns:
quantity series int The numeric value of the timeframe (e.g., 15 for "15", 3 for "3M").
unit series TFUnit The unit of the timeframe (e.g., TFUnit.minutes, TFUnit.months).
Notes on strings without a suffix:
• Pure digits are minutes; if divisible by 60, they are treated as hours.
• An "M" suffix is months; if divisible by 12, it is converted to years.
autoHTF(tf)
Picks an appropriate **higher timeframe (HTF)** relative to the selected timeframe.
It steps up along a coarse ladder to produce sensible jumps for top‑down analysis.
Mapping → chosen HTF:
≤ 1 min → 60 (1h) ≈ ×60
≤ 3 min → 180 (3h) ≈ ×60
≤ 5 min → 240 (4h) ≈ ×48
≤ 15 min → D (1 day) ≈ ×26–×32 (regular session 6.5–8 h)
> 15 min → W (1 week) ≈ ×64–×80 for 30m; varies with input
≤ 1 h → W (1 week) ≈ ×32–×40
≤ 4 h → M (1 month) ≈ ×36–×44 (~22 trading days / month)
> 4 h → 3M (3 months) ≈ ×36–×66 (e.g., 12h→×36–×44; 8h→×53–×66)
≤ 1 day → 3M (3 months) ≈ ×60–×66 (~20–22 trading days / month)
> 1 day → 12M (1 year) ≈ ×(252–264)/quantity
≤ 1 week → 12M (1 year) ≈ ×52
> 1 week → 48M (4 years) ≈ ×(208)/quantity
= 1 M → 48M (4 years) ≈ ×48
> 1 M → error ("HTF too big")
any → error ("HTF too big")
Notes:
• Inputs in months or years are restricted: only 1M is allowed; larger months/any years throw.
• Returns a Pine timeframe string usable in `request.security()` and `input.timeframe`.
Parameters:
tf (string) : series string Selected timeframe (e.g., "D", "240", or `timeframe.period`).
Returns: series string Suggested higher timeframe.
autoLTF(tf)
Selects an appropriate **lower timeframe LTF)** for intra‑bar evaluation
based on the selected timeframe. The goal is to keep intra‑bar
loops performant while providing enough granularity.
Mapping → chosen LTF:
≤ 1 min → 1S ≈ ×60
≤ 5 min → 5S ≈ ×60
≤ 15 min → 15S ≈ ×60
≤ 30 min → 30S ≈ ×60
> 30 min → 60S (1m) ≈ ×31–×59 (for 31–59 minute charts)
≤ 1 h → 1 (1m) ≈ ×60
≤ 2 h → 2 (2m) ≈ ×60
≤ 4 h → 5 (5m) ≈ ×48
> 4 h → 15 (15m) ≈ ×24–×48 (e.g., 6h→×24, 8h→×32, 12h→×48)
≤ 1 day → 15 (15m) ≈ ×26–×32 (regular sessions ~6.5–8h)
> 1 day → 60 (60m) ≈ ×(26–32) per day × quantity
≤ 1 week → 60 (60m) ≈ ×32–×40 (≈5 sessions of ~6.5–8h)
> 1 week → 240 (4h) ≈ ×(8–10) per week × quantity
≤ 1 M → 240 (4h) ≈ ×33–×44 (~20–22 sessions × 6.5–8h / 4h)
≤ 3 M → D (1d) ≈ ×(20–22) per month × quantity
> 3 M → W (1w) ≈ ×(4–5) per month × quantity
≤ 1 Y → W (1w) ≈ ×52
> 1 Y → M (1M) ≈ ×12 per year × quantity
Notes:
• Ratios for D/W/M are given as ranges because they depend on
**regular session length** (typically ~6.5–8h, not 24h).
• Returned strings can be used with `request.security()` and `input.timeframe`.
Parameters:
tf (string) : series string Selected timeframe (e.g., "D", "240", or timeframe.period).
Returns: series string Suggested lower TF to use for intra‑bar work.
isNewPeriod(tf, offset)
Returns `true` when a new session-aligned period begins, or on the Nth bar of that period.
Parameters:
tf (string) : series string Target higher timeframe (e.g., "D", "W", "M").
offset (simple int) : simple int 0 → checks for the first bar of the new period.
1+ → checks for the N-th bar of the period.
Returns: series bool `true` if the condition is met.
sinceNewPeriod(tf, offset)
Counts how many bars have passed within a higher timeframe (HTF) period.
For daily, weekly, and monthly resolutions, the period is aligned with the trading session.
Parameters:
tf (string) : series string Target parent timeframe (e.g., "60", "D").
offset (simple int) : simple int 0 → Running count for the current period.
1+ → Finalized count for the Nth most recent *completed* period.
Returns: series int Number of bars.
isHigherTF(tf, main)
Returns `true` when the selected timeframe represents a
higher resolution than the active timeframe.
Parameters:
tf (string) : series string Selected timeframe.
main (bool) : series bool When `true`, the comparison is made against the chart's main timeframe
instead of the script's active timeframe. Optional. Defaults to `false`.
Returns: series bool `true` if `tf` > active TF; otherwise `false`.
isActiveTF(tf, main)
Returns `true` when the selected timeframe represents the
exact resolution of the active timeframe.
Parameters:
tf (string) : series string Selected timeframe.
main (bool) : series bool When `true`, the comparison is made against the chart's main timeframe
instead of the script's active timeframe. Optional. Defaults to `false`.
Returns: series bool `true` if `tf` == active TF; otherwise `false`.
isLowerTF(tf, main)
Returns `true` when the selected timeframe represents a
lower resolution than the active timeframe.
Parameters:
tf (string) : series string Selected timeframe.
main (bool) : series bool When `true`, the comparison is made against the chart's main timeframe
instead of the script's active timeframe. Optional. Defaults to `false`.
Returns: series bool `true` if `tf` < active TF; otherwise `false`.
isMultipleTF(tf)
Returns `true` if the selected timeframe (`tf`) is a practical multiple
of the active skript's timeframe. It verifies this by checking if `tf` is a higher timeframe
that has consistently contained more than one bar of the skript's timeframe in recent periods.
The period detection is session-aware.
Parameters:
tf (string) : series string The higher timeframe to check.
Returns: series bool `true` if `tf` is a practical multiple; otherwise `false`.
interpTimestamp(offStart, offEnd, pct)
Calculates a precise absolute timestamp by interpolating within a bar range based on a percentage.
This version works with RELATIVE bar offsets from the current bar.
Parameters:
offStart (int) : series int The relative offset of the starting bar (e.g., 10 for 10 bars ago).
offEnd (int) : series int The relative offset of the ending bar (e.g., 1 for 1 bar ago). Must be <= offStart.
pct (float) : series float The percentage of the bar range to measure (e.g., 50.5 for 50.5%).
Values are clamped to the range.
Returns: series int The calculated, interpolated absolute Unix timestamp in milliseconds.
PineConnectorLibrary "PineConnector"
This library is a comprehensive alert webhook text generator for PineConnector. It contains every possible alert syntax variation from the documentation, along with some debugging functions.
To use it, just import the library (eg. "import ZenAndTheArtOfTrading/PineConnector/1 as pc") and use pc.buy(licenseID) to send an alert off to PineConnector - assuming all your webhooks etc are set up correctly.
View the PineConnector documentation for more information on how to send the commands you're looking to send (all of this library's function names match the documentation).
all()
Usage: pc.buy(pc_id, freq=pc.all())
Returns: "all"
once_per_bar()
Usage: pc.buy(pc_id, freq=pc.once_per_bar())
Returns: "once_per_bar"
once_per_bar_close()
Usage: pc.buy(pc_id, freq=pc.once_per_bar_close())
Returns: "once_per_bar_close"
na0(value)
Checks if given value is either 'na' or 0. Useful for streamlining scripts with float user setting inputs which default values to 0 since na is unavailable as a user input default.
Parameters:
value (float) : The value to check
Returns: True if the given value is 0 or na
getDecimals()
Calculates how many decimals are on the quote price of the current market.
Returns: The current decimal places on the market quote price
truncate(number, decimals)
Truncates the given number. Required params: mumber.
Parameters:
number (float) : Number to truncate
decimals (int) : Decimal places to cut down to
Returns: The input number, but as a string truncated to X decimals
getPipSize(multiplier)
Calculates the pip size of the current market.
Parameters:
multiplier (int) : The mintick point multiplier (1 by default, 10 for FX/Crypto/CFD but can be used to override when certain markets require)
Returns: The pip size for the current market
toWhole(number)
Converts pips into whole numbers. Required params: number.
Parameters:
number (float) : The pip number to convert into a whole number
Returns: The converted number
toPips(number)
Converts whole numbers back into pips. Required params: number.
Parameters:
number (float) : The whole number to convert into pips
Returns: The converted number
debug(txt, tooltip, displayLabel)
Prints to console and generates a debug label with the given text. Required params: txt.
Parameters:
txt (string) : Text to display
tooltip (string) : Tooltip to display (optional)
displayLabel (bool) : Turns on/off chart label (default: off)
Returns: Nothing
order(licenseID, command, symbol, parameters, accfilter, comment, secret, freq, debug)
Generates an alert string. Required params: licenseID, command.
Parameters:
licenseID (string) : Your PC license ID
command (string) : Command to send
symbol (string) : The symbol to trigger this order on
parameters (string) : Other optional parameters to include
accfilter (float) : Optional minimum account balance filter
comment (string) : Optional comment (maximum 20 characters)
secret (string) : Optional secret key (must be enabled in dashboard)
freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
debug (bool) : Turns on/off debug label
Returns: An alert string with valid PC syntax based on supplied parameters
market_order(licenseID, buy, risk, sl, tp, betrigger, beoffset, spread, trailtrig, traildist, trailstep, atrtimeframe, atrperiod, atrmultiplier, atrshift, atrtrigger, symbol, accfilter, comment, secret, freq, debug)
Generates a market entry alert with relevant syntax commands. Required params: licenseID, buy, risk.
Parameters:
licenseID (string) : Your PC license ID
buy (bool) : true=buy/long, false=sell/short
risk (float) : Risk quantity (according to EA settings)
sl (float) : Stop loss distance in pips or price
tp (float) : Take profit distance in pips or price
betrigger (float) : Breakeven will be activated after the position gains this number of pips
beoffset (float) : Offset from entry price. This is the amount of pips you'd like to protect
spread (float) : Enter the position only if the spread is equal or less than the specified value in pips
trailtrig (float) : Trailing stop-loss will be activated after a trade gains this number of pips
traildist (float) : Distance of the trailing stop-loss from current price
trailstep (float) : Moves trailing stop-loss once price moves to favourable by a specified number of pips
atrtimeframe (int) : ATR Trailing Stop timeframe, only updates once per bar close. Options: 1, 5, 15, 30, 60, 240, 1440
atrperiod (int) : ATR averaging period
atrmultiplier (float) : Multiple of ATR to utilise in the new SL computation, default = 1
atrshift (int) : Relative shift of price information, 0 uses latest candle, 1 uses second last, etc. Default = 0
atrtrigger (int) : Activate the trigger of ATR Trailing after market moves favourably by a number of pips. Default = 0 (instant)
symbol (string) : The symbol to trigger this order on (defaults to current symbol)
accfilter (float) : Optional minimum account balance filter
comment (string) : Optional comment (maximum 20 characters)
secret (string) : Optional secret key (must be enabled in dashboard)
freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
debug (bool) : Turns on/off debug label
Returns: A market order alert string with valid PC syntax based on supplied parameters
buy(licenseID, risk, sl, tp, betrigger, beoffset, spread, trailtrig, traildist, trailstep, atrtimeframe, atrperiod, atrmultiplier, atrshift, atrtrigger, symbol, accfilter, comment, secret, freq, debug)
Generates a market buy alert with relevant syntax commands. Required params: licenseID, risk.
Parameters:
licenseID (string) : Your PC license ID
risk (float) : Risk quantity (according to EA settings)
sl (float) : Stop loss distance in pips or price
tp (float) : Take profit distance in pips or price
betrigger (float) : Breakeven will be activated after the position gains this number of pips
beoffset (float) : Offset from entry price. This is the amount of pips you'd like to protect
spread (float) : Enter the position only if the spread is equal or less than the specified value in pips
trailtrig (float) : Trailing stop-loss will be activated after a trade gains this number of pips
traildist (float) : Distance of the trailing stop-loss from current price
trailstep (float) : Moves trailing stop-loss once price moves to favourable by a specified number of pips
atrtimeframe (int) : ATR Trailing Stop timeframe, only updates once per bar close. Options: 1, 5, 15, 30, 60, 240, 1440
atrperiod (int) : ATR averaging period
atrmultiplier (float) : Multiple of ATR to utilise in the new SL computation, default = 1
atrshift (int) : Relative shift of price information, 0 uses latest candle, 1 uses second last, etc. Default = 0
atrtrigger (int) : Activate the trigger of ATR Trailing after market moves favourably by a number of pips. Default = 0 (instant)
symbol (string) : The symbol to trigger this order on (defaults to current symbol)
accfilter (float) : Optional minimum account balance filter
comment (string) : Optional comment (maximum 20 characters)
secret (string) : Optional secret key (must be enabled in dashboard)
freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
debug (bool) : Turns on/off debug label
Returns: A market order alert string with valid PC syntax based on supplied parameters
sell(licenseID, risk, sl, tp, betrigger, beoffset, spread, trailtrig, traildist, trailstep, atrtimeframe, atrperiod, atrmultiplier, atrshift, atrtrigger, symbol, accfilter, comment, secret, freq, debug)
Generates a market sell alert with relevant syntax commands. Required params: licenseID, risk.
Parameters:
licenseID (string) : Your PC license ID
risk (float) : Risk quantity (according to EA settings)
sl (float) : Stop loss distance in pips or price
tp (float) : Take profit distance in pips or price
betrigger (float) : Breakeven will be activated after the position gains this number of pips
beoffset (float) : Offset from entry price. This is the amount of pips you'd like to protect
spread (float) : Enter the position only if the spread is equal or less than the specified value in pips
trailtrig (float) : Trailing stop-loss will be activated after a trade gains this number of pips
traildist (float) : Distance of the trailing stop-loss from current price
trailstep (float) : Moves trailing stop-loss once price moves to favourable by a specified number of pips
atrtimeframe (int) : ATR Trailing Stop timeframe, only updates once per bar close. Options: 1, 5, 15, 30, 60, 240, 1440
atrperiod (int) : ATR averaging period
atrmultiplier (float) : Multiple of ATR to utilise in the new SL computation, default = 1
atrshift (int) : Relative shift of price information, 0 uses latest candle, 1 uses second last, etc. Default = 0
atrtrigger (int) : Activate the trigger of ATR Trailing after market moves favourably by a number of pips. Default = 0 (instant)
symbol (string) : The symbol to trigger this order on (defaults to current symbol)
accfilter (float) : Optional minimum account balance filter
comment (string) : Optional comment (maximum 20 characters)
secret (string) : Optional secret key (must be enabled in dashboard)
freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
debug (bool) : Turns on/off debug label
Returns: A market order alert string with valid PC syntax based on supplied parameters
closeall(licenseID, comment, secret, freq, debug)
Closes all open trades at market regardless of symbol. Required params: licenseID.
Parameters:
licenseID (string) : Your PC license ID
comment (string) : Optional comment to include (max 20 characters)
secret (string) : Optional secret key (must be enabled in dashboard)
freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
debug (bool) : Turns on/off debug label
Returns: The required alert syntax as a string
closealleaoff(licenseID, comment, secret, freq, debug)
Closes all open trades at market regardless of symbol, and turns the EA off. Required params: licenseID.
Parameters:
licenseID (string) : Your PC license ID
comment (string) : Optional comment to include (max 20 characters)
secret (string) : Optional secret key (must be enabled in dashboard)
freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
debug (bool) : Turns on/off debug label
Returns: The required alert syntax as a string
closelong(licenseID, symbol, comment, secret, freq, debug)
Closes all long trades at market for the given symbol. Required params: licenseID.
Parameters:
licenseID (string) : Your PC license ID
symbol (string) : Symbol to act on (defaults to current symbol)
comment (string) : Optional comment to include (max 20 characters)
secret (string) : Optional secret key (must be enabled in dashboard)
freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
debug (bool) : Turns on/off debug label
Returns: The required alert syntax as a string
closeshort(licenseID, symbol, comment, secret, freq, debug)
Closes all open short trades at market for the given symbol. Required params: licenseID.
Parameters:
licenseID (string) : Your PC license ID
symbol (string) : Symbol to act on (defaults to current symbol)
comment (string) : Optional comment to include (max 20 characters)
secret (string) : Optional secret key (must be enabled in dashboard)
freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
debug (bool) : Turns on/off debug label
Returns: The required alert syntax as a string
closelongshort(licenseID, symbol, comment, secret, freq, debug)
Closes all open trades at market for the given symbol. Required params: licenseID.
Parameters:
licenseID (string) : Your PC license ID
symbol (string) : Symbol to act on (defaults to current symbol)
comment (string) : Optional comment to include (max 20 characters)
secret (string) : Optional secret key (must be enabled in dashboard)
freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
debug (bool) : Turns on/off debug label
Returns: The required alert syntax as a string
closelongbuy(licenseID, risk, symbol, comment, secret, freq, debug)
Close all long positions and open a new long at market for the given symbol with given risk/contracts. Required params: licenseID.
Parameters:
licenseID (string) : Your PC license ID
risk (float) : Risk or contracts (according to EA settings)
symbol (string) : Symbol to act on (defaults to current symbol)
comment (string) : Optional comment to include (max 20 characters)
secret (string) : Optional secret key (must be enabled in dashboard)
freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
debug (bool) : Turns on/off debug label
Returns: The required alert syntax as a string
closeshortsell(licenseID, risk, symbol, comment, secret, freq, debug)
Close all short positions and open a new short at market for the given symbol with given risk/contracts. Required params: licenseID, risk.
Parameters:
licenseID (string) : Your PC license ID
risk (float) : Risk or contracts (according to EA settings)
symbol (string) : Symbol to act on (defaults to current symbol)
comment (string) : Optional comment to include (max 20 characters)
secret (string) : Optional secret key (must be enabled in dashboard)
freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
debug (bool) : Turns on/off debug label
Returns: The required alert syntax as a string
newsltplong(licenseID, sl, tp, symbol, accfilter, comment, secret, freq, debug)
Updates the stop loss and/or take profit of any open long trades on the given symbol with the given values. Required params: licenseID, sl and/or tp.
Parameters:
licenseID (string) : Your PC license ID
sl (float) : Stop loss pips or price (according to EA settings)
tp (float) : Take profit pips or price (according to EA settings)
symbol (string) : Symbol to act on (defaults to current symbol)
accfilter (float) : Optional minimum account balance filter
comment (string) : Optional comment to include (max 20 characters)
secret (string) : Optional secret key (must be enabled in dashboard)
freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
debug (bool) : Turns on/off debug label
Returns: The required alert syntax as a string
newsltpshort(licenseID, sl, tp, symbol, accfilter, comment, secret, freq, debug)
Updates the stop loss and/or take profit of any open short trades on the given symbol with the given values. Required params: licenseID, sl and/or tp.
Parameters:
licenseID (string) : Your PC license ID
sl (float) : Stop loss pips or price (according to EA settings)
tp (float) : Take profit pips or price (according to EA settings)
symbol (string) : Symbol to act on (defaults to current symbol)
accfilter (float) : Optional minimum account balance filter
comment (string) : Optional comment to include (max 20 characters)
secret (string) : Optional secret key (must be enabled in dashboard)
freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
debug (bool) : Turns on/off debug label
Returns: The required alert syntax as a string
closelongpct(licenseID, symbol, comment, secret, freq, debug)
Close a percentage of open long positions (according to EA settings). Required params: licenseID.
Parameters:
licenseID (string) : Your PC license ID
symbol (string) : Symbol to act on (defaults to current symbol)
comment (string) : Optional comment to include (max 20 characters)
secret (string) : Optional secret key (must be enabled in dashboard)
freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
debug (bool) : Turns on/off debug label
Returns: The required alert syntax as a string
closeshortpct(licenseID, symbol, comment, secret, freq, debug)
Close a percentage of open short positions (according to EA settings). Required params: licenseID.
Parameters:
licenseID (string) : Your PC license ID
symbol (string) : Symbol to act on (defaults to current symbol)
comment (string) : Optional comment to include (max 20 characters)
secret (string) : Optional secret key (must be enabled in dashboard)
freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
debug (bool) : Turns on/off debug label
Returns: The required alert syntax as a string
closelongvol(licenseID, risk, symbol, comment, secret, freq, debug)
Close all open long contracts on the current symbol until the given risk value is remaining. Required params: licenseID, risk.
Parameters:
licenseID (string) : Your PC license ID
risk (float) : The quantity to leave remaining
symbol (string) : Symbol to act on (defaults to current symbol)
comment (string) : Optional comment to include (max 20 characters)
secret (string) : Optional secret key (must be enabled in dashboard)
freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
debug (bool) : Turns on/off debug label
Returns: The required alert syntax as a string
closeshortvol(licenseID, risk, symbol, comment, secret, freq, debug)
Close all open short contracts on the current symbol until the given risk value is remaining. Required params: licenseID, risk.
Parameters:
licenseID (string) : Your PC license ID
risk (float) : The quantity to leave remaining
symbol (string) : Symbol to act on (defaults to current symbol)
comment (string) : Optional comment to include (max 20 characters)
secret (string) : Optional secret key (must be enabled in dashboard)
freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
debug (bool) : Turns on/off debug label
Returns: The required alert syntax as a string
limit_order(licenseID, buy, price, risk, sl, tp, betrigger, beoffset, spread, trailtrig, traildist, trailstep, atrtimeframe, atrperiod, atrmultiplier, atrshift, atrtrigger, symbol, accfilter, comment, secret, freq, debug)
Generates a limit order alert with relevant syntax commands. Required params: licenseID, buy, price, risk.
Parameters:
licenseID (string) : Your PC license ID
buy (bool) : true=buy/long, false=sell/short
price (float) : Price or pips to set limit order (according to EA settings)
risk (float) : Risk quantity (according to EA settings)
sl (float) : Stop loss distance in pips or price
tp (float) : Take profit distance in pips or price
betrigger (float) : Breakeven will be activated after the position gains this number of pips
beoffset (float) : Offset from entry price. This is the amount of pips you'd like to protect
spread (float) : Enter the position only if the spread is equal or less than the specified value in pips
trailtrig (float) : Trailing stop-loss will be activated after a trade gains this number of pips
traildist (float) : Distance of the trailing stop-loss from current price
trailstep (float) : Moves trailing stop-loss once price moves to favourable by a specified number of pips
atrtimeframe (int) : ATR Trailing Stop timeframe, only updates once per bar close. Options: 1, 5, 15, 30, 60, 240, 1440
atrperiod (int) : ATR averaging period
atrmultiplier (float) : Multiple of ATR to utilise in the new SL computation, default = 1
atrshift (int) : Relative shift of price information, 0 uses latest candle, 1 uses second last, etc. Default = 0
atrtrigger (int) : Activate the trigger of ATR Trailing after market moves favourably by a number of pips. Default = 0 (instant)
symbol (string) : The symbol to trigger this order on (defaults to current symbol)
accfilter (float) : Optional minimum account balance filter
comment (string) : Optional comment (maximum 20 characters)
secret (string) : Optional secret key (must be enabled in dashboard)
freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
debug (bool) : Turns on/off debug label
Returns: A limit order alert string with valid PC syntax based on supplied parameters
buylimit(licenseID, price, risk, sl, tp, betrigger, beoffset, spread, trailtrig, traildist, trailstep, atrtimeframe, atrperiod, atrmultiplier, atrshift, atrtrigger, symbol, accfilter, comment, secret, freq, debug)
Generates a buylimit order alert with relevant syntax commands. Required params: licenseID, price, risk.
Parameters:
licenseID (string) : Your PC license ID
price (float) : Price or pips to set limit order (according to EA settings)
risk (float) : Risk quantity (according to EA settings)
sl (float) : Stop loss distance in pips or price
tp (float) : Take profit distance in pips or price
betrigger (float) : Breakeven will be activated after the position gains this number of pips
beoffset (float) : Offset from entry price. This is the amount of pips you'd like to protect
spread (float) : Enter the position only if the spread is equal or less than the specified value in pips
trailtrig (float) : Trailing stop-loss will be activated after a trade gains this number of pips
traildist (float) : Distance of the trailing stop-loss from current price
trailstep (float) : Moves trailing stop-loss once price moves to favourable by a specified number of pips
atrtimeframe (int) : ATR Trailing Stop timeframe, only updates once per bar close. Options: 1, 5, 15, 30, 60, 240, 1440
atrperiod (int) : ATR averaging period
atrmultiplier (float) : Multiple of ATR to utilise in the new SL computation, default = 1
atrshift (int) : Relative shift of price information, 0 uses latest candle, 1 uses second last, etc. Default = 0
atrtrigger (int) : Activate the trigger of ATR Trailing after market moves favourably by a number of pips. Default = 0 (instant)
symbol (string) : The symbol to trigger this order on (defaults to current symbol)
accfilter (float) : Optional minimum account balance filter
comment (string) : Optional comment (maximum 20 characters)
secret (string) : Optional secret key (must be enabled in dashboard)
freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
debug (bool) : Turns on/off debug label
Returns: A limit order alert string with valid PC syntax based on supplied parameters
selllimit(licenseID, price, risk, sl, tp, betrigger, beoffset, spread, trailtrig, traildist, trailstep, atrtimeframe, atrperiod, atrmultiplier, atrshift, atrtrigger, symbol, accfilter, comment, secret, freq, debug)
Generates a selllimit order alert with relevant syntax commands. Required params: licenseID, price, risk.
Parameters:
licenseID (string) : Your PC license ID
price (float) : Price or pips to set limit order (according to EA settings)
risk (float) : Risk quantity (according to EA settings)
sl (float) : Stop loss distance in pips or price
tp (float) : Take profit distance in pips or price
betrigger (float) : Breakeven will be activated after the position gains this number of pips
beoffset (float) : Offset from entry price. This is the amount of pips you'd like to protect
spread (float) : Enter the position only if the spread is equal or less than the specified value in pips
trailtrig (float) : Trailing stop-loss will be activated after a trade gains this number of pips
traildist (float) : Distance of the trailing stop-loss from current price
trailstep (float) : Moves trailing stop-loss once price moves to favourable by a specified number of pips
atrtimeframe (int) : ATR Trailing Stop timeframe, only updates once per bar close. Options: 1, 5, 15, 30, 60, 240, 1440
atrperiod (int) : ATR averaging period
atrmultiplier (float) : Multiple of ATR to utilise in the new SL computation, default = 1
atrshift (int) : Relative shift of price information, 0 uses latest candle, 1 uses second last, etc. Default = 0
atrtrigger (int) : Activate the trigger of ATR Trailing after market moves favourably by a number of pips. Default = 0 (instant)
symbol (string) : The symbol to trigger this order on (defaults to current symbol)
accfilter (float) : Optional minimum account balance filter
comment (string) : Optional comment (maximum 20 characters)
secret (string) : Optional secret key (must be enabled in dashboard)
freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
debug (bool) : Turns on/off debug label
Returns: A limit order alert string with valid PC syntax based on supplied parameters
stop_order(licenseID, buy, price, risk, sl, tp, betrigger, beoffset, spread, trailtrig, traildist, trailstep, atrtimeframe, atrperiod, atrmultiplier, atrshift, atrtrigger, symbol, accfilter, comment, secret, freq, debug)
Generates a stop order alert with relevant syntax commands. Required params: licenseID, buy, price, risk.
Parameters:
licenseID (string) : Your PC license ID
buy (bool) : true=buy/long, false=sell/short
price (float) : Price or pips to set limit order (according to EA settings)
risk (float) : Risk quantity (according to EA settings)
sl (float) : Stop loss distance in pips or price
tp (float) : Take profit distance in pips or price
betrigger (float) : Breakeven will be activated after the position gains this number of pips
beoffset (float) : Offset from entry price. This is the amount of pips you'd like to protect
spread (float) : Enter the position only if the spread is equal or less than the specified value in pips
trailtrig (float) : Trailing stop-loss will be activated after a trade gains this number of pips
traildist (float) : Distance of the trailing stop-loss from current price
trailstep (float) : Moves trailing stop-loss once price moves to favourable by a specified number of pips
atrtimeframe (int) : ATR Trailing Stop timeframe, only updates once per bar close. Options: 1, 5, 15, 30, 60, 240, 1440
atrperiod (int) : ATR averaging period
atrmultiplier (float) : Multiple of ATR to utilise in the new SL computation, default = 1
atrshift (int) : Relative shift of price information, 0 uses latest candle, 1 uses second last, etc. Default = 0
atrtrigger (int) : Activate the trigger of ATR Trailing after market moves favourably by a number of pips. Default = 0 (instant)
symbol (string) : The symbol to trigger this order on (defaults to current symbol)
accfilter (float) : Optional minimum account balance filter
comment (string) : Optional comment (maximum 20 characters)
secret (string) : Optional secret key (must be enabled in dashboard)
freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
debug (bool) : Turns on/off debug label
Returns: A stop order alert string with valid PC syntax based on supplied parameters
buystop(licenseID, price, risk, sl, tp, betrigger, beoffset, spread, trailtrig, traildist, trailstep, atrtimeframe, atrperiod, atrmultiplier, atrshift, atrtrigger, symbol, accfilter, comment, secret, freq, debug)
Generates a buystop order alert with relevant syntax commands. Required params: licenseID, price, risk.
Parameters:
licenseID (string) : Your PC license ID
price (float) : Price or pips to set limit order (according to EA settings)
risk (float) : Risk quantity (according to EA settings)
sl (float) : Stop loss distance in pips or price
tp (float) : Take profit distance in pips or price
betrigger (float) : Breakeven will be activated after the position gains this number of pips
beoffset (float) : Offset from entry price. This is the amount of pips you'd like to protect
spread (float) : Enter the position only if the spread is equal or less than the specified value in pips
trailtrig (float) : Trailing stop-loss will be activated after a trade gains this number of pips
traildist (float) : Distance of the trailing stop-loss from current price
trailstep (float) : Moves trailing stop-loss once price moves to favourable by a specified number of pips
atrtimeframe (int) : ATR Trailing Stop timeframe, only updates once per bar close. Options: 1, 5, 15, 30, 60, 240, 1440
atrperiod (int) : ATR averaging period
atrmultiplier (float) : Multiple of ATR to utilise in the new SL computation, default = 1
atrshift (int) : Relative shift of price information, 0 uses latest candle, 1 uses second last, etc. Default = 0
atrtrigger (int) : Activate the trigger of ATR Trailing after market moves favourably by a number of pips. Default = 0 (instant)
symbol (string) : The symbol to trigger this order on (defaults to current symbol)
accfilter (float) : Optional minimum account balance filter
comment (string) : Optional comment (maximum 20 characters)
secret (string) : Optional secret key (must be enabled in dashboard)
freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
debug (bool) : Turns on/off debug label
Returns: A stop order alert string with valid PC syntax based on supplied parameters
sellstop(licenseID, price, risk, sl, tp, betrigger, beoffset, spread, trailtrig, traildist, trailstep, atrtimeframe, atrperiod, atrmultiplier, atrshift, atrtrigger, symbol, accfilter, comment, secret, freq, debug)
Generates a sellstop order alert with relevant syntax commands. Required params: licenseID, price, risk.
Parameters:
licenseID (string) : Your PC license ID
price (float) : Price or pips to set limit order (according to EA settings)
risk (float) : Risk quantity (according to EA settings)
sl (float) : Stop loss distance in pips or price
tp (float) : Take profit distance in pips or price
betrigger (float) : Breakeven will be activated after the position gains this number of pips
beoffset (float) : Offset from entry price. This is the amount of pips you'd like to protect
spread (float) : Enter the position only if the spread is equal or less than the specified value in pips
trailtrig (float) : Trailing stop-loss will be activated after a trade gains this number of pips
traildist (float) : Distance of the trailing stop-loss from current price
trailstep (float) : Moves trailing stop-loss once price moves to favourable by a specified number of pips
atrtimeframe (int) : ATR Trailing Stop timeframe, only updates once per bar close. Options: 1, 5, 15, 30, 60, 240, 1440
atrperiod (int) : ATR averaging period
atrmultiplier (float) : Multiple of ATR to utilise in the new SL computation, default = 1
atrshift (int) : Relative shift of price information, 0 uses latest candle, 1 uses second last, etc. Default = 0
atrtrigger (int) : Activate the trigger of ATR Trailing after market moves favourably by a number of pips. Default = 0 (instant)
symbol (string) : The symbol to trigger this order on (defaults to current symbol)
accfilter (float) : Optional minimum account balance filter
comment (string) : Optional comment (maximum 20 characters)
secret (string) : Optional secret key (must be enabled in dashboard)
freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
debug (bool) : Turns on/off debug label
Returns: A stop order alert string with valid PC syntax based on supplied parameters
cancel_neworder(licenseID, order, price, risk, sl, tp, betrigger, beoffset, spread, trailtrig, traildist, trailstep, atrtimeframe, atrperiod, atrmultiplier, atrshift, atrtrigger, symbol, accfilter, comment, secret, freq, debug)
Cancel + place new order template function.
Parameters:
licenseID (string) : Your PC license ID
order (string) : Cancel order type
price (float) : Price or pips to set limit order (according to EA settings)
risk (float) : Risk quantity (according to EA settings)
sl (float) : Stop loss distance in pips or price
tp (float) : Take profit distance in pips or price
betrigger (float) : Breakeven will be activated after the position gains this number of pips
beoffset (float) : Offset from entry price. This is the amount of pips you'd like to protect
spread (float) : Enter the position only if the spread is equal or less than the specified value in pips
trailtrig (float) : Trailing stop-loss will be activated after a trade gains this number of pips
traildist (float) : Distance of the trailing stop-loss from current price
trailstep (float) : Moves trailing stop-loss once price moves to favourable by a specified number of pips
atrtimeframe (int) : ATR Trailing Stop timeframe, only updates once per bar close. Options: 1, 5, 15, 30, 60, 240, 1440
atrperiod (int) : ATR averaging period
atrmultiplier (float) : Multiple of ATR to utilise in the new SL computation, default = 1
atrshift (int) : Relative shift of price information, 0 uses latest candle, 1 uses second last, etc. Default = 0
atrtrigger (int) : Activate the trigger of ATR Trailing after market moves favourably by a number of pips. Default = 0 (instant)
symbol (string) : The symbol to trigger this order on (defaults to current symbol)
accfilter (float) : Optional minimum account balance filter
comment (string) : Optional comment (maximum 20 characters)
secret (string) : Optional secret key (must be enabled in dashboard)
freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
debug (bool) : Turns on/off debug label
Returns: A stop order alert string with valid PC syntax based on supplied parameters
cancellongbuystop(licenseID, price, risk, sl, tp, betrigger, beoffset, spread, trailtrig, traildist, trailstep, atrtimeframe, atrperiod, atrmultiplier, atrshift, atrtrigger, symbol, accfilter, comment, secret, freq, debug)
Cancels all long orders with the specified symbol and places a new buystop order. Required params: licenseID, price, risk.
Parameters:
licenseID (string) : Your PC license ID
price (float) : Price or pips to set limit order (according to EA settings)
risk (float) : Risk quantity (according to EA settings)
sl (float) : Stop loss distance in pips or price
tp (float) : Take profit distance in pips or price
betrigger (float) : Breakeven will be activated after the position gains this number of pips
beoffset (float) : Offset from entry price. This is the amount of pips you'd like to protect
spread (float) : Enter the position only if the spread is equal or less than the specified value in pips
trailtrig (float) : Trailing stop-loss will be activated after a trade gains this number of pips
traildist (float) : Distance of the trailing stop-loss from current price
trailstep (float) : Moves trailing stop-loss once price moves to favourable by a specified number of pips
atrtimeframe (int) : ATR Trailing Stop timeframe, only updates once per bar close. Options: 1, 5, 15, 30, 60, 240, 1440
atrperiod (int) : ATR averaging period
atrmultiplier (float) : Multiple of ATR to utilise in the new SL computation, default = 1
atrshift (int) : Relative shift of price information, 0 uses latest candle, 1 uses second last, etc. Default = 0
atrtrigger (int) : Activate the trigger of ATR Trailing after market moves favourably by a number of pips. Default = 0 (instant)
symbol (string) : The symbol to trigger this order on (defaults to current symbol)
accfilter (float) : Optional minimum account balance filter
comment (string) : Optional comment (maximum 20 characters)
secret (string) : Optional secret key (must be enabled in dashboard)
freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
debug (bool) : Turns on/off debug label
Returns: A stop order alert string with valid PC syntax based on supplied parameters
cancellongbuylimit(licenseID, price, risk, sl, tp, betrigger, beoffset, spread, trailtrig, traildist, trailstep, atrtimeframe, atrperiod, atrmultiplier, atrshift, atrtrigger, symbol, accfilter, comment, secret, freq, debug)
Cancels all long orders with the specified symbol and places a new buylimit order. Required params: licenseID, price, risk.
Parameters:
licenseID (string) : Your PC license ID
price (float) : Price or pips to set limit order (according to EA settings)
risk (float) : Risk quantity (according to EA settings)
sl (float) : Stop loss distance in pips or price
tp (float) : Take profit distance in pips or price
betrigger (float) : Breakeven will be activated after the position gains this number of pips
beoffset (float) : Offset from entry price. This is the amount of pips you'd like to protect
spread (float) : Enter the position only if the spread is equal or less than the specified value in pips
trailtrig (float) : Trailing stop-loss will be activated after a trade gains this number of pips
traildist (float) : Distance of the trailing stop-loss from current price
trailstep (float) : Moves trailing stop-loss once price moves to favourable by a specified number of pips
atrtimeframe (int) : ATR Trailing Stop timeframe, only updates once per bar close. Options: 1, 5, 15, 30, 60, 240, 1440
atrperiod (int) : ATR averaging period
atrmultiplier (float) : Multiple of ATR to utilise in the new SL computation, default = 1
atrshift (int) : Relative shift of price information, 0 uses latest candle, 1 uses second last, etc. Default = 0
atrtrigger (int) : Activate the trigger of ATR Trailing after market moves favourably by a number of pips. Default = 0 (instant)
symbol (string) : The symbol to trigger this order on (defaults to current symbol)
accfilter (float) : Optional minimum account balance filter
comment (string) : Optional comment (maximum 20 characters)
secret (string) : Optional secret key (must be enabled in dashboard)
freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
debug (bool) : Turns on/off debug label
Returns: A stop order alert string with valid PC syntax based on supplied parameters
cancelshortsellstop(licenseID, price, risk, sl, tp, betrigger, beoffset, spread, trailtrig, traildist, trailstep, atrtimeframe, atrperiod, atrmultiplier, atrshift, atrtrigger, symbol, accfilter, comment, secret, freq, debug)
Cancels all short orders with the specified symbol and places a sellstop order. Required params: licenseID, price, risk.
Parameters:
licenseID (string) : Your PC license ID
price (float) : Price or pips to set limit order (according to EA settings)
risk (float) : Risk quantity (according to EA settings)
sl (float) : Stop loss distance in pips or price
tp (float) : Take profit distance in pips or price
betrigger (float) : Breakeven will be activated after the position gains this number of pips
beoffset (float) : Offset from entry price. This is the amount of pips you'd like to protect
spread (float) : Enter the position only if the spread is equal or less than the specified value in pips
trailtrig (float) : Trailing stop-loss will be activated after a trade gains this number of pips
traildist (float) : Distance of the trailing stop-loss from current price
trailstep (float) : Moves trailing stop-loss once price moves to favourable by a specified number of pips
atrtimeframe (int) : ATR Trailing Stop timeframe, only updates once per bar close. Options: 1, 5, 15, 30, 60, 240, 1440
atrperiod (int) : ATR averaging period
atrmultiplier (float) : Multiple of ATR to utilise in the new SL computation, default = 1
atrshift (int) : Relative shift of price information, 0 uses latest candle, 1 uses second last, etc. Default = 0
atrtrigger (int) : Activate the trigger of ATR Trailing after market moves favourably by a number of pips. Default = 0 (instant)
symbol (string) : The symbol to trigger this order on (defaults to current symbol)
accfilter (float) : Optional minimum account balance filter
comment (string) : Optional comment (maximum 20 characters)
secret (string) : Optional secret key (must be enabled in dashboard)
freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
debug (bool) : Turns on/off debug label
Returns: A stop order alert string with valid PC syntax based on supplied parameters
cancelshortselllimit(licenseID, price, risk, sl, tp, betrigger, beoffset, spread, trailtrig, traildist, trailstep, atrtimeframe, atrperiod, atrmultiplier, atrshift, atrtrigger, symbol, accfilter, comment, secret, freq, debug)
Cancels all short orders with the specified symbol and places a selllimit order. Required params: licenseID, price, risk.
Parameters:
licenseID (string) : Your PC license ID
price (float) : Price or pips to set limit order (according to EA settings)
risk (float) : Risk quantity (according to EA settings)
sl (float) : Stop loss distance in pips or price
tp (float) : Take profit distance in pips or price
betrigger (float) : Breakeven will be activated after the position gains this number of pips
beoffset (float) : Offset from entry price. This is the amount of pips you'd like to protect
spread (float) : Enter the position only if the spread is equal or less than the specified value in pips
trailtrig (float) : Trailing stop-loss will be activated after a trade gains this number of pips
traildist (float) : Distance of the trailing stop-loss from current price
trailstep (float) : Moves trailing stop-loss once price moves to favourable by a specified number of pips
atrtimeframe (int) : ATR Trailing Stop timeframe, only updates once per bar close. Options: 1, 5, 15, 30, 60, 240, 1440
atrperiod (int) : ATR averaging period
atrmultiplier (float) : Multiple of ATR to utilise in the new SL computation, default = 1
atrshift (int) : Relative shift of price information, 0 uses latest candle, 1 uses second last, etc. Default = 0
atrtrigger (int) : Activate the trigger of ATR Trailing after market moves favourably by a number of pips. Default = 0 (instant)
symbol (string) : The symbol to trigger this order on (defaults to current symbol)
accfilter (float) : Optional minimum account balance filter
comment (string) : Optional comment (maximum 20 characters)
secret (string) : Optional secret key (must be enabled in dashboard)
freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
debug (bool) : Turns on/off debug label
Returns: A stop order alert string with valid PC syntax based on supplied parameters
cancellong(licenseID, symbol, accfilter, comment, secret, freq, debug)
Cancels all pending long orders with the specified symbol. Required params: licenseID.
Parameters:
licenseID (string) : Your PC license ID
symbol (string) : Symbol to act on (defaults to current symbol)
accfilter (float) : Optional minimum account balance filter
comment (string) : Optional comment to include (max 20 characters)
secret (string) : Optional secret key (must be enabled in dashboard)
freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
debug (bool) : Turns on/off debug label
Returns: A cancel long alert command
cancelshort(licenseID, symbol, accfilter, comment, secret, freq, debug)
Cancels all pending short orders with the specified symbol. Required params: licenseID.
Parameters:
licenseID (string) : Your PC license ID
symbol (string) : Symbol to act on (defaults to current symbol)
accfilter (float) : Optional minimum account balance filter
comment (string) : Optional comment to include (max 20 characters)
secret (string) : Optional secret key (must be enabled in dashboard)
freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
debug (bool) : Turns on/off debug label
Returns: A cancel short alert command
newsltpbuystop(licenseID, sl, tp, symbol, accfilter, comment, secret, freq, debug)
Updates the stop loss and/or take profit of any pending buy stop orders on the given symbol. Required params: licenseID, sl and/or tp.
Parameters:
licenseID (string) : Your PC license ID
sl (float) : Stop loss pips or price (according to EA settings)
tp (float) : Take profit pips or price (according to EA settings)
symbol (string) : Symbol to act on (defaults to current symbol)
accfilter (float) : Optional minimum account balance filter
comment (string) : Optional comment to include (max 20 characters)
secret (string) : Optional secret key (must be enabled in dashboard)
freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
debug (bool) : Turns on/off debug label
Returns: The required alert syntax as a string
newsltpbuylimit(licenseID, sl, tp, symbol, accfilter, comment, secret, freq, debug)
Updates the stop loss and/or take profit of any pending buy limit orders on the given symbol. Required params: licenseID, sl and/or tp.
Parameters:
licenseID (string) : Your PC license ID
sl (float) : Stop loss pips or price (according to EA settings)
tp (float) : Take profit pips or price (according to EA settings)
symbol (string) : Symbol to act on (defaults to current symbol)
accfilter (float) : Optional minimum account balance filter
comment (string) : Optional comment to include (max 20 characters)
secret (string) : Optional secret key (must be enabled in dashboard)
freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
debug (bool) : Turns on/off debug label
Returns: The required alert syntax as a string
newsltpsellstop(licenseID, sl, tp, symbol, accfilter, comment, secret, freq, debug)
Updates the stop loss and/or take profit of any pending sell stop orders on the given symbol. Required params: licenseID, sl and/or tp.
Parameters:
licenseID (string) : Your PC license ID
sl (float) : Stop loss pips or price (according to EA settings)
tp (float) : Take profit pips or price (according to EA settings)
symbol (string) : Symbol to act on (defaults to current symbol)
accfilter (float) : Optional minimum account balance filter
comment (string) : Optional comment to include (max 20 characters)
secret (string) : Optional secret key (must be enabled in dashboard)
freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
debug (bool) : Turns on/off debug label
Returns: The required alert syntax as a string
newsltpselllimit(licenseID, sl, tp, symbol, accfilter, comment, secret, freq, debug)
Updates the stop loss and/or take profit of any pending sell limit orders on the given symbol. Required params: licenseID, sl and/or tp.
Parameters:
licenseID (string) : Your PC license ID
sl (float) : Stop loss pips or price (according to EA settings)
tp (float) : Take profit pips or price (according to EA settings)
symbol (string) : Symbol to act on (defaults to current symbol)
accfilter (float) : Optional minimum account balance filter
comment (string) : Optional comment to include (max 20 characters)
secret (string) : Optional secret key (must be enabled in dashboard)
freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
debug (bool) : Turns on/off debug label
Returns: The required alert syntax as a string
eaoff(licenseID, secret, freq, debug)
Turns the EA off. Required params: licenseID.
Parameters:
licenseID (string) : Your PC license ID
secret (string) : Optional secret key (must be enabled in dashboard)
freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
debug (bool) : Turns on/off debug label
Returns: The required alert syntax as a string
eaon(licenseID, secret, freq, debug)
Turns the EA on. Required params: licenseID.
Parameters:
licenseID (string) : Your PC license ID
secret (string) : Optional secret key (must be enabled in dashboard)
freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
debug (bool) : Turns on/off debug label
Returns: The required alert syntax as a string






















