Skip to main content

CombinedBinHAndClucHyperV0 Strategy Analysis

Strategy #: #108 (8th in Batch 11) Strategy Type: Bollinger Bands + Dual Strategy Combination + Hyperparameter Optimization Timeframe: 1 Minute (1m)


I. Strategy Overview

CombinedBinHAndClucHyperV0 is a hyperparameter-optimized version of the CombinedBinHAndCluc series, developed by iterativ. The strategy combines BinHV45 and ClucMay72018, two classic Bollinger Band trend strategies, using "OR gate" logic for buy signal composite filtering. Unlike the basic version, HyperV0 opens a large number of optimizable hyperparameters, allowing users to use Hyperopt to automatically find optimal parameter combinations.

Core Features

FeatureDescription
Buy Conditions2 modes combined (BinHV45 OR ClucMay72018)
Sell ConditionsPrice breaking Bollinger middle band
Protection MechanismFixed stop-loss -10% + Trailing stop
Timeframe1 Minute
Hyperparameter Count12 optimizable parameters
DependenciesTA-Lib, numpy, qtpylib, technical
Special FeaturesCustom stop-loss, slippage compensation calculation

II. Strategy Configuration Analysis

2.1 Basic Risk Parameters

# Timeframe
timeframe = '1m'

# Sell Signal Settings
use_exit_signal = True
exit_profit_only = True
ignore_roi_if_entry_signal = False

# Stop-Loss Settings
stoploss = -0.1 # -10% hard stop-loss
trailing_stop = True # Enable trailing stop
trailing_only_offset_is_reached = False
use_custom_stoploss = True # Use custom stop-loss

# ROI Table (Profit targets at these levels)
minimal_roi = {
"0": 0.10, # Immediate exit: 10% profit
"30": 0.05, # After 30 minutes: 5% profit
"60": 0.02 # After 60 minutes: 2% profit
}

Design Philosophy:

  • 1-Minute Level: Ultra short-term trading, capturing instant fluctuations.
  • 10% Starting ROI: Compared to 5-minute version, 1-minute needs larger fluctuation space.
  • Trailing Stop: Locks in profits, leaves room for trending moves.
  • Staged ROI: Progressively lowers profit expectations as time passes.

2.2 Optimized Entry Parameters

buy_params = {
# BinHV45 Mode Parameters
'buy_a_bbdelta_rate': 0.0160, # BB width threshold
'buy_a_closedelta_rate': 0.0088, # Price fluctuation threshold
'buy_a_tail_rate': 0.9, # Lower wick ratio
'buy_a_time_window': 21, # BB period
'buy_a_min_sell_rate': 1.03, # Sell threshold

# ClucMay72018 Mode Parameters
'buy_b_close_rate': 0.979, # BB lower band ratio
'buy_b_time_window': 20, # BB period
'buy_b_ema_slow': 50, # EMA period
'buy_b_volume_mean_slow_num': 20, # Volume multiple
'buy_b_volume_mean_slow_window': 30, # Volume average period
}

2.3 Optimized Sell Parameters

sell_params = {
'sell_bb_middleband_window': 91, # BB middle band period
'sell_trailing_stop_positive_offset': 0.008, # Trailing stop offset
}

III. Entry Conditions Details

3.1 BinHV45 Mode (Entry Condition A)

Trigger Conditions:

(
# Previous candle's BB lower band exists
dataframe[f'lower_{buy_a_time_window}'].shift().gt(0) &

# BB width sufficient (> close × buy_a_bbdelta_rate)
dataframe[f'bbdelta_{buy_a_time_window}'].gt(dataframe['close'] * buy_a_bbdelta_rate) &

# Price fluctuation sufficient (> close × buy_a_closedelta_rate)
dataframe[f'closedelta_{buy_a_time_window}'].gt(dataframe['close'] * buy_a_closedelta_rate) &

# Lower wick short (< BB width × buy_a_tail_rate)
dataframe[f'tail_{buy_a_time_window}'].lt(dataframe[f'bbdelta_{buy_a_time_window}'] * buy_a_tail_rate) &

# Price breaks below previous BB lower band
dataframe['close'].lt(dataframe[f'lower_{buy_a_time_window}'].shift()) &

# Close not higher than previous close
dataframe['close'].le(dataframe['close'].shift()) &

# BB middle band above minimum sell price
dataframe[f'bb_middleband_{sell_bb_middleband_window}'].gt(dataframe['close'] * buy_a_min_sell_rate)
)

Logic Interpretation:

  1. BB width verification: Ensures sufficient market volatility space.
  2. Price fluctuation verification: Filters sideways consolidation markets.
  3. Pattern verification: Hammer pattern (short lower wick).
  4. Breakout verification: Price breaks BB lower band support.
  5. Trend confirmation: Close price weakening.
  6. Safety cushion verification: BB middle band provides support protection.

3.2 ClucMay72018 Mode (Entry Condition B)

Trigger Conditions:

(
# Price below long-term MA (downtrend)
(dataframe['close'] < dataframe[f'ema_slow_{buy_b_ema_slow}']) &

# Price below BB lower band × buy_b_close_rate
(dataframe['close'] < buy_b_close_rate * dataframe[f'bb_lowerband_{buy_b_time_window}']) &

# Volume abnormally low (< avg × buy_b_volume_mean_slow_num)
(dataframe['volume'] < (dataframe[f'volume_mean_slow_{buy_b_volume_mean_slow_window}'].shift(1) * buy_b_volume_mean_slow_num))
)

Logic Interpretation:

  1. Trend verification: Price below EMA50, in downtrend.
  2. Support verification: Price near or below BB lower band.
  3. Shrinking volume verification: Volume extremely low, imminent reversal.

IV. Exit Conditions Details

4.1 Technical Sell: BB Middle Band Breakout

(dataframe['close'] > dataframe[f'bb_middleband_{sell_bb_middleband_window}'])

Logic: Triggers sell when price breaks above BB middle band. BB middle band period optimized to 91 (smoother than default 20).

4.2 ROI Take-Profit (Staged)

TimeProfit Target
Immediate10%
After 30 minutes5%
After 60 minutes2%

4.3 Custom Trailing Stop

# Activates trailing stop when profit exceeds sell_trailing_stop_positive_offset
if current_profit_comp < sell_trailing_stop_positive_offset:
return -1 # Don't trigger
else:
return sell_trailing_stop_positive # 0.001

Special Feature: Slippage compensation calculation — adjusts profit calculation based on difference between actual and expected fill prices.


V. Technical Indicator System

5.1 Core Indicators

IndicatorCalculation MethodFunction
BB Middle Band91-day SMA (optimizable)Sell signal trigger line
BB Lower BandN-day SMA - 2σBuy signal trigger line
EMA5050-day EMA (optimizable)Trend judgment
Volume Average30-day volume average (optimizable)Shrinking volume verification

5.2 Custom Indicators (BinHV45 Mode)

IndicatorCalculation MethodFunction
bbdelta|middle - lower|BB width
closedelta|close - previous close|Price fluctuation magnitude
tail|close - low|Lower wick length

5.3 Optimizable Parameters Summary

ParameterDefaultRangeFunction
buy_a_bbdelta_rate0.0160.004-0.016BB width threshold
buy_a_closedelta_rate0.00870.000-0.010Price fluctuation threshold
buy_a_tail_rate0.280.12-0.5Lower wick ratio
buy_a_time_window3040-100BB period
buy_a_min_sell_rate1.0041.004-1.1Sell threshold
buy_b_close_rate0.9790.4-1.8BB lower band ratio
buy_b_volume_mean_slow_window30100-300Volume period
buy_b_ema_slow5040-100EMA period
buy_b_time_window20100-300BB period
buy_b_volume_mean_slow_num2010-100Volume multiple
sell_bb_middleband_window2050-200Sell BB period
sell_trailing_stop_positive_offset0.0080.01-0.03Trailing stop offset

VI. Risk Management Features

6.1 Stop-Loss Strategy

Stop-Loss TypeThresholdDescription
Hard Stop-Loss-10%Forced liquidation at 10% loss
Custom Stop-LossDynamicSoft stop with slippage compensation

6.2 Take-Profit Strategy

Take-Profit TypeThresholdDescription
ROI Take-Profit10%/5%/2%Staged exit
Trailing Stop0.8% activationLocks profits

6.3 Slippage Compensation Mechanism

# Calculate slippage ratio
slippage_ratio = trade.open_rate / trade_candle['close'] - 1
slippage_ratio = max(slippage_ratio, 0)

# Adjusted profit
current_profit_comp = current_profit + slippage_ratio

Function: More accurately calculates actual profit, avoids false trailing stop triggers caused by slippage.


VII. Strategy Pros & Cons

7.1 Pros

  1. Hyperparameter Optimizable: 12 parameters can be automatically optimized via Hyperopt.
  2. Dual Strategy Combination: Two independent strategies complement each other, improving reliability.
  3. Slippage Compensation: Custom stop-loss considers trading slippage.
  4. Trailing Stop: Locks profits while leaving room for trending moves.
  5. 1-Minute Level: Suitable for high-volatility short-term operations.
  6. Staged ROI: Adapts profit expectations to different holding durations.

7.2 Cons

  1. Parameter Sensitive: Large number of hyperparameters may cause overfitting.
  2. 1-Minute Noise: High-frequency trading signals have higher noise.
  3. Trend Adaptability: May fail in strong trending markets.
  4. High Complexity: Requires understanding two sub-strategy logics.
  5. Backtesting Requirements: Needs longer backtesting periods to verify.

VIII. Applicable Scenarios

ScenarioDescription
High-Frequency Trading1-minute level captures instant fluctuations
Volatile MarketBB convergence breakout after volatility
Ultra-Short OperationsFast entry/exit swing trading
Parameter OptimizationWant to optimize parameters via Hyperopt
Multi-Coin AllocationRun multiple trading pairs simultaneously
ScenarioDescription
Long-Term Investment1-minute level not suitable for long-term
Low-Fee CoinsHigh-frequency trading needs low fees
Low-Volatility MarketBB narrow, signals scarce
Risk Averse10% stop-loss relatively large

IX. Summary

CombinedBinHAndClucHyperV0 is a version specifically designed for hyperparameter optimization in the CombinedBinHAndCluc series. By opening 12 adjustable parameters, it allows users to find optimal configurations based on specific market environments. The strategy combines BinHV45's pattern recognition and ClucMay72018's shrinking volume rebound logic, providing a complete high-frequency trading framework at the 1-minute level with custom trailing stop and slippage compensation.

Core Points:

  • ✅ 12 hyperparameter optimizable, strong adaptability.
  • ✅ Dual strategy combination, improves signal reliability.
  • ✅ Custom stop-loss with slippage compensation, more precise.
  • ✅ Trailing stop locks profits.
  • ⚠️ High parameter complexity, overfitting risk.
  • ⚠️ 1-minute level has high execution requirements.
  • ⚠️ Needs low-fee environment.

Usage Suggestions:

  • Beginners should first run with default parameters until stable, then optimize.
  • Experienced users can use Hyperopt to find optimal parameters.
  • Ensure trading fees are low enough (< 0.1%).
  • Suggest forming combinations with other strategies to reduce single-strategy risk.
  • Must conduct sufficient testing before live trading.