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 | # pragma pylint: disable=missing-docstring, invalid-name, pointless-string-statement # flake8: noqa: F401 # isort: skip_file # --- Do not remove these imports --- from datetime import datetime from pandas import DataFrame from freqtrade.strategy import IStrategy, Trade, informative, IntParameter, CategoricalParameter import talib.abstract as ta from technical import qtpylib class ZaratustraV27(IStrategy): INTERFACE_VERSION = 3 timeframe = "15m" can_short = True use_exit_signal = False exit_profit_only = True position_adjustment_enable = True # ROI table: minimal_roi = {} # Base Stoploss: stoploss = -0.99 # Trailing Stop Settings: trailing_stop = True trailing_stop_positive = 0.01 trailing_stop_positive_offset = 0.03 trailing_only_offset_is_reached = True # Max Open Trades max_open_trades = 1 # Optional Risk/Trade Management parameters max_dca_orders = 3 max_exit_position_adjustment = 2 def leverage(self, pair: str, current_time: "datetime", current_rate: float, proposed_leverage: float, max_leverage: float, side: str, **kwargs) -> float: return 10 def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame: # Bollinger Bands for trend context bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2) dataframe[['BBL', 'BBM', 'BBU']] = bollinger[['lower', 'mid', 'upper']] # RSI: Momentum and overbought/oversold indicator dataframe['RSI'] = ta.RSI(dataframe) # ADX and DI components: measure trend strength and direction dataframe['ADX'] = ta.ADX(dataframe) dataframe['PDI'] = ta.PLUS_DI(dataframe) dataframe['MDI'] = ta.MINUS_DI(dataframe) # TSF: Time Series Forecast as a trend direction indicator dataframe['TSF'] = ta.TSF(dataframe) # ATR: Average True Range to capture volatility (useful for adaptive stoploss) dataframe['ATR'] = ta.ATR(dataframe, timeperiod=14) return dataframe def populate_entry_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame: # Bullish entry: Price above the mid Bollinger band and ADX confirms trend strength dataframe.loc[ ( (dataframe['close'] > dataframe['BBM']) & (dataframe['ADX'] > 20) & (dataframe['PDI'] > dataframe['MDI']) ), ['enter_long', 'enter_tag'] ] = (1, 'Bullish trend') # Bearish entry: Price below the mid Bollinger band and ADX confirms trend strength dataframe.loc[ ( (dataframe['close'] < dataframe['BBM']) & (dataframe['ADX'] > 20) & (dataframe['MDI'] > dataframe['PDI']) ), ['enter_short', 'enter_tag'] ] = (1, 'Bearish trend') return dataframe def populate_exit_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame: # Custom exit logic is handled via custom_exit function. return dataframe def adjust_trade_position(self, trade: Trade, current_time: datetime, current_rate: float, current_profit: float, min_stake: float, max_stake: float, **kwargs) -> float: """ Dynamically adjust trade position: - Scale into losing positions if RSI is favorable and TSF confirms trend. - Scale out of winning positions when RSI indicates exhaustion. """ # Get the most recent candle data for the pair dataframe, _ = self.dp.get_analyzed_dataframe(trade.pair, self.timeframe) last_candle = dataframe.iloc[-1] rsi = last_candle['RSI'] tsf = last_candle['TSF'] adx = last_candle['ADX'] filled_entries = trade.select_filled_orders('enter_short' if trade.is_short else 'enter_long') filled_exits = trade.select_filled_orders('exit_short' if trade.is_short else 'exit_long') count_entries = len(filled_entries) count_exits = len(filled_exits) # ------ Scale Into the Position (DCA) ------ # Conditions: trade is losing, market oversold for longs or overbought for shorts, # the price respects the TSF line, and the overall trend is strong (ADX > 20) if current_profit < 0 and count_entries < self.max_dca_orders and adx > 20: if not trade.is_short and rsi < 40 and current_rate > tsf: stake_amount = min(trade.stake_amount * 1.5, max_stake) return stake_amount elif trade.is_short and rsi > 60 and current_rate < tsf: stake_amount = min(trade.stake_amount * 1.5, max_stake) return stake_amount # ------ Scale Out of the Position ------ # Conditions: trade is profitable; RSI indicates potential overextension; # and only scale out a limited number of times. if current_profit > 0.05 and count_exits < self.max_exit_position_adjustment: if not trade.is_short and rsi > 70: return -(trade.amount * 0.25) # exit 25% of the position elif trade.is_short and rsi < 30: return -(trade.amount * 0.25) return None |
Strategy League — fixed backtest that feeds the ranking
Export report Freqtrade logsRun finished · took 978.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=0.51) — hard to tell apart from luck
- only 26% of resampled runs were profitable
- did not beat simply holding the market
- very deep drawdown (-100%)
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 2023 | bullish trending low vol | 100 | -237.57 | -8.24 | 76 | 24 | 76.0 | -100.0 | 20h 02m |
| Dec 2022 | bearish trending low vol | 1088 | -1647.43 | 4.99 | 992 | 96 | 91.2 | -99.79 | 5h 46m |
| Nov 2022 | bearish trending high vol | 3245 | +590.29 | 5.60 | 2785 | 460 | 85.8 | -99.32 | 2h 09m |
| Oct 2022 | bullish choppy low vol | 1819 | -22327.68 | 4.62 | 1643 | 176 | 90.3 | -99.09 | 4h 00m |
| Sep 2022 | bearish choppy high vol | 2590 | +182.04 | 4.68 | 2324 | 266 | 89.7 | -90.42 | 2h 42m |
| Aug 2022 | bullish choppy high vol | 2574 | -2386.38 | 5.45 | 2369 | 205 | 92.0 | -89.98 | 2h 50m |
| Jul 2022 | bullish trending high vol | 3521 | -12319.98 | 5.07 | 3157 | 364 | 89.7 | -87.73 | 2h 04m |
| Jun 2022 | bearish trending high vol | 5197 | -20704.21 | 5.68 | 4325 | 872 | 83.2 | -63.14 | 1h 22m |
| May 2022 | bearish trending high vol | 5338 | +30513.61 | 5.26 | 4493 | 845 | 84.2 | -58.39 | 1h 21m |
| Apr 2022 | bearish choppy high vol | 2545 | -27091.49 | 5.02 | 2327 | 218 | 91.4 | -71.1 | 2h 45m |
| Mar 2022 | bullish choppy high vol | 2750 | +50577.86 | 4.77 | 2446 | 304 | 88.9 | -84.22 | 2h 38m |
| Feb 2022 | bearish trending high vol | 3602 | +1115.76 | 5.87 | 3186 | 416 | 88.5 | -97.2 | 1h 51m |
| Jan 2022 | bearish trending high vol | 3900 | +2958.31 | 5.62 | 3390 | 510 | 86.9 | -99.68 | 1h 45m |
| Dec 2021 | bearish trending high vol | 3353 | +668.48 | 5.08 | 2943 | 410 | 87.8 | -99.64 | 2h 05m |
| Nov 2021 | bearish trending high vol | 2951 | -19083.63 | 4.33 | 2573 | 378 | 87.2 | -99.73 | 2h 21m |
| Oct 2021 | bullish trending high vol | 2738 | -927.66 | 4.47 | 2436 | 302 | 89.0 | -69.3 | 2h 36m |
| Sep 2021 | bearish trending high vol | 4350 | +17449.47 | 5.84 | 3708 | 642 | 85.2 | -91.31 | 1h 37m |
| Aug 2021 | bullish trending high vol | 3926 | +532.95 | 4.56 | 3408 | 518 | 86.8 | -98.02 | 1h 47m |
| Jul 2021 | bullish trending high vol | 3144 | -15130.00 | 4.89 | 2820 | 324 | 89.7 | -96.04 | 2h 12m |
| Jun 2021 | bearish trending high vol | 5421 | -6332.94 | 5.53 | 4588 | 833 | 84.6 | -83.27 | 1h 18m |
| May 2021 | bearish trending high vol | 9236 | +14081.67 | 4.67 | 7207 | 2029 | 78.0 | -12.31 | 0h 46m |
| Apr 2021 | bearish choppy high vol | 5878 | +8411.01 | 4.78 | 4633 | 1245 | 78.8 | -90.92 | 1h 11m |
| Mar 2021 | bullish choppy high vol | 3823 | -2444.62 | 4.79 | 3287 | 536 | 86.0 | -95.88 | 1h 52m |
| Feb 2021 | bullish trending high vol | 6368 | +1194.48 | 5.01 | 5095 | 1273 | 80.0 | -79.69 | 1h 03m |
| Jan 2021 | bullish trending high vol | 6632 | +2258.58 | 4.21 | 5203 | 1429 | 78.5 | -73.39 | 1h 04m |
Yearly breakdown
| Year | Trades | Profit % | Avg % | Win | Loss | Win % | DD % | Avg dur |
|---|---|---|---|---|---|---|---|---|
| 2023 | 100 | -237.57 | -8.24 | 76 | 24 | 76.0 | -100.0 | 20h 02m |
| 2022 | 38169 | -539.30 | 5.31 | 33437 | 4732 | 87.6 | -99.79 | 2h 12m |
| 2021 | 57820 | +677.79 | 4.84 | 47901 | 9919 | 82.8 | -99.73 | 1h 27m |
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 · 5 thing(s) worth reviewing before trusting the numbers
| Line | Pattern | Detail | |
|---|---|---|---|
| 16 | review | no_signal_exits | use_exit_signal is False, minimal_roi is empty and populate_exit_trend returns the dataframe untouched -- the ONLY way out of a trade is the stoploss or the trailing stop. freqtrade's own docs warn that trailing-stop backtests are optimistic (within a candle it assumes price reached the high, ratcheting the trail, before reversing to trigger), so re-run with --timeframe-detail 1m before trusting the result |
| 17 | review | dead_exit_config | exit_profit_only only applies to exit SIGNALS, but use_exit_signal is False -- this setting has no effect |
| 12 | review | missing_startup_candles | uses recursive indicators (ADX, ATR, MINUS_DI, PLUS_DI) but startup_candle_count is not set (default 0). Their value at a bar depends on all bars before it, so freqtrade trims no warmup and the backtest opens with unwarmed values that can't occur live. The longest lookback visible here is bollinger_bands(window=20), so it needs at least that many. Set it to a few times the longest period and confirm with `freqtrade recursive-analysis` |
| 18 | review | unbounded_dca | position_adjustment_enable is on but max_entry_position_adjustment is unset (default -1 = unlimited), so nothing caps how many times a losing position can be added to. backtesting.py only bounds entries when that value is > -1 |
| 65 | review | enter_tag_overwrite | enter_tag/exit_tag is written by 2 separate assignments -- they share one column and run in source order, so a row matching more than one condition keeps only the LAST tag. Per-tag statistics won't mean what they appear to |
ran by Ron · took s
Lookahead analysis
freqtrade lookahead-analysis: detects strategies peeking at future candles.