BinHV27_short
♡
Basics
mode: futures
timeframe: 5m
Settings
stoploss: -0.99
has minimal roi
custom stoploss
process only new candles
startup candle count: 240
hyperopt
hyperopt params: 23
Indicators
ADX
EMA
RSI
SMA
talib
Methods
custom_exit
custom_stoploss
leverage
15 related strategies (⧉ identical code, ≈ similar name)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 | from datetime import datetime from functools import reduce from freqtrade.persistence import Trade from freqtrade.strategy import IntParameter, DecimalParameter, stoploss_from_open, CategoricalParameter from freqtrade.strategy.interface import IStrategy from pandas import DataFrame import freqtrade.vendor.qtpylib.indicators as qtpylib import talib.abstract as ta import numpy # noqa class BinHV27_short(IStrategy): """ strategy sponsored by user BinH from slack """ minimal_roi = { "0": 1 } buy_params = { 'buy_adx1': 25, 'buy_emarsi1': 20, 'buy_adx2': 30, 'buy_emarsi2': 20, 'buy_adx3': 35, 'buy_emarsi3': 20, 'buy_adx4': 30, 'buy_emarsi4': 25 } sell_params = { # custom stop loss params "pHSL": -0.25, "pPF_1": 0.012, "pPF_2": 0.05, "pSL_1": 0.01, "pSL_2": 0.04, # leverage set "leverage_num": 1, # sell params 'emarsi1': 75, 'adx2': 30, 'emarsi2': 80, 'emarsi3': 75, # sell optional "sell_1": True, "sell_2": True, "sell_3": True, "sell_4": True, "sell_5": True, } stoploss = -0.99 timeframe = '5m' process_only_new_candles = True startup_candle_count = 240 # default False use_custom_stoploss = True can_short = True order_types = { 'entry': 'market', 'exit': 'market', 'emergency_exit': 'market', 'force_entry': 'market', 'force_exit': "market", 'stoploss': 'market', 'stoploss_on_exchange': False, 'stoploss_on_exchange_interval': 60, 'stoploss_on_exchange_limit_ratio': 0.99 } # buy params buy_optimize = True buy_adx1 = IntParameter(low=10, high=100, default=25, space='buy', optimize=buy_optimize) buy_emarsi1 = IntParameter(low=10, high=100, default=20, space='buy', optimize=buy_optimize) buy_adx2 = IntParameter(low=20, high=100, default=30, space='buy', optimize=buy_optimize) buy_emarsi2 = IntParameter(low=20, high=100, default=20, space='buy', optimize=buy_optimize) buy_adx3 = IntParameter(low=10, high=100, default=35, space='buy', optimize=buy_optimize) buy_emarsi3 = IntParameter(low=10, high=100, default=20, space='buy', optimize=buy_optimize) buy_adx4 = IntParameter(low=20, high=100, default=30, space='buy', optimize=buy_optimize) buy_emarsi4 = IntParameter(low=20, high=100, default=25, space='buy', optimize=buy_optimize) # trailing stoploss trailing_optimize = False pHSL = DecimalParameter(-0.990, -0.040, default=-0.08, decimals=3, space='sell', optimize=trailing_optimize) pPF_1 = DecimalParameter(0.008, 0.100, default=0.016, decimals=3, space='sell', optimize=trailing_optimize) pSL_1 = DecimalParameter(0.008, 0.100, default=0.011, decimals=3, space='sell', optimize=trailing_optimize) pPF_2 = DecimalParameter(0.040, 0.200, default=0.080, decimals=3, space='sell', optimize=trailing_optimize) pSL_2 = DecimalParameter(0.040, 0.200, default=0.040, decimals=3, space='sell', optimize=trailing_optimize) # sell params sell_optimize = True adx2 = IntParameter(low=10, high=100, default=30, space='sell', optimize=sell_optimize) emarsi1 = IntParameter(low=10, high=100, default=75, space='sell', optimize=sell_optimize) emarsi2 = IntParameter(low=20, high=100, default=80, space='sell', optimize=sell_optimize) emarsi3 = IntParameter(low=20, high=100, default=75, space='sell', optimize=sell_optimize) sell2_optimize = True sell_1 = CategoricalParameter([True, False], default=True, space="sell", optimize=sell2_optimize) sell_2 = CategoricalParameter([True, False], default=True, space="sell", optimize=sell2_optimize) sell_3 = CategoricalParameter([True, False], default=True, space="sell", optimize=sell2_optimize) sell_4 = CategoricalParameter([True, False], default=True, space="sell", optimize=sell2_optimize) sell_5 = CategoricalParameter([True, False], default=True, space="sell", optimize=sell2_optimize) leverage_optimize = False leverage_num = IntParameter(low=1, high=20, default=1, space='sell', optimize=leverage_optimize) def custom_stoploss(self, pair: str, trade: Trade, current_time: datetime, current_rate: float, current_profit: float, **kwargs) -> float: # hard stoploss profit HSL = self.pHSL.value PF_1 = self.pPF_1.value SL_1 = self.pSL_1.value PF_2 = self.pPF_2.value SL_2 = self.pSL_2.value # For profits between PF_1 and PF_2 the stoploss (sl_profit) used is linearly interpolated # between the values of SL_1 and SL_2. For all profits above PL_2 the sl_profit value # rises linearly with current profit, for profits below PF_1 the hard stoploss profit is used. if current_profit > PF_2: sl_profit = SL_2 + (current_profit - PF_2) elif current_profit > PF_1: sl_profit = SL_1 + ((current_profit - PF_1) * (SL_2 - SL_1) / (PF_2 - PF_1)) else: sl_profit = HSL if self.can_short: if (-1 + ((1 - sl_profit) / (1 - current_profit))) <= 0: return 1 else: if (1 - ((1 + sl_profit) / (1 + current_profit))) <= 0: return 1 return stoploss_from_open(sl_profit, current_profit, is_short=trade.is_short) def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame: dataframe['rsi'] = numpy.nan_to_num(ta.RSI(dataframe, timeperiod=5)) rsiframe = DataFrame(dataframe['rsi']).rename(columns={'rsi': 'close'}) dataframe['emarsi'] = numpy.nan_to_num(ta.EMA(rsiframe, timeperiod=5)) dataframe['adx'] = numpy.nan_to_num(ta.ADX(dataframe)) dataframe['minusdi'] = numpy.nan_to_num(ta.MINUS_DI(dataframe)) minusdiframe = DataFrame(dataframe['minusdi']).rename(columns={'minusdi': 'close'}) dataframe['minusdiema'] = numpy.nan_to_num(ta.EMA(minusdiframe, timeperiod=25)) dataframe['plusdi'] = numpy.nan_to_num(ta.PLUS_DI(dataframe)) plusdiframe = DataFrame(dataframe['plusdi']).rename(columns={'plusdi': 'close'}) dataframe['plusdiema'] = numpy.nan_to_num(ta.EMA(plusdiframe, timeperiod=5)) dataframe['lowsma'] = numpy.nan_to_num(ta.EMA(dataframe, timeperiod=60)) dataframe['highsma'] = numpy.nan_to_num(ta.EMA(dataframe, timeperiod=120)) dataframe['fastsma'] = numpy.nan_to_num(ta.SMA(dataframe, timeperiod=120)) dataframe['slowsma'] = numpy.nan_to_num(ta.SMA(dataframe, timeperiod=240)) dataframe['bigup'] = dataframe['fastsma'].gt(dataframe['slowsma']) & ( (dataframe['fastsma'] - dataframe['slowsma']) > dataframe['close'] / 300) dataframe['bigdown'] = ~dataframe['bigup'] dataframe['trend'] = dataframe['fastsma'] - dataframe['slowsma'] dataframe['preparechangetrend'] = dataframe['trend'].gt(dataframe['trend'].shift()) dataframe['preparechangetrendconfirm'] = dataframe['preparechangetrend'] & dataframe['trend'].shift().gt( dataframe['trend'].shift(2)) dataframe['continueup'] = dataframe['slowsma'].gt(dataframe['slowsma'].shift()) & dataframe[ 'slowsma'].shift().gt(dataframe['slowsma'].shift(2)) dataframe['delta'] = dataframe['fastsma'] - dataframe['fastsma'].shift() dataframe['slowingdown'] = dataframe['delta'].lt(dataframe['delta'].shift()) return dataframe def populate_entry_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame: conditions = [] dataframe.loc[:, 'enter_tag'] = '' buy_1 = ( dataframe['slowsma'].gt(0) & dataframe['close'].lt(dataframe['highsma']) & dataframe['close'].lt(dataframe['lowsma']) & dataframe['minusdi'].gt(dataframe['minusdiema']) & dataframe['rsi'].ge(dataframe['rsi'].shift()) & ~dataframe['preparechangetrend'] & ~dataframe['continueup'] & dataframe['adx'].gt(self.buy_adx1.value) & dataframe['bigdown'] & dataframe['emarsi'].le(self.buy_emarsi1.value) ) buy_2 = ( dataframe['slowsma'].gt(0) & dataframe['close'].lt(dataframe['highsma']) & dataframe['close'].lt(dataframe['lowsma']) & dataframe['minusdi'].gt(dataframe['minusdiema']) & dataframe['rsi'].ge(dataframe['rsi'].shift()) & ~dataframe['preparechangetrend'] & dataframe['continueup'] & dataframe['adx'].gt(self.buy_adx2.value) & dataframe['bigdown'] & dataframe['emarsi'].le(self.buy_emarsi2.value) ) buy_3 = ( dataframe['slowsma'].gt(0) & dataframe['close'].lt(dataframe['highsma']) & dataframe['close'].lt(dataframe['lowsma']) & dataframe['minusdi'].gt(dataframe['minusdiema']) & dataframe['rsi'].ge(dataframe['rsi'].shift()) & ~dataframe['continueup'] & dataframe['adx'].gt(self.buy_adx3.value) & dataframe['bigup'] & dataframe['emarsi'].le(self.buy_emarsi3.value) ) buy_4 = ( dataframe['slowsma'].gt(0) & dataframe['close'].lt(dataframe['highsma']) & dataframe['close'].lt(dataframe['lowsma']) & dataframe['minusdi'].gt(dataframe['minusdiema']) & dataframe['rsi'].ge(dataframe['rsi'].shift()) & dataframe['continueup'] & dataframe['adx'].gt(self.buy_adx4.value) & dataframe['bigup'] & dataframe['emarsi'].le(self.buy_emarsi4.value) ) conditions.append(buy_1) dataframe.loc[buy_1, 'enter_tag'] += 'buy_1' conditions.append(buy_2) dataframe.loc[buy_2, 'enter_tag'] += 'buy_2' conditions.append(buy_3) dataframe.loc[buy_3, 'enter_tag'] += 'buy_3' conditions.append(buy_4) dataframe.loc[buy_4, 'enter_tag'] += 'buy_4' if conditions: dataframe.loc[ reduce(lambda x, y: x | y, conditions), 'enter_short'] = 1 dataframe.loc[(), ['enter_long', 'enter_tag']] = (0, 'long_in') return dataframe def populate_exit_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame: dataframe.loc[(), ['exit_short', 'exit_tag']] = (0, 'short_out') dataframe.loc[(), ['exit_long', 'exit_tag']] = (0, 'long_out') return dataframe def custom_exit(self, pair: str, trade: Trade, current_time: 'datetime', current_rate: float, current_profit: float, **kwargs): dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe) last_candle = dataframe.iloc[-1].squeeze() if current_profit >= self.pPF_1.value: return None if self.sell_1.value: if ( (~last_candle['preparechangetrendconfirm']) and (~last_candle['continueup']) and (last_candle['close'] > last_candle['lowsma'] or last_candle['close'] > last_candle['highsma']) and (last_candle['highsma'] > 0) and (last_candle['bigdown']) ): return "sell_1" if self.sell_2.value: if ( (~last_candle['preparechangetrendconfirm']) and (~last_candle['continueup']) and (last_candle['close'] > last_candle['highsma']) and (last_candle['highsma'] > 0) and (last_candle['emarsi'] > self.emarsi1.value or last_candle['close'] > last_candle['slowsma']) and (last_candle['bigdown']) ): return "sell_2" if self.sell_3.value: if ( (~last_candle['preparechangetrendconfirm']) and (last_candle['close'] > last_candle['highsma']) and (last_candle['highsma'] > 0) and (last_candle['adx'] > self.adx2.value) and (last_candle['emarsi'] >= self.emarsi2.value) and (last_candle['bigup']) ): return "sell_3" if self.sell_4.value: if ( (last_candle['preparechangetrendconfirm']) and (~last_candle['continueup']) and (last_candle['slowingdown']) and (last_candle['emarsi'] >= self.emarsi3.value) and (last_candle['slowsma'] > 0) ): return "sell_4" if self.sell_5.value: if ( (last_candle['preparechangetrendconfirm']) and (last_candle['minusdi'] < last_candle['plusdi']) and (last_candle['close'] > last_candle['lowsma']) and (last_candle['slowsma'] > 0) ): return "sell_5" def leverage(self, pair: str, current_time: datetime, current_rate: float, proposed_leverage: float, max_leverage: float, side: str, **kwargs) -> float: return self.leverage_num.value |
Strategy League — fixed backtest that feeds the ranking
Failed — ft_backtest wrapper failed: Something has gone wrong, please report a bug at https://github.com/pandas-dev/pandas/issues (exit 1)
0:50:36,301 - freqtrade.strategy.hyper - INFO - Strategy Parameter: sell_1 = True 2026-07-26 00:50:36,301 - freqtrade.strategy.hyper - INFO - Strategy Parameter: sell_2 = True 2026-07-26 00:50:36,302 - freqtrade.strategy.hyper - INFO - Strategy Parameter: sell_3 = True 2026-07-26 00:50:36,302 - freqtrade.strategy.hyper - INFO - Strategy Parameter: sell_4 = True 2026-07-26 00:50:36,302 - freqtrade.strategy.hyper - INFO - Strategy Parameter: sell_5 = True 2026-07-26 00:50:36,303 - freqtrade.strategy.hyper - INFO - Strategy Parameter: buy_adx1 = 25 2026-07-26 00:50:36,303 - freqtrade.strategy.hyper - INFO - Strategy Parameter: buy_adx2 = 30 2026-07-26 00:50:36,303 - freqtrade.strategy.hyper - INFO - Strategy Parameter: buy_adx3 = 35 2026-07-26 00:50:36,304 - freqtrade.strategy.hyper - INFO - Strategy Parameter: buy_adx4 = 30 2026-07-26 00:50:36,304 - freqtrade.strategy.hyper - INFO - Strategy Parameter: buy_emarsi1 = 20 2026-07-26 00:50:36,304 - freqtrade.strategy.hyper - INFO - Strategy Parameter: buy_emarsi2 = 20 2026-07-26 00:50:36,305 - freqtrade.strategy.hyper - INFO - Strategy Parameter: buy_emarsi3 = 20 2026-07-26 00:50:36,305 - freqtrade.strategy.hyper - INFO - Strategy Parameter: buy_emarsi4 = 25 2026-07-26 00:50:40,390 - freqtrade.optimize.backtesting - INFO - Backtesting with data from 2021-01-01 00:00:00 up to 2026-01-01 00:00:00 (1826 days). 2026-07-26 00:50:40,391 - freqtrade.plugins.protectionmanager - INFO - No protection Handlers defined. convert ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╸ 3/4 75% • 0:02:41 • 0:00:05 convert ━━━━╸ 1/33 3% • 0:02:41 • -:--:-- ft_backtest wrapper failed: Something has gone wrong, please report a bug at https://github.com/pandas-dev/pandas/issues
Backtests — over a market period
Backtest this strategy over a chosen crypto-cycle period. These don't affect the League ranking, and need that period's candle data downloaded.
Log in or sign up to run backtests.
| Period | Range | Total % | Win % | Max DD | Trades | |
|---|---|---|---|---|---|---|
| 2020 · DeFi Summer & Pre-Halving Rally | 20200101-20210101 | not run | ||||
| 2021 · Institutional Bull Market | 20210101-20220101 | not run | ||||
| 2022 · Post-Bull Crash & Macro Tightening | 20220101-20230101 | not run | ||||
| 2023–2024 · Recovery & ETF Anticipation | 20230101-20250101 | not run | ||||
| 2025–2026 · Current Cycle | 20250101-20260101 | not run | ||||
Walk forward
Out-of-sample backtest on recent data · 33 pairs · 20260101-20260701.
Backtest trust check
Static source analysis — instant, does not run the strategy. Flags future-data leaks, backtest-realism problems, and indicators worth a second look.
Lookahead analysis
freqtrade lookahead-analysis: detects strategies peeking at future candles.