10 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 | # pragma pylint: disable=missing-docstring, invalid-name, pointless-string-statement # flake8: noqa: F401 # --- Do not remove these libs --- import numpy as np # noqa import pandas as pd # noqa from pandas import DataFrame, Series from freqtrade.strategy import IStrategy from freqtrade.strategy import merge_informative_pair, timeframe_to_minutes from freqtrade.strategy import CategoricalParameter, DecimalParameter, IntParameter # -------------------------------- # Add your lib to import here import talib.abstract as ta import freqtrade.vendor.qtpylib.indicators as qtpylib import numpy # noqa from freqtrade.persistence import Trade from datetime import datetime, timedelta class Inverse(IStrategy): INTERFACE_VERSION = 3 # Buy hyperspace params: buy_params = {'buy_fisher_cci_1': -0.42, 'buy_fisher_cci_2': 0.41, 'buy_fisher_length': 31} # Sell hyperspace params: sell_params = {'sell_fisher_cci_1': 0.42, 'sell_fisher_cci_2': -0.34} # ROI table: minimal_roi = {'0': 100} # Stoploss: stoploss = -0.2 # Trailing stop: trailing_stop = True trailing_stop_positive = 0.078 trailing_stop_positive_offset = 0.174 trailing_only_offset_is_reached = False # Optimal timeframe for the strategy. timeframe = '1h' info_timeframe = '4h' # Run "populate_indicators()" only for new candle. process_only_new_candles = False # These values can be overridden in the "ask_strategy" section in the config. use_exit_signal = True exit_profit_only = False ignore_roi_if_entry_signal = False # Number of candles the strategy requires before producing valid signals startup_candle_count: int = 200 # Optional order type mapping. order_types = {'entry': 'limit', 'exit': 'limit', 'stoploss': 'market', 'stoploss_on_exchange': False} # Optional order time in force. order_time_in_force = {'entry': 'gtc', 'exit': 'gtc'} plot_config = {'main_plot': {}, 'subplots': {'fisher': {'fisher_stoch': {'color': 'blue'}, 'fisher_cci': {'color': 'red'}, 'fisher_rsi': {'color': 'black'}, 'fisher_mfi': {'color': 'purple'}}}} # Hyperoptable parameters buy_fisher_length = IntParameter(low=13, high=55, default=34, space='buy', optimize=True, load=True) buy_fisher_cci_1 = DecimalParameter(low=-0.6, high=-0.3, decimals=2, default=-0.5, space='buy', optimize=True, load=True) buy_fisher_cci_2 = DecimalParameter(low=0.3, high=0.6, decimals=2, default=0.5, space='buy', optimize=True, load=True) sell_fisher_cci_1 = DecimalParameter(low=0.3, high=0.6, decimals=2, default=0.5, space='sell', optimize=True, load=True) sell_fisher_cci_2 = DecimalParameter(low=-0.6, high=-0.3, decimals=2, default=-0.5, space='sell', optimize=True, load=True) def confirm_trade_exit(self, pair: str, trade: Trade, order_type: str, amount: float, rate: float, time_in_force: str, exit_reason: str, current_time: datetime, **kwargs) -> bool: dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe) last_candle = dataframe.iloc[-1] previous_candle_1 = dataframe.iloc[-2] if last_candle is not None: # if (sell_reason in ['roi','sell_signal','trailing_stop_loss']): if exit_reason in ['exit_signal']: if last_candle['di_up'] and last_candle['adx'] > previous_candle_1['adx']: return False return True def informative_pairs(self): # get access to all pairs available in whitelist. pairs = self.dp.current_whitelist() # Assign tf to each pair so they can be downloaded and cached for strategy. informative_pairs = [(pair, self.info_timeframe) for pair in pairs] # informative_pairs.append(('BTC/USDT', self.btc_info_timeframe)) return informative_pairs def informative_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame: assert self.dp, 'DataProvider is required for multiple timeframes.' # Get the informative pair informative_p = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.info_timeframe) # EMA informative_p['ema_50'] = ta.EMA(informative_p, timeperiod=50) informative_p['ema_100'] = ta.EMA(informative_p, timeperiod=100) informative_p['ema_200'] = ta.EMA(informative_p, timeperiod=200) # SSL Channels ssl_down, ssl_up = self.SSLChannels(informative_p, 20) informative_p['ssl_down'] = ssl_down informative_p['ssl_up'] = ssl_up return informative_p def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame: # RSI # dataframe['rsi'] = ta.RSI(dataframe, timeperiod=self.buy_fisher_length.value) # # Inverse Fisher transform on RSI, values [-1.0, 1.0] (https://goo.gl/2JGGoy) # rsi = 0.1 * (dataframe['rsi'] - 50) # wmarsi = ta.WMA(rsi, timeperiod = 9) # dataframe['fisher_rsi'] = (numpy.exp(2 * wmarsi) - 1) / (numpy.exp(2 * wmarsi) + 1) # # MFI - Money Flow Index # dataframe['mfi'] = ta.MFI(dataframe, timeperiod=self.buy_fisher_length.value) # # Inverse Fisher transform on MFI # mfi = 0.1 * (dataframe['mfi'] - 50) # wmamfi = ta.WMA(mfi, timeperiod = 9) # dataframe['fisher_mfi'] = (numpy.exp(2 * wmamfi) - 1) / (numpy.exp(2 * wmamfi) + 1) # # Stochastic # stoch_fast = ta.STOCHF(dataframe, fastk_period=self.buy_fisher_length.value) # dataframe['fastk'] = stoch_fast['fastk'] # # Inverse Fisher transform on Stochastic # stoch = 0.1 * (dataframe['fastk'] - 50) # wmastoch = ta.WMA(stoch, timeperiod = 9) # dataframe['fisher_stoch'] = (numpy.exp(2 * wmastoch) - 1) / (numpy.exp(2 * wmastoch) + 1) # Commodity Channel Index: values [Oversold:-100, Overbought:100] for cci_length in self.buy_fisher_length.range: dataframe[f'cci'] = ta.CCI(dataframe, timeperiod=cci_length) # Inverse Fisher transform on CCI cci = 0.1 * (dataframe[f'cci'] / 4) wmacci = ta.WMA(cci, timeperiod=9) dataframe[f'fisher_cci_{cci_length}'] = (numpy.exp(2 * wmacci) - 1) / (numpy.exp(2 * wmacci) + 1) # dataframe['fisher_average'] = ( # (dataframe['fisher_rsi'] + # dataframe['fisher_cci'] + # dataframe['fisher_mfi'] + # dataframe['fisher_stoch'] # ) / 4).astype(float) dataframe['ema_50'] = ta.EMA(dataframe, timeperiod=50) dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200) # confirm_trade_exit dataframe['adx'] = ta.ADX(dataframe, timeperiod=3) dataframe['di_up'] = ta.PLUS_DI(dataframe, timeperiod=3) > ta.MINUS_DI(dataframe, timeperiod=3) return dataframe def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame: """ --> Informative timeframe ___________________________________________________________________________________________ """ if self.info_timeframe != 'none': informative_p = self.informative_indicators(dataframe, metadata) dataframe = merge_informative_pair(dataframe, informative_p, self.timeframe, self.info_timeframe, ffill=True) drop_columns = [s + '_' + self.info_timeframe for s in ['date']] dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True) '\n --> The indicators for the normal timeframe\n ___________________________________________________________________________________________\n ' dataframe = self.normal_tf_indicators(dataframe, metadata) return dataframe def populate_entry_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame: # Make sure Volume is not 0 dataframe.loc[(qtpylib.crossed_above(dataframe[f'fisher_cci_{self.buy_fisher_length.value}'], self.buy_fisher_cci_1.value) | (qtpylib.crossed_below(dataframe[f'fisher_cci_{self.buy_fisher_length.value}'], self.buy_fisher_cci_2.value).rolling(8).max() == 1) & qtpylib.crossed_above(dataframe[f'fisher_cci_{self.buy_fisher_length.value}'], self.buy_fisher_cci_2.value)) & (dataframe[f'ssl_up_{self.info_timeframe}'] > dataframe[f'ssl_down_{self.info_timeframe}']) & (dataframe['ema_50'] > dataframe['ema_200']) & (dataframe[f'ema_50_{self.info_timeframe}'] > dataframe[f'ema_100_{self.info_timeframe}']) & (dataframe[f'ema_50_{self.info_timeframe}'] > dataframe[f'ema_200_{self.info_timeframe}']) & (dataframe['volume'] > 0), 'enter_long'] = 1 return dataframe def populate_exit_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame: # Make sure Volume is not 0 dataframe.loc[(qtpylib.crossed_below(dataframe[f'fisher_cci_{self.buy_fisher_length.value}'], self.sell_fisher_cci_1.value) | qtpylib.crossed_below(dataframe[f'fisher_cci_{self.buy_fisher_length.value}'], self.sell_fisher_cci_2.value)) & (dataframe['volume'] > 0), 'exit_long'] = 1 return dataframe # SSL Channels def SSLChannels(self, dataframe, length=7): df = dataframe.copy() df['ATR'] = ta.ATR(df, timeperiod=14) df['smaHigh'] = df['high'].rolling(length).mean() + df['ATR'] df['smaLow'] = df['low'].rolling(length).mean() - df['ATR'] df['hlv'] = np.where(df['close'] > df['smaHigh'], 1, np.where(df['close'] < df['smaLow'], -1, np.nan)) df['hlv'] = df['hlv'].ffill() df['sslDown'] = np.where(df['hlv'] < 0, df['smaHigh'], df['smaLow']) df['sslUp'] = np.where(df['hlv'] < 0, df['smaLow'], df['smaHigh']) return (df['sslDown'], df['sslUp']) |
Strategy League — fixed backtest that feeds the ranking
Export report Freqtrade logsRun finished · took 47.5s
ℹ️ This strategy uses a trailing stop — freqtrade only
re-checks these once per 1h candle by default, not against the price movement within it.
For a more accurate read, re-run this backtest locally with --timeframe-detail 1m
(or 5m — freqtrade's own docs use 5m detail for an hourly strategy as a lighter
alternative). Freqle doesn't do this for every check here: multiplying every
League/sweep backtest by a finer detail timeframe is more compute than the sandbox can sustain
across every indexed strategy. why this matters →
- profit isn't statistically significant (p=0.18) — hard to tell apart from luck
- profitable in only 34% of rolling 3-month windows
- did not beat simply holding the market
- 90% of resampled runs stayed profitable
Resampling the trade sequence 2,000× shows the spread of results this edge could plausibly produce — separating a dependable strategy from one that got lucky once.
Loading charts…
Monthly breakdown
| Month | Regime | Trades | Profit % | Avg % | Win | Loss | Win % | DD % | Avg dur |
|---|---|---|---|---|---|---|---|---|---|
| Jan 2026 | bullish trending low vol | 1 | -0.04 | -0.40 | 0 | 1 | 0.0 | -35.32 | 2h 00m |
| Dec 2025 | bearish trending low vol | 9 | -1.22 | -1.36 | 2 | 7 | 22.2 | -35.34 | 18h 13m |
| Nov 2025 | bearish trending high vol | 9 | -5.23 | -5.81 | 1 | 8 | 11.1 | -34.72 | 14h 47m |
| Oct 2025 | bearish trending low vol | 36 | -3.20 | -0.89 | 6 | 30 | 16.7 | -32.24 | 16h 33m |
| Sep 2025 | bullish choppy low vol | 83 | -4.14 | -0.50 | 19 | 64 | 22.9 | -30.72 | 21h 16m |
| Aug 2025 | bullish choppy low vol | 83 | -7.93 | -0.96 | 20 | 63 | 24.1 | -28.76 | 20h 45m |
| Jul 2025 | bullish choppy low vol | 132 | +9.21 | 0.70 | 54 | 78 | 40.9 | -29.58 | 24h 25m |
| Jun 2025 | bearish choppy low vol | 28 | -3.49 | -1.25 | 5 | 23 | 17.9 | -29.37 | 18h 24m |
| May 2025 | bullish trending low vol | 107 | -4.74 | -0.44 | 33 | 74 | 30.8 | -27.71 | 20h 11m |
| Apr 2025 | bullish choppy low vol | 84 | -7.72 | -0.92 | 17 | 67 | 20.2 | -25.46 | 16h 49m |
| Mar 2025 | bearish trending high vol | 4 | -0.19 | -0.48 | 2 | 2 | 50.0 | -21.82 | 22h 45m |
| Feb 2025 | bearish trending low vol | 7 | -1.77 | -2.52 | 2 | 5 | 28.6 | -21.71 | 17h 34m |
| Jan 2025 | bearish choppy low vol | 61 | -10.78 | -1.77 | 8 | 53 | 13.1 | -20.87 | 16h 29m |
| Dec 2024 | bullish trending low vol | 125 | +4.73 | 0.38 | 36 | 89 | 28.8 | -16.6 | 20h 27m |
| Nov 2024 | bullish trending low vol | 174 | +19.99 | 1.15 | 72 | 102 | 41.4 | -28.45 | 20h 33m |
| Oct 2024 | bullish choppy low vol | 100 | -7.41 | -0.74 | 26 | 74 | 26.0 | -27.61 | 19h 41m |
| Sep 2024 | bearish choppy low vol | 91 | +3.37 | 0.37 | 28 | 63 | 30.8 | -26.51 | 23h 20m |
| Aug 2024 | bearish choppy high vol | 41 | -4.47 | -1.09 | 9 | 32 | 22.0 | -25.57 | 17h 07m |
| Jul 2024 | bearish trending low vol | 73 | -6.36 | -0.87 | 13 | 60 | 17.8 | -23.44 | 17h 21m |
| Jun 2024 | bearish choppy low vol | 19 | -0.57 | -0.30 | 6 | 13 | 31.6 | -20.99 | 23h 19m |
| May 2024 | bullish choppy high vol | 76 | -4.10 | -0.54 | 18 | 58 | 23.7 | -20.16 | 17h 03m |
| Apr 2024 | bearish choppy high vol | 38 | -6.32 | -1.66 | 8 | 30 | 21.1 | -18.21 | 20h 30m |
| Mar 2024 | bullish trending high vol | 177 | -5.54 | -0.31 | 52 | 125 | 29.4 | -16.53 | 20h 11m |
| Feb 2024 | bullish trending low vol | 163 | +3.54 | 0.22 | 53 | 110 | 32.5 | -14.82 | 23h 25m |
| Jan 2024 | bearish choppy high vol | 82 | -13.01 | -1.59 | 19 | 63 | 23.2 | -14.64 | 17h 31m |
| Dec 2023 | bullish trending low vol | 222 | +14.20 | 0.64 | 69 | 153 | 31.1 | -15.17 | 18h 54m |
| Nov 2023 | bullish trending low vol | 164 | +16.77 | 1.02 | 60 | 104 | 36.6 | -23.03 | 24h 10m |
| Oct 2023 | bullish trending low vol | 112 | +2.35 | 0.21 | 27 | 85 | 24.1 | -25.22 | 20h 28m |
| Sep 2023 | bearish choppy low vol | 31 | -1.97 | -0.63 | 6 | 25 | 19.4 | -23.96 | 17h 33m |
| Aug 2023 | bearish choppy low vol | 13 | +0.26 | 0.20 | 6 | 7 | 46.2 | -23.3 | 25h 14m |
| Jul 2023 | bullish trending low vol | 159 | -6.50 | -0.41 | 43 | 116 | 27.0 | -23.09 | 18h 28m |
| Jun 2023 | bullish trending low vol | 39 | +3.47 | 0.89 | 12 | 27 | 30.8 | -21.7 | 14h 42m |
| May 2023 | bearish choppy low vol | 22 | -1.40 | -0.64 | 2 | 20 | 9.1 | -21.77 | 23h 19m |
| Apr 2023 | bullish trending low vol | 131 | -6.05 | -0.46 | 35 | 96 | 26.7 | -20.98 | 20h 17m |
| Mar 2023 | bullish trending high vol | 40 | -3.73 | -0.93 | 9 | 31 | 22.5 | -18.66 | 18h 33m |
| Feb 2023 | bullish trending low vol | 107 | -1.28 | -0.12 | 35 | 72 | 32.7 | -16.37 | 20h 30m |
| Jan 2023 | bullish trending low vol | 166 | +19.82 | 1.19 | 61 | 105 | 36.7 | -25.37 | 21h 18m |
| Dec 2022 | bearish trending low vol | 11 | -2.01 | -1.83 | 3 | 8 | 27.3 | -25.14 | 18h 33m |
| Nov 2022 | bearish trending high vol | 57 | -0.24 | -0.04 | 14 | 43 | 24.6 | -24.68 | 17h 58m |
| Oct 2022 | bullish choppy low vol | 47 | -0.04 | -0.01 | 19 | 28 | 40.4 | -25.13 | 20h 43m |
| Sep 2022 | bearish choppy high vol | 64 | -13.50 | -2.11 | 9 | 55 | 14.1 | -24.06 | 10h 50m |
| Aug 2022 | bullish choppy high vol | 99 | -6.96 | -0.70 | 28 | 71 | 28.3 | -17.65 | 19h 16m |
| Jul 2022 | bearish trending high vol | 78 | -11.43 | -1.47 | 19 | 59 | 24.4 | -14.35 | 18h 47m |
| Jun 2022 | bearish trending high vol | 4 | -0.78 | -1.95 | 0 | 4 | 0.0 | -8.93 | 12h 15m |
| May 2022 | bearish trending high vol | 11 | -0.77 | -0.70 | 3 | 8 | 27.3 | -8.56 | 20h 00m |
| Apr 2022 | bearish choppy high vol | 61 | -4.22 | -0.69 | 14 | 47 | 23.0 | -8.2 | 15h 33m |
| Mar 2022 | bullish choppy high vol | 72 | +5.45 | 0.76 | 29 | 43 | 40.3 | -10.53 | 27h 12m |
| Feb 2022 | bearish trending high vol | 12 | -3.02 | -2.52 | 0 | 12 | 0.0 | -8.78 | 13h 20m |
| Jan 2022 | bearish trending high vol | 20 | -3.70 | -1.85 | 5 | 15 | 25.0 | -7.53 | 18h 51m |
| Dec 2021 | bearish trending high vol | 13 | -0.68 | -0.52 | 4 | 9 | 30.8 | -5.99 | 19h 42m |
| Nov 2021 | bullish trending high vol | 91 | -5.25 | -0.57 | 22 | 69 | 24.2 | -6.45 | 17h 38m |
| Oct 2021 | bullish trending high vol | 136 | -4.23 | -0.31 | 40 | 96 | 29.4 | -4.39 | 19h 45m |
| Sep 2021 | bearish trending high vol | 73 | +8.56 | 1.17 | 32 | 41 | 43.8 | -2.8 | 24h 42m |
| Aug 2021 | bullish trending high vol | 186 | +20.38 | 1.09 | 65 | 121 | 34.9 | -7.51 | 20h 11m |
| Jul 2021 | bearish trending high vol | 13 | -0.98 | -0.75 | 3 | 10 | 23.1 | -4.88 | 19h 05m |
| Jun 2021 | bearish trending high vol | 5 | -1.20 | -2.40 | 0 | 5 | 0.0 | -4.22 | 15h 36m |
| May 2021 | bearish trending high vol | 102 | +1.94 | 0.19 | 35 | 67 | 34.3 | -4.03 | 19h 31m |
| Apr 2021 | bearish choppy high vol | 165 | +15.76 | 0.95 | 58 | 107 | 35.2 | -4.3 | 18h 28m |
| Mar 2021 | bullish choppy high vol | 133 | +9.74 | 0.73 | 42 | 91 | 31.6 | -10.68 | 18h 57m |
| Feb 2021 | bullish trending high vol | 164 | +35.33 | 2.15 | 71 | 93 | 43.3 | -7.74 | 20h 59m |
| Jan 2021 | bullish trending high vol | 178 | +19.68 | 1.10 | 64 | 114 | 36.0 | -10.02 | 18h 43m |
Yearly breakdown
| Year | Trades | Profit % | Avg % | Win | Loss | Win % | DD % | Avg dur |
|---|---|---|---|---|---|---|---|---|
| 2026 | 1 | -0.04 | -0.40 | 0 | 1 | 0.0 | -35.32 | 2h 00m |
| 2025 | 643 | -41.20 | -0.64 | 169 | 474 | 26.3 | -35.34 | 20h 05m |
| 2024 | 1159 | -16.15 | -0.14 | 340 | 819 | 29.3 | -28.45 | 20h 18m |
| 2023 | 1206 | +35.94 | 0.30 | 365 | 841 | 30.3 | -25.37 | 20h 18m |
| 2022 | 536 | -41.22 | -0.77 | 143 | 393 | 26.7 | -25.14 | 18h 37m |
| 2021 | 1259 | +99.05 | 0.78 | 436 | 823 | 34.6 | -10.68 | 19h 40m |
Trade charts — best 2 and worst 2 performing pairs (full OHLC candles are expensive to render for every pair)
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
no lookahead patterns · 1 thing(s) worth reviewing before trusting the numbers
| Line | Pattern | Detail | |
|---|---|---|---|
| 37 | review | unthrottled_candle_processing | process_only_new_candles is False, so populate_indicators/populate_entry_trend/populate_exit_trend re-run every throttle_secs (default 5s) even though their inputs -- closed candles -- haven't changed since the last run. This wastes CPU without changing any value; if the goal is order-book-level checks, put that logic in confirm_trade_entry/custom_exit instead, which already run every loop |
ran by Ron · took s
Lookahead analysis
freqtrade lookahead-analysis: detects strategies peeking at future candles.