OPEN-SOURCE SCRIPT
MTF Bollinger Bands Trend Stop

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.
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.
オープンソーススクリプト
TradingViewの精神に則り、この作者はスクリプトのソースコードを公開しているので、その内容を理解し検証することができます。作者に感謝です!無料でお使いいただけますが、このコードを投稿に再利用する際にはハウスルールに従うものとします。
免責事項
これらの情報および投稿は、TradingViewが提供または保証する金融、投資、取引、またはその他の種類のアドバイスや推奨を意図したものではなく、またそのようなものでもありません。詳しくは利用規約をご覧ください。
オープンソーススクリプト
TradingViewの精神に則り、この作者はスクリプトのソースコードを公開しているので、その内容を理解し検証することができます。作者に感謝です!無料でお使いいただけますが、このコードを投稿に再利用する際にはハウスルールに従うものとします。
免責事項
これらの情報および投稿は、TradingViewが提供または保証する金融、投資、取引、またはその他の種類のアドバイスや推奨を意図したものではなく、またそのようなものでもありません。詳しくは利用規約をご覧ください。