Custom Indicator · BOLL Advanced Strategy

  1. What is BOLL?

Bollinger Bands (BOLL) are known as the “King of Trends and Volatility” in technical analysis, esteemed by traders for their precise ability to capture trends and flexibly reflect volatility. Especially in the high-volatility market of cryptocurrencies, it serves as the “ace indicator” guiding investors’ trading decisions. With rapid market fluctuations and unpredictable ranges, ordinary indicators struggle to accurately grasp trends, while Bollinger Bands, with their dynamic upper and lower bands and mean reversion theory, help investors identify trend breakouts, seize volatility opportunities, and assess overbought and oversold areas.

Unlike traditional fixed interval indicators, Bollinger Bands have the advantage of being “market-responsive”. They can adjust in real time with market fluctuations, making them suitable for following breakouts in trending markets, as well as cleverly adapting to reversal operations in ranging markets. In the cryptocurrency space, they are regarded as a core reference tool by many professional quantitative strategies and short-term traders. High volatility brings high returns and high risks, and the significance of Bollinger Bands lies in helping traders accurately grasp market sentiment and effectively control risk.

  1. Components: The basic structure of BOLL Bollinger Bands (BOLL) primarily serve to measure price highs and lows as well as market volatility. BOLL consists of the following three key components: ●Middle Band (SMA, Simple Moving Average) The middle band is a simple moving average line over a certain time period, commonly set as a 20-day moving average. It reflects the trend of the average price within that period and serves as the calculation benchmark for the upper and lower bands of the Bollinger Bands. ●Upper Band Upper Band = SMA + k × Standard Deviation (SD). It represents the price’s pressure zone, usually regarded as the overbought area. ●Lower Band Lower band = SMA - k × Standard Deviation (SD). It represents the support area for the price and is often seen as an oversold zone. Among them, the k value is the width adjustment factor of the Bollinger Bands, usually set to 2, with the aim of capturing 95% of the price fluctuation range.

  2. Basic Principle: How BOLL Works The core theory of Bollinger Bands is based on the concepts of normal distribution and standard deviation in statistics. Prices tend to move around the mean in the short term, and most price fluctuations (typically 95%) occur between the upper and lower bands. Therefore, Bollinger Bands not only reflect the trend of prices but also provide references for support and resistance. ● Contraction (Narrowing): When market volatility decreases and the standard deviation approaches a lower level, the width of the Bollinger Bands will significantly contract, which often indicates that the market is entering a low-volatility period, and a sharp price breakout may follow. ● Expansion: When the market experiences significant fluctuations and the standard deviation increases, the width of the Bollinger Bands expands, which usually reflects a substantial market volatility and the potential for a clear trend to develop. ● Touching the Bands: When the price breaks through the upper or lower band, it may indicate that the market is entering overbought or oversold territory. This is one of the important signals of the Bollinger Bands.

  3. Characteristics and Advantages: The Applicability of BOLL Bollinger Bands are a widely applicable technical tool that can be used to determine trends as well as for support and resistance assessment in volatile markets. ● In trending markets: Bollinger Bands help capture accelerated fluctuations after price breaks out of a range, thus assisting traders in following the trend. ● In a volatile market: Bollinger Bands can effectively delineate the support and resistance zones for prices, providing directional judgment for short-term trading.

  4. Application Scenarios: The Practical Uses of BOLL The Bollinger Bands are widely used in the following scenarios due to their flexibility: ● Breakthrough and trend signal observation: When the price clearly breaks above the upper band, it often indicates a bullish trend; conversely, when the price falls below the lower band, it may represent a bearish signal. ● Defining the oscillation range: During the consolidation phase, prices fluctuate between the upper and lower bands, and the Bollinger Bands can help traders identify buying and selling opportunities within the range. ●Volatility Exploration: By observing the changes in the Bollinger Band width, traders can assess the states of volatility expansion and contraction, and position themselves for potential market movements during low volatility periods.

  5. Technical Logic: Characteristics of BOLL’s Structure The core feature of the Bollinger Bands lies in its dynamic nature, meaning it adjusts in real-time with price changes, reflecting the latest market fluctuations. This characteristic makes it more sensitive compared to fixed-range indicators such as the RSI overbought/oversold zones. In addition, BOLL has the following two important logics: ● Mean Reversion: When the price deviates from the midline, the market tends to revert to the average value. ●Volatility Capture: The expansion and contraction of the upper and lower bounds provide significant guidance on price volatility changes.

  6. BOLL Signal System Although Bollinger Bands have many user-friendly signals, combining them with other indicators in actual trading can create a more precise trading system. The following is an advanced strategy based on the combination of Bollinger Bands and signals.

  7. KD crossover signal The KD indicator is widely used in quantitative trading due to its sensitivity to price overbought and oversold conditions and the clarity of its signals. Combining the KD crossover signals with the Bollinger Bands range can effectively improve trading judgments. For example: ●KD Golden Cross: When the K value and D value rise from a low position and form a golden cross, while the price is at the lower Bollinger Band or breaks through the middle band, it indicates that the oversold pressure is gradually being released and a rebound is on the way, which can be considered a short-term buy signal. ●KD Death Cross: When the K value and D value are descending at a high level and form a death cross, while the price is at the upper Bollinger Band or falls below the middle band, it indicates that the overbought condition is about to correct, which can serve as a potential sell signal. Based on the Bollinger Bands range definition, the KD signal can further confirm the strength of price pullbacks or the continuation of trends, providing dual validation for investment decisions.

  8. Cross the Middle Track Signal The middle band of the Bollinger Bands (Simple Moving Average, SMA) is the benchmark line for observing the medium to long-term trend of prices and is also an important boundary for price reversal and trend acceleration. Paying attention to the price’s crossing actions relative to the middle band can effectively capture signals of the initial strengthening or weakening of a trend: ●Breaking below the middle track: When the price falls below the middle track accompanied by an increase in trading volume, it indicates that the price has entered a weak trend, and there is a possibility of entering a consolidation or further downward phase. At this time, combined with the KD death cross signal, it can amplify the confirmation effect of the weakening trend. ●Breakthrough of the Middle Track: When the price breaks above the middle track accompanied by an increase in trading volume, it indicates that the price has entered a bullish trend and may form a new upward movement range. At this point, combining with the KD golden cross signal can enhance the strength of trend confirmation. The middle track serves as the core intersection of “trend switching” and “support and resistance.” By combining the interactive analysis of other Bollinger Band range signals, it can clearly capture the dynamic changes in market trends.

  9. Combine the KDJ indicator with the trend shift at the 50 line. As market volatility continues to progress, prices often exhibit stage-like trend changes within the Bollinger Bands range. By combining the KDJ indicator with the critical line of value 50, it is possible to effectively capture signals of trend acceleration or reversal: ●K value crosses 50: When the price rebounds at the lower band of the Bollinger Bands and is accompanied by the K value crossing above 50, it indicates that buyer sentiment is gradually gaining strength, and the signal is tending towards a strong recovery, which may initiate a new round of upward trend. ●K value drops below 50: When the price falls below the middle track and the K value crosses below 50, it indicates that bearish sentiment is gradually gaining strength, the signal tends to weaken, and it may initiate a new round of downward trend. By linking the Bollinger Bands range with the trend line of the KD indicator, traders can more intuitively identify early signs of trend reversals and strategically position themselves for entry opportunities.

