INVITE-ONLY SCRIPT
已更新 Pro Bollinger Bands Strategy [Breno]

This strategy excels in highly volatile financial instruments, including cryptocurrencies, high-beta stocks, commodity futures, and certain exchange-traded funds (ETFs) that exhibit clear mean-reversion characteristics around their Bollinger Bands. The system's ability to utilize scaling (position averaging) and an ATR-based stop loss makes it particularly effective in markets with significant price swings, allowing the trader to capture profits from price extremes while managing increased volatility-related risk.
Core Strategy Logic
This Strategy implements a comprehensive trend-following and mean-reversion strategy primarily leveraging the Bollinger Bands (BB) indicator for entry and exit signals, complemented by an Average True Range (ATR)-based Stop Loss mechanism and an optional EMA filter. It is designed with robust features for capital management, including configurable leverage and a sophisticated position averaging (scaling) system.
Key Features and Customization
Bollinger Bands & Filters -
Risk and Capital Management -
Core Strategy Logic
This Strategy implements a comprehensive trend-following and mean-reversion strategy primarily leveraging the Bollinger Bands (BB) indicator for entry and exit signals, complemented by an Average True Range (ATR)-based Stop Loss mechanism and an optional EMA filter. It is designed with robust features for capital management, including configurable leverage and a sophisticated position averaging (scaling) system.
- Long Entry: A long position is initiated when the closing price crosses over the Lower Bollinger Band (ta.crossover(close,lowerBB)). This signals a potential mean-reversion opportunity following a price dip.
- Short Entry: A short position is initiated when the closing price crosses under the Upper Bollinger Band (ta.crossunder(close,upperBB)). (Note: Short entries are disabled by default in the script inputs).
- Exit Conditions (Profit Target): Long positions aim to exit upon interaction with the Upper Bollinger Band. Users can select from three exit methods:
- "Close When Touch": Exits when close≥upperBB.
- "Close Above then Below": Exits when the previous close was above the upper band, and the current close is below it (a reversal signal).
- "High Above": Exits when high>upperBB. The strategy features an optional profitOnly setting, which restricts all exits to only occur if the trade is currently in profit (i.e., close is above the strategy.position_avg_price for longs).
- "Close When Touch": Exits when close≥upperBB.
Key Features and Customization
Bollinger Bands & Filters -
- Customizable BB Parameters: The Length and Deviation of the Bollinger Bands are fully adjustable, allowing users to fine-tune the sensitivity of the entry and exit signals.
- Optional EMA Filter: An optional EMA Filter can be enabled to align entries with the prevailing trend, where a Long entry is only permitted if close≥EMA(EmaFilterRange).
Risk and Capital Management -
- Equity Allocation: Position size is dynamically calculated based on a Percentage of Equity (capitalPerc) combined with the set Leverage multiplier.
- Dynamic Stop Loss (ATR-Based):
An optional Stop Loss (SL) is calculated using a multiple (slAtrInput) of the Average True Range (ATR).
The SL is set relative to the entry price upon trade activation, providing a volatility-adjusted risk management layer. - Position Averaging (Scaling): The script supports the addition of multiple units (pyramiding) to an existing position based on three user-selected criteria:
- "No": No averaging.
- "Percent": Adds to the position if the price has dropped by a set percentage (addPct) from the average price.
- "ATR": Adds to the position if the current price is significantly below a calculated ATR-based support level from the average price.
- "No": No averaging.
版本注释
This strategy excels in highly volatile financial instruments, including cryptocurrencies, high-beta stocks, commodity futures, and certain exchange-traded funds (ETFs) that exhibit clear mean-reversion characteristics around their Bollinger Bands. The system's ability to utilize scaling (position averaging) and an ATR-based stop loss makes it particularly effective in markets with significant price swings, allowing the trader to capture profits from price extremes while managing increased volatility-related risk.Core Strategy Logic
This Strategy implements a comprehensive trend-following and mean-reversion strategy primarily leveraging the Bollinger Bands (BB) indicator for entry and exit signals, complemented by an Average True Range (ATR)-based Stop Loss mechanism and an optional EMA filter. It is designed with robust features for capital management, including configurable leverage and a sophisticated position averaging (scaling) system.
- Long Entry: A long position is initiated when the closing price crosses over the Lower Bollinger Band (ta.crossover(close,lowerBB)). This signals a potential mean-reversion opportunity following a price dip.
- Short Entry: A short position is initiated when the closing price crosses under the Upper Bollinger Band.
- Exit Conditions (Profit Target): Long positions aim to exit upon interaction with the Upper Bollinger Band. Users can select from three exit methods:
- "Close When Touch": Exits when close≥upperBB.
- "Close Above then Below": Exits when the previous close was above the upper band, and the current close is below it (a reversal signal).
- "High Above": Exits when high>upperBB. The strategy features an optional profitOnly setting, which restricts all exits to only occur if the trade is currently in profit.
- "Close When Touch": Exits when close≥upperBB.
Key Features and Customization
Bollinger Bands & Filters -
- Customizable BB Parameters: The Length and Deviation of the Bollinger Bands are fully adjustable, allowing users to fine-tune the sensitivity of the entry and exit signals.
- Optional EMA Filter: An optional EMA Filter can be enabled to align entries with the prevailing trend, where a Long entry is only permitted if close≥EMA(EmaFilterRange).
Risk and Capital Management -
- Equity Allocation: Position size is dynamically calculated based on a Percentage of Equity combined with the set Leverage multiplier.
- Dynamic Stop Loss (ATR-Based):
An optional Stop Loss (SL) is calculated using a multiple (slAtrInput) of the Average True Range (ATR).
The SL is set relative to the entry price upon trade activation, providing a volatility-adjusted risk management layer. - Position Averaging (Scaling): The script supports the addition of multiple units (pyramiding) to an existing position based on three user-selected criteria:
- "No": No averaging.
- "Percent": Adds to the position if the price has dropped by a set percentage (addPct) from the average price.
- "ATR": Adds to the position if the current price is significantly below a calculated ATR-based support level from the average price.
- "No": No averaging.
仅限邀请脚本
只有作者授权的用户才能访问此脚本。您需要申请并获得使用许可。通常情况下,付款后即可获得许可。更多详情,请按照下方作者的说明操作,或直接联系brenosilver。
TradingView不建议您付费购买或使用任何脚本,除非您完全信任其作者并了解其工作原理。您也可以在我们的社区脚本找到免费的开源替代方案。
作者的说明
Become a member of our Patreon to get Full access to all our private scripts:
https://patreon.com/BrenoAlphaScripts?utm_medium=unknown&utm_source=join_link&utm_campaign=creatorshare_creator&utm_content=copyLink
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。
仅限邀请脚本
只有作者授权的用户才能访问此脚本。您需要申请并获得使用许可。通常情况下,付款后即可获得许可。更多详情,请按照下方作者的说明操作,或直接联系brenosilver。
TradingView不建议您付费购买或使用任何脚本,除非您完全信任其作者并了解其工作原理。您也可以在我们的社区脚本找到免费的开源替代方案。
作者的说明
Become a member of our Patreon to get Full access to all our private scripts:
https://patreon.com/BrenoAlphaScripts?utm_medium=unknown&utm_source=join_link&utm_campaign=creatorshare_creator&utm_content=copyLink
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。