OPEN-SOURCE SCRIPT

MTF Bollinger Bands Trend Stop

874
Overview:
The "MTF Bollinger Bands Trend Stop" is an overlay indicator that uses multi-timeframe (MTF) Bollinger Bands to identify trends and provide dynamic stop levels. It helps traders follow trends and spot potential reversals by plotting a trend-following stop line and marking key breakout points on the chart.
Key Features:
Multi-Timeframe Analysis: Calculates Bollinger Bands on a user-defined higher timeframe (e.g., 1H, 4H) while overlaying them on your current chart.

Trend Detection: Determines trend direction (up or down) based on price crossing the upper or lower Bollinger Bands.

Dynamic Stop Line: Plots a stop level that adjusts with the trend, using a buffer based on a "Money Risk" factor.

Reversal Signals: Highlights trend changes with coloured circles when price crosses the buffered bands.

How It Works:
Inputs:
Resolution: Choose the timeframe for calculations (e.g., "60" for 1-hour).

Period (20): Length of the moving average for Bollinger Bands.

Standard Deviation (2): Width of the bands.

Money Risk (1.0): Adjusts the buffer size around the bands (higher values widen the buffer).

Calculations:
Computes Bollinger Bands (middle, upper, lower) on the selected timeframe.

Trend is set to +1 (up) if price crosses above the upper band, or -1 (down) if below the lower band.

Bands are adjusted to prevent retracing against the trend, and a buffer is added based on Money Risk.

Output:
Stop Line: A cross-style line shows the stop level—blue (uptrend, lower band) or purple (downtrend, upper band).

Trend Change Signals: Blue circles mark uptrend starts (price crosses above upper band), purple circles mark downtrend starts (price crosses below lower band).

How to Use:
Add the indicator to your chart and set the desired timeframe (e.g., "240" for 4H).

Watch the stop line: In an uptrend, it tracks below price as a trailing stop; in a downtrend, it sits above price.

Look for circles to signal potential trend shifts—blue for bullish, purple for bearish.

Adjust "Money Risk" to widen/tighten the stop buffer based on your risk tolerance.

Practical Application:
Use as a trailing stop to lock in profits during strong trends.

Combine with other indicators to confirm reversals signalled by the circles.

Best suited for trending markets; test on your preferred timeframe and asset.

Penafian

Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.