OPEN-SOURCE SCRIPT

4H Bollinger Breakout Strategy

644
This strategy leverages Bollinger Bands on the 4-hour timeframe for long and short trades in trending or ranging markets. Entries trigger on BB breakouts with optional filters for volume, trend, and RSI. Exits occur on opposite BB crosses. Customizable for long-only, short-only, or indicator mode via code comments. Supports forex, stocks, or crypto with full equity allocation and 0.1% commission.

Length (Default: 20): Period for BB basis and std dev; shorter for sensitivity, longer for smoothing.

Basis MA Type (Default: SMA): Selects MA for middle band (SMA, EMA, etc.); EMA for faster response.

Source (Default: Close): Price input for calculations; use close for standard accuracy.

StdDev Multiplier (Default: 1.8): Band width control; higher for fewer signals, lower for more.

Offset (Default: 0): Shifts BB plots; typically unchanged.

Use Filters (Default: True): Applies volume, trend, RSI checks to filter signals.

Volume MA Length (Default: 20): For volume filter (long: >105% avg, short: >120%).

Trend MA Length (Default: 80): SMA for trend filter (long: above MA, short: below).

RSI Length (Default: 14): For short filter (entry if RSI <85).

Use Long/Short Signals (Defaults: True): Toggles directions; long entry on lower BB crossover, short on upper crossunder.

Visuals: BB plots (blue basis, red upper, green lower), orange trend MA, filled background.

Labels/Alerts: Green/red for long entry/exit, yellow/purple for short; alert conditions included.

免責聲明

這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。