OPEN-SOURCE SCRIPT

4H Bollinger Breakout Strategy

1 200
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提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。