Strategy · Pine Script v5 · On the chart

H4 布林ATR型態多單策略

by ericwu13

This strategy plots Bollinger Bands on the price chart and enters long only when flat.

View on GitHub

GitHub stars3on the repository
Pine versionv5runs as is
Lines of code50
Settings5inputs
LicenceNone stated
Last update3 days ago27 Oct 2026

Add It to Your TradingView Chart

  1. 1Copy the scriptPress Copy script above. It reads the file straight from GitHub.
  2. 2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
  3. 3Paste over the templateCreate a new strategy, select all of the template text and paste. Press Save and give it a name.
  4. 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

H4 布林ATR型態多單策略 buys on a strong bullish close above the middle band or on a small-body pullback that tags the middle band with a long lower wick. The stop sits below the signal bar by a multiple of ATR, and the take profit tracks just under the upper band by another ATR multiple. Length, band width, ATR length, and both multiples are adjustable. It does not add to an open long and has no short rules.

Details

Published by

ericwu13 on GitHub

Draws

On the price chart

Markets

Indices

Timeframes

H4 and above

Risk Notes

No repainting, lookahead or stacked entries were found in its code or README. That says nothing about how well it works: test it first.

Settings

The inputs you can change from the gear icon on the chart. Defaults are the author's.

SettingTypeDefaultVariable
布林通道期數int20length
布林通道標準差float2.0mult
ATR期數int14atr_length
停損ATR倍數float1.0sl_mult
停利ATR倍數float0.5tp_mult
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.

Similar Pine Scripts

BBPullback

by hasnocool
106 stars

This strategy executes pullback trades based on internally computed Bollinger Bands and candle price action directly on the main price chart. It tracks breakout and pullback states to trigger long and short entries. Users can select among three distinct take p

Strategy v5 Volatility & bandsMean reversion
Updated 2 years ago · GPL-3.0 GitHub repository of BBPullback

A strategy that first classifies the market using ADX and a Bollinger-inside-Keltner squeeze check, then switches between two sub-strategies. In ranging conditions it fades asymmetric Bollinger Band extremes with a 200 EMA trend filter. In trending conditions

Strategy v6 Mean reversionBreakout
Updated 8 days ago · GPL-3.0 GitHub repository of Hierarchical HTS v6 Markov-Proxy Regime Switcher
1 stars

This overlay strategy combines an AlphaTrend core with kinematic, Bayesian, and mean-reversion models, plus harmonic, classical, and candlestick pattern engines. It plots consolidation zones, volume-profile points of control, pattern lines, and forward forecas

Strategy v5 TrendCandlestick patterns Repaints
Updated 2 days ago · None stated GitHub repository of JAT+BSM Pro Extended

More Volatility & bands scripts

Related on ForexR

Trade Your Charts With a Regulated Broker

Compare brokers that connect to TradingView, with spreads, minimum deposits and leverage side by side.

Compare brokers