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 | # WhaleFollowStrategy - Follow whale/institutional order flow # Powered by AiCoin's exclusive big_orders data (200+ exchanges aggregated) # # How it works: # - Standard indicators (RSI + EMA) provide base signals (works in backtest) # - In live/dry-run mode, AiCoin whale data adds an edge: # * big_orders: detect large institutional buy/sell pressure # * ls_ratio: cross-exchange long/short ratio as contrarian signal # - When whales are buying AND retail is short -> strong long signal # - When whales are selling AND retail is long -> strong short signal # # AiCoin tier required: Normal ($99/mo) for big_orders, Basic ($29/mo) for ls_ratio # Backtest: works with standard indicators only (conservative estimate) # Live: AiCoin data adds alpha on top of base signals # from freqtrade.strategy import IStrategy, IntParameter, DecimalParameter from pandas import DataFrame import logging logger = logging.getLogger(__name__) class WhaleFollowStrategy(IStrategy): INTERFACE_VERSION = 3 timeframe = '15m' can_short = True # ROI: take profit at these thresholds (optimized via hyperopt) minimal_roi = {"0": 0.316, "107": 0.106, "178": 0.047, "217": 0} stoploss = -0.236 use_exit_signal = False # ROI + trailing stop exits outperform signal-based exits trailing_stop = True trailing_stop_positive = 0.042 trailing_stop_positive_offset = 0.061 # Hyperopt-optimizable parameters (defaults from hyperopt optimization) rsi_buy = IntParameter(20, 40, default=34, space='buy') rsi_sell = IntParameter(60, 80, default=65, space='sell') ema_fast_len = IntParameter(5, 15, default=9, space='buy') ema_slow_len = IntParameter(15, 30, default=23, space='buy') whale_weight = DecimalParameter(0.0, 1.0, default=0.324, space='buy') # AiCoin data (updated periodically in live mode) _ac_whale_signal = 0.0 # -1 (selling) to +1 (buying) _ac_ls_ratio = 0.5 # 0-1, >0.5 = more longs _ac_last_update = 0.0 def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame: # ── Standard indicators (always available) ── # RSI delta = dataframe['close'].diff() gain = delta.clip(lower=0).rolling(window=14).mean() loss = (-delta.clip(upper=0)).rolling(window=14).mean() rs = gain / loss dataframe['rsi'] = 100 - (100 / (1 + rs)) # EMA dataframe['ema_fast'] = dataframe['close'].ewm( span=self.ema_fast_len.value, adjust=False).mean() dataframe['ema_slow'] = dataframe['close'].ewm( span=self.ema_slow_len.value, adjust=False).mean() # Volume SMA (for volume confirmation) dataframe['vol_sma'] = dataframe['volume'].rolling(window=20).mean() # ── AiCoin whale data (live/dry-run only) ── dataframe['whale_signal'] = 0.0 dataframe['ls_ratio'] = 0.5 if self.dp and self.dp.runmode.value in ('live', 'dry_run'): import time now = time.time() # Update AiCoin data every 5 minutes if now - self._ac_last_update > 300: self._update_aicoin_data(metadata) self._ac_last_update = now # Apply to last row (current candle) dataframe.iloc[-1, dataframe.columns.get_loc('whale_signal')] = self._ac_whale_signal dataframe.iloc[-1, dataframe.columns.get_loc('ls_ratio')] = self._ac_ls_ratio return dataframe def _update_aicoin_data(self, metadata: dict): """Fetch latest AiCoin whale data (live/dry-run only).""" try: import sys, os _sd = os.path.dirname(os.path.abspath(__file__)) if _sd not in sys.path: sys.path.insert(0, _sd) from aicoin_data import AiCoinData ac = AiCoinData(cache_ttl=300) pair = metadata.get('pair', 'BTC/USDT:USDT') exchange = self.config.get('exchange', {}).get('name', 'binance') # Whale order-book pressure: -1 (selling) .. +1 (buying) try: self._ac_whale_signal = ac.whale_signal(pair, exchange) logger.info(f"AiCoin whale signal for {pair}: {self._ac_whale_signal:.2f}") except Exception as e: logger.debug(f"AiCoin whale data unavailable: {e}") # Long/short ratio normalized to 0..1 ( >0.5 = more longs ) try: self._ac_ls_ratio = ac.ls_ratio_norm() logger.info(f"AiCoin L/S ratio: {self._ac_ls_ratio:.2f}") except Exception as e: logger.debug(f"AiCoin ls_ratio unavailable: {e}") except ImportError: logger.warning("aicoin_data module not found. Run ft-deploy.mjs to install.") except Exception as e: logger.warning(f"AiCoin data error: {e}") def populate_entry_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame: w = self.whale_weight.value # Long entry: uptrend + RSI low + whale buying + retail short dataframe.loc[ (dataframe['rsi'] < self.rsi_buy.value) & (dataframe['ema_fast'] > dataframe['ema_slow']) & (dataframe['volume'] > dataframe['vol_sma'] * 0.5) & # AiCoin boost: whale buying (signal > 0) or no data (signal == 0) (dataframe['whale_signal'] >= -0.3 * w) & # AiCoin boost: contrarian - retail is short (ls_ratio < 0.5) (dataframe['ls_ratio'] <= 0.5 + 0.2 * (1 - w)), 'enter_long'] = 1 # Short entry: downtrend + RSI high + whale selling + retail long dataframe.loc[ (dataframe['rsi'] > self.rsi_sell.value) & (dataframe['ema_fast'] < dataframe['ema_slow']) & (dataframe['volume'] > dataframe['vol_sma'] * 0.5) & (dataframe['whale_signal'] <= 0.3 * w) & (dataframe['ls_ratio'] >= 0.5 - 0.2 * (1 - w)), 'enter_short'] = 1 return dataframe def populate_exit_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame: dataframe.loc[ (dataframe['rsi'] > 75), 'exit_long'] = 1 dataframe.loc[ (dataframe['rsi'] < 25), 'exit_short'] = 1 return dataframe |
Strategy League — fixed backtest that feeds the ranking
Export report Freqtrade logsRun finished · took 156.3s
ℹ️ This strategy uses a trailing stop — freqtrade only
re-checks these once per 15m candle by default, not against the price movement within it.
For a more accurate read, re-run this backtest locally with --timeframe-detail 1m. 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=1.00) — hard to tell apart from luck
- only 0% of resampled runs were profitable
- profitable in only 26% of rolling 3-month windows
- did not beat simply holding the market
- very deep drawdown (-91%)
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 |
|---|---|---|---|---|---|---|---|---|---|
| Jun 2023 | bullish trending low vol | 3 | -4.80 | -15.99 | 0 | 3 | 0.0 | -91.47 | 321h 45m |
| Apr 2023 | bullish trending low vol | 24 | -1.53 | -0.64 | 19 | 5 | 79.2 | -87.75 | 39h 26m |
| Mar 2023 | bullish trending high vol | 21 | -1.27 | -0.72 | 16 | 5 | 76.2 | -86.18 | 19h 05m |
| Feb 2023 | bullish trending low vol | 26 | -6.47 | -2.54 | 14 | 12 | 53.8 | -84.78 | 34h 21m |
| Jan 2023 | bullish trending low vol | 101 | +1.73 | 0.17 | 72 | 29 | 71.3 | -81.64 | 12h 01m |
| Dec 2022 | bearish trending low vol | 52 | -1.51 | -0.29 | 33 | 19 | 63.5 | -81.12 | 32h 24m |
| Nov 2022 | bearish trending high vol | 57 | +5.28 | 0.97 | 39 | 18 | 68.4 | -83.93 | 12h 36m |
| Oct 2022 | bullish choppy low vol | 41 | -3.33 | -0.81 | 20 | 21 | 48.8 | -85.05 | 30h 31m |
| Sep 2022 | bearish choppy high vol | 34 | +0.92 | 0.27 | 23 | 11 | 67.6 | -81.63 | 28h 01m |
| Aug 2022 | bullish choppy high vol | 27 | -0.87 | -0.32 | 16 | 11 | 59.3 | -82.39 | 48h 40m |
| Jul 2022 | bullish trending high vol | 33 | -1.25 | -0.41 | 18 | 15 | 54.5 | -81.04 | 37h 37m |
| Jun 2022 | bearish trending high vol | 63 | -4.61 | -0.75 | 42 | 21 | 66.7 | -82.2 | 21h 56m |
| May 2022 | bearish trending high vol | 68 | +0.21 | 0.07 | 44 | 24 | 64.7 | -77.44 | 19h 23m |
| Apr 2022 | bearish choppy high vol | 43 | -3.54 | -0.81 | 26 | 17 | 60.5 | -76.45 | 36h 14m |
| Mar 2022 | bullish choppy high vol | 93 | +2.53 | 0.29 | 70 | 23 | 75.3 | -74.84 | 15h 56m |
| Feb 2022 | bearish trending high vol | 116 | -3.78 | -0.33 | 81 | 35 | 69.8 | -75.32 | 13h 29m |
| Jan 2022 | bearish trending high vol | 109 | -6.24 | -0.57 | 69 | 40 | 63.3 | -76.63 | 15h 58m |
| Dec 2021 | bearish trending high vol | 100 | -6.81 | -0.66 | 66 | 34 | 66.0 | -68.98 | 27h 24m |
| Nov 2021 | bearish trending high vol | 131 | -7.75 | -0.66 | 90 | 41 | 68.7 | -60.67 | 18h 20m |
| Oct 2021 | bullish trending high vol | 160 | -0.66 | -0.00 | 112 | 48 | 70.0 | -56.26 | 21h 22m |
| Sep 2021 | bearish trending high vol | 213 | +14.70 | 0.70 | 161 | 52 | 75.6 | -65.9 | 10h 17m |
| Aug 2021 | bullish trending high vol | 130 | -11.64 | -0.90 | 82 | 48 | 63.1 | -67.63 | 16h 44m |
| Jul 2021 | bullish trending high vol | 182 | -2.41 | -0.13 | 126 | 56 | 69.2 | -55.92 | 14h 26m |
| Jun 2021 | bearish trending high vol | 165 | -12.63 | -0.76 | 115 | 50 | 69.7 | -59.77 | 17h 42m |
| May 2021 | bearish trending high vol | 344 | -35.13 | -1.04 | 234 | 110 | 68.0 | -48.82 | 10h 55m |
| Apr 2021 | bearish choppy high vol | 330 | -1.79 | -0.10 | 230 | 100 | 69.7 | -15.24 | 13h 56m |
| Mar 2021 | bullish choppy high vol | 342 | -6.63 | -0.20 | 242 | 100 | 70.8 | -10.46 | 13h 41m |
| Feb 2021 | bullish trending high vol | 331 | +7.87 | 0.25 | 227 | 104 | 68.6 | -9.98 | 10h 18m |
| Jan 2021 | bullish trending high vol | 361 | +1.10 | 0.04 | 271 | 90 | 75.1 | -19.99 | 8h 06m |
Yearly breakdown
| Year | Trades | Profit % | Avg % | Win | Loss | Win % | DD % | Avg dur |
|---|---|---|---|---|---|---|---|---|
| 2023 | 175 | -12.34 | -0.73 | 121 | 54 | 69.1 | -91.47 | 25h 15m |
| 2022 | 736 | -16.19 | -0.21 | 481 | 255 | 65.4 | -85.05 | 22h 01m |
| 2021 | 2789 | -61.78 | -0.23 | 1956 | 833 | 70.1 | -68.98 | 13h 34m |
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
2 potential lookahead pattern(s) found
| Line | Pattern | Detail | |
|---|---|---|---|
| 81 | leak | iloc_last | .iloc[-1] in populate_* applies the newest candle to all rows |
| 82 |
ran by Ron · took s
Lookahead analysis
freqtrade lookahead-analysis: detects strategies peeking at future candles.