A strategy that looks for a volatility squeeze using a normalised Bollinger Band width, then waits for rising linear regression slope momentum and a break above recent resistance before entering.
1Copy the scriptPress Copy script above. It reads the file straight from GitHub.
2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
3Paste over the templateCreate a new strategy, select all of the template text and paste. Press Save and give it a name.
4Add it to the chartPress Add to chart. The trades and results appear in the Strategy Tester tab; adjust the settings with the gear icon.
Source Code
The code stays on GitHub. The author has not published this script under an open licence, so ForexR does not show its code. Copy script reads the file straight from GitHub into your clipboard, so you can still try it on your own chart. Ask the author before reusing the code anywhere else.
Overview
Exits use an ATR-multiple stop loss, an optional reward-to-risk take profit and a MACD histogram fade. Position size is fixed or set by risk percent, and trading pauses after a run of consecutive losses. Comments and labels are partly in Chinese.
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
BB 周期
int
20
bb_len
BB 倍数
float
2.0
bb_mult
BBZ 归一化窗口
int
200
bbz_lookback
压缩阈值 (bbz < ?)
float
-0.8
bbz_threshold
线性回归周期
int
20
lr_len
斜率归一化窗口
int
100
slope_lookback
动量阈值 (norm_slope > ?)
float
0.8
slope_thresh
阻力回看K线数
int
20
res_lookback
ATR 周期
int
14
atr_len
止损 ATR 倍数
float
1.5
stop_atr_mult
止盈 R:R (0=关闭)
float
2.0
rr_ratio
每笔风险% (0=固定仓位)
float
0.0
risk_pct
Show all 18 settings
Setting
Type
Default
Variable
固定仓位(BTC)
float
0.01
fixed_qty
连续亏损暂停阈值
int
3
max_consec_loss
暂停K线数
int
24
pause_bars
MACD 快线
int
12
macd_fast
MACD 慢线
int
26
macd_slow
MACD 信号线
int
9
macd_sig
Third-party code. ForexR did not write, test or endorse this script, and the summary above was generated automatically from its code and README. Indicators describe the past, and a strategy's backtest can look better than live trading, especially when a script repaints. Check it in the Strategy Tester and on a demo account before you rely on it.
Calculates standard Bollinger Bands and identifies band expansion breakouts where upper and lower bands move in opposite directions. It enters long positions when price breaks above the upper band with a high candle body percentage, and enters short positions
This strategy plots VWMA-based Bollinger bands on the 1-minute ES futures price chart for volatility analysis and potential breakout identification. It calculates dynamic long and short stop loss and take profit levels using percentage inputs relative to entry
This strategy detects price breakouts above rolling highest highs or below lowest lows over a customizable lookback period. It includes optional volume spike and ATR volatility threshold filters, along with bar confirmation rules. Positions are taken upon conf
This price-chart strategy plots a simple moving average and upper and lower bands built from the standard deviation of close, scaled by separate offset inputs. It enters a fixed quantity long when close crosses above the upper band and a fixed quantity short w
2 Candles Inside ATR is an overlay script that measures volatility compression across two consecutive candles. It calculates a smoothed Average True Range (ATR) and compares it against the combined high and low range of the current and previous bars. When the
This strategy trades long breakouts of a fast and a slow moving average on the price chart. It opens a long position when price crosses above either average, using a percentage of equity as size. It reduces the position by a set share when the high reaches the