INVITE-ONLY SCRIPT

Bollinger Scalper System(BB剥头皮)

107
Strategy Overview: Bollinger Band Scalper
This script implements a mean-reversion scalping strategy designed for TradingView's Pine Script™ v5. It generates trading signals by identifying breakouts from a Bollinger Band basis line, confirmed by momentum from the Awesome Oscillator (AO). The strategy includes configurable time filters for backtesting specific sessions and robust risk management features.

Core Trading Logic
Long Entry: Triggered when a fast EMA crosses above the Bollinger Band basis line, the price closes above the basis, and the Awesome Oscillator is positive and accelerating upward.

Short Entry: Triggered when a fast EMA crosses below the Bollinger Band basis line, the price closes below the basis, and the Awesome Oscillator is negative and accelerating downward.

Filters: Toggleable filters allow signals to be refined using the Bollinger Band boundaries and a "squeeze" condition, which identifies periods of low volatility likely to precede significant price moves.

Key Features & Configuration
Backtest Date Range: Defines a specific period for strategy validation, ensuring tests are conducted on relevant market data.

Trading Session Window: Restricts trade entry to specific intraday hours (e.g., 7:00 AM to 3:10 PM), allowing the strategy to focus on the most liquid or favorable market hours.

Risk Management: Implements a fixed percentage-based stop-loss for both long and short positions to manage downside risk.

Customizable Indicators:

Bollinger Bands: Configurable length, source, standard deviation multiplier, and choice between EMA or SMA for the basis line.

Awesome Oscillator: Uses the difference between two simple moving averages of the median price (hl2) to gauge market momentum.

Squeeze Detection: Measures the relative width of the Bollinger Bands to identify periods of consolidation (squeeze) and subsequent expansion.

Visualization
The script provides clear visual cues on the chart:

Plots the Bollinger Bands and the fast EMA line.

Uses up/down arrows to mark exact entry signals.

Colors the Bollinger Band area to indicate the squeeze state (blue for squeezed, white for expanded), offering an immediate visual assessment of market conditions.

This strategy is ideal for traders looking to automate a systematic approach to capturing short-term mean-reversion moves within the context of broader volatility breakouts. 策略概述:布林带剥头皮策略
本脚本用于TradingView的Pine Script™ v5,实现了一个均值回归的短线(剥头皮)交易策略。该策略通过识别价格对布林带中轨的突破来生成交易信号,并利用Awesome Oscillator (AO) 的动量进行确认。它包含可配置的回测时间过滤器和健全的风险管理功能。

核心交易逻辑
多头入场条件: 当快速EMA上穿布林带中轨、收盘价位于中轨之上,且Awesome Oscillator为正值并加速向上时,触发买入信号。

空头入场条件: 当快速EMA下穿布林带中轨、收盘价位于中轨之下,且Awesome Oscillator为负值并加速向下时,触发卖出信号。

信号过滤: 策略提供了可开关的过滤器,包括使用布林带上下轨进行过滤,以及使用“挤压”条件来识别低波动期(通常预示着即将到来的大幅波动),以优化信号质量。

主要功能与配置
回测时间范围: 允许用户设定策略回测的特定起止日期,确保在相关的历史数据上进行验证。

交易时段窗口: 可将交易限制在一天内的特定小时和分钟(例如,早上7点至下午3点10分),专注于市场流动性最高或最有利的时段进行交易。

风险管理: 为多头和空头头寸分别设置了基于固定百分比的止损,以严格控制下行风险。

可自定义指标:

布林带: 可调整长度、价格源、标准差乘数,并可选择使用EMA或SMA作为中轨。

Awesome Oscillator (AO): 使用中间价(hl2)的两条简单移动平均线的差值来衡量市场动量。

挤压探测: 通过衡量布林带的相对宽度来识别市场盘整期(挤压)和之后的扩张期。

可视化
脚本在图表上提供了清晰直观的视觉提示:

绘制了布林带和快速EMA线。

使用向上/向下的箭头标记精确的入场信号点。

根据布林带的挤压状态(蓝色表示挤压,白色表示扩张)对带状区域进行颜色填充,便于交易者快速评估市场状况。

该策略非常适合希望自动执行系统化方法的交易者,旨在捕捉更广泛的波动性突破背景下的短期均值回归行情。

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.