The operational method of the “BOLL Advanced Strategy” formed by structuring the combination of BOLL and KDJ dual indicators is as follows:

  1. Long Signal: The K and D lines in the KDJ indicator form a golden cross below the low level (below 50), indicating the start of a bullish trend.

  2. Short signal: The price breaks down through the middle band of the Bollinger Bands, and the K value of the KDJ is above 50, indicating that bearish momentum is strengthening.

  3. Long position take profit: The candlestick breaks above the upper Bollinger Band and then falls back within the Bollinger Band range.

  4. Long Stop Loss: Price falls below the lower Bollinger Band.

  5. Short Selling Take Profit: The K-line breaks below the lower Bollinger Band and then rebounds back within the Bollinger Band range.

  6. Short Stop Loss: Price breaks through the upper Bollinger Band.

  7. The effectiveness of this strategy signal

Chart OKX-BTCUSDT perpetual contract 8-hour period

Chart OKX-ETHUSDT perpetual contract 8-hour period

  1. Backtest Results of This Strategy

Chart OKX-ETHUSDT Perpetual Contract 8-Hour Period Backtest Highlights: Win Rate 59.26%, Return Rate: 278.69%

Chart OKX-BTCUSDT perpetual contract 8-hour period Backtest Highlights: Win Rate 54.84%, Return Rate: 362.58%

  1. Indicator Source Code // @version=2 // Define Bollinger Bands indicator parameters [boll, ub, lb] = boll(close, 20, 2);

// Define KDJ indicator parameters [k, d, j] = kdj(close, 9, 3, 3, ‘smma’);

var longCount = 0; var shortCount = 0;

// Calculate the situation of the middle track crossing in Bollinger Bands crossBollUp = crossup(close, boll); crossBollDown = crossdown(close, boll);

// Calculate KDJ golden cross and death cross situation kdjGoldenCross = crossup(k, d); kdjDeadCross = crossdown(k, d);

buySignal = kdjGoldenCross and k < 50 and longCount == 0 sellSignal = crossBollDown and k > 50 and shortCount == 0

if (buySignal) { longCount := 1 }

if (sellSignal) { shortCount := 1 }

// Calculate long position take profit condition: K line crosses above the upper Bollinger Band and then falls back within the Bollinger Band range cross_up_ub = crossdown(close, ub) long_take_profit = cross_up_ub and close < ub and close > lb and longCount == 1 if (long_take_profit) { longCount := 0 }

// Calculate long stop loss condition: Break below the lower Bollinger Band long_stop_loss = crossdown(close, lb) and longCount == 1 if (long_stop_loss) { longCount := 0 }

cross_down_lb = crossup(close, lb) short_take_profit = cross_down_lb and close > lb and close < ub and shortCount == 1 if (short_take_profit) { shortCount := 0 }

short_stop_loss = crossup(close, ub) and shortCount == 1 if (short_stop_loss) { shortCount := 0 } // Set warning conditions alertcondition(buySignal, title=“Buy”, direction=“buy”); alertcondition(sellSignal, title=“Sell”, direction=“sell”); alertcondition(short_take_profit, title=“Take Profit”, direction=“buy”); alertcondition(short_stop_loss, title=“Short Stop Loss”, direction=“buy”); alertcondition(long_take_profit, title=“Take Profit Long”, direction=“sell”); alertcondition(long_stop_loss, title=“Long Stop Loss”, direction=“sell”);

// Draw the crossover and golden cross/death cross signals on the chart plotText(buySignal, title=“Buy”, text=‘Buy’, color=‘green’, refSeries=low, placement=‘bottom’); plotText(sellSignal, title=“Sell”, text=‘Sell’, color=‘red’, refSeries=high, placement=‘top’);

plotText(short_take_profit, title=“Take Profit”, text=‘Take Profit for Short Position’, color=‘green’, refSeries=low, placement=‘bottom’); plotText(short_stop_loss, title=“Short Stop Loss”, text=‘Short Position Stop Loss Buy’, color=‘green’, refSeries=low, placement=‘bottom’);

plotText(long_take_profit, title=“Take Profit Long”, text=‘Take Profit Sell Long’, color=‘red’, refSeries=high, placement=‘top’); plotText(long_stop_loss, title=“Long Stop Loss”, text=‘Long Stop Loss Sell’, color=‘red’, refSeries=high, placement=‘top’);

exitLong(long_take_profit or long_stop_loss, price=‘market’, amount=1) exitShort(short_take_profit or short_stop_loss, price=‘market’, amount=1) enterLong(buySignal, price=‘market’, amount=1) enterShort(sellSignal, price=‘market’, amount=1)

Six, Comprehensive The reason Bollinger Bands are highly sought after is because they uniquely combine price, average, and volatility into three dynamic lines, forming a complete market context. This design not only tracks trends but also dynamically adjusts the range, helping traders better identify bullish and bearish opportunities. BOLL is suitable for capturing breakouts in trending markets and for range trading in consolidating markets, applicable to short-term, medium-term, and even long-term trading strategies, making it one of the versatile tools in technical analysis.

The advantage of this strategy lies in combining the Bollinger Bands range judgment with the KDJ trend crossover signals, giving it strong trend-following capability and short-term volatility judgment ability, especially suitable for the highly volatile market in the cryptocurrency space. However, the strategy also has certain limitations, especially during periods of high volatility where it may trigger more false signals, not fully utilizing trading volume to confirm the validity of breakouts, and the stop-loss logic needs to be more flexible under different market conditions.

VII. Postscript Based on the advantages and disadvantages, the AiCoin Research Institute will continue to optimize and improve this strategy from the following perspectives:

  1. Increase transaction volume confirmation mechanism: For prominent Bollinger Band breakout signals, verify signal strength using tools such as OBV (On-Balance Volume) and percentage increase in transaction volume to reduce false signals.
  2. Dynamic Stop Loss Range: Reduce the interference of stop-loss activation when the Bollinger Bands narrow, adjust the preset stop loss distance based on ATR (Average True Range indicator), and optimize the Bollinger Bands range appropriately.
  3. Overbought Dulling in Extreme Markets: In a strongly trending market, the KDJ’s bullish and bearish signals may be delayed. By combining the Bollinger Bands’ opening amplitude and the distance of the price from the middle band, set a “dulling filter” rule to reduce the impact of frequent signals.
  4. Combining time cycle interactivity: Cross-validate the Bollinger Bands and KDJ cycle signals of different short, medium, and long time periods to avoid the limitations of signals from a single time dimension.

If you are also interested in the BOLL advanced strategy, feel free to leave your comments, and we can discuss the mysteries of BOLL together!

CROSS-6,3%
View Original
This page may contain third-party content, which is provided for information purposes only (not representations/warranties) and should not be considered as an endorsement of its views by Gate, nor as financial or professional advice. See Disclaimer for details.
  • Reward
  • Comment
  • Repost
  • Share
Comment
0/400
No comments
Trade Crypto Anywhere Anytime
qrCode
Scan to download Gate App
Community
  • 简体中文
  • English
  • Tiếng Việt
  • 繁體中文
  • Español
  • Русский
  • Français (Afrique)
  • Português (Portugal)
  • Bahasa Indonesia
  • 日本語
  • بالعربية
  • Українська
  • Português (Brasil)