ZaratustraV18
♡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 | # pragma pylint: disable=missing-docstring, invalid-name, pointless-string-statement # flake8: noqa: F401 # isort: skip_file # --- Do not remove these imports --- from freqtrade.strategy import IStrategy from datetime import datetime from pandas import DataFrame from typing import Dict, List import talib.abstract as ta from technical import qtpylib from sklearn.preprocessing import MinMaxScaler class ZaratustraV18(IStrategy): # Parameters INTERFACE_VERSION = 3 timeframe = '5m' can_short = True use_exit_signal = False exit_profit_only = True # ROI table: minimal_roi = { "0": 0.5, "60": 0.45, "120": 0.4, "240": 0.3, "360": 0.25, "720": 0.2, "1440": 0.15, "2880": 0.1, "3600": 0.05, "7200": 0.02, } # Stoploss: stoploss = -0.20 # Trailing stop: trailing_stop = True trailing_stop_positive = 0.013 trailing_stop_positive_offset = 0.050 trailing_only_offset_is_reached = True # Max Open Trades: max_open_trades = 10 @property def protections(self): return [ { "method": "CooldownPeriod", "stop_duration_candles": 6 }, { "method": "LowProfitPairs", "lookback_period_candles": 6, "trade_limit": 2, "stop_duration_candles": 60, "required_profit": 0.02 }, { "method": "LowProfitPairs", "lookback_period_candles": 24, "trade_limit": 4, "stop_duration_candles": 2, "required_profit": 0.01 } ] @property def plot_config(self): plot_config = {} plot_config['main_plot'] = { 'tsf' : { 'color' : 'black' }, } plot_config['subplots'] = { 'DI': { 'dx' : { 'color': 'yellow' }, 'adx': { 'color': 'orange' }, 'pdi': { 'color': 'green' }, 'mdi': { 'color': 'red' }, 'atr': { 'color': 'purple' }, }, 'Regresion' : { 'slope' : {}, }, } return plot_config def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame: dataframe['dx'] = ta.DX(dataframe) dataframe['adx'] = ta.ADX(dataframe) dataframe['pdi'] = ta.PLUS_DI(dataframe) dataframe['mdi'] = ta.MINUS_DI(dataframe) dataframe['tsf'] = ta.TSF(dataframe) dataframe['atr'] = MinMaxScaler(feature_range=(0, 100)).fit_transform(ta.ATR(dataframe).values.reshape(-1, 1)) dataframe['slope'] = ta.LINEARREG_SLOPE(dataframe) bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2) dataframe['bb_lowerband'] = bollinger['lower'] dataframe['bb_middleband'] = bollinger['mid'] dataframe['bb_upperband'] = bollinger['upper'] return dataframe def populate_entry_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame: ############################## # Bollinger Bands Conditions # ############################## dataframe.loc[ ( qtpylib.crossed_above(dataframe['close'], dataframe['bb_upperband']) & (dataframe['slope'] > dataframe['slope'].shift(1)) & (dataframe['slope'] > 0) ), ['enter_long', 'enter_tag'] ] = (1, 'Long Bollinger enter') dataframe.loc[ ( qtpylib.crossed_below(dataframe['close'], dataframe['bb_lowerband']) & (dataframe['slope'] < dataframe['slope'].shift(1)) & (dataframe['slope'] < 0) ), ['enter_short', 'enter_tag'] ] = (1, 'Short Bollinger enter') ################################## # TimeSeries Forecast Conditions # ################################## dataframe.loc[ ( qtpylib.crossed_above(dataframe['close'], dataframe['tsf']) & (dataframe['slope'] > dataframe['slope'].shift(1)) & (dataframe['slope'] > 0) ), ['enter_long', 'enter_tag'] ] = (1, 'Long TimeSeries Forecast enter') dataframe.loc[ ( qtpylib.crossed_below(dataframe['close'], dataframe['tsf']) & (dataframe['slope'] < dataframe['slope'].shift(1)) & (dataframe['slope'] < 0) ), ['enter_short', 'enter_tag'] ] = (1, 'Short TimeSeries Forecast enter') #################################### # Directional Indicator Conditions # #################################### dataframe.loc[ ( (dataframe['dx'] > dataframe['mdi']) & (dataframe['adx'] > dataframe['mdi']) & (dataframe['pdi'] > dataframe['mdi']) & (dataframe['atr'] > dataframe['mdi']) & (dataframe['slope'] > dataframe['slope'].shift(1)) & (dataframe['slope'] > 0) ), ['enter_long', 'enter_tag'] ] = (1, 'Long DI enter') dataframe.loc[ ( (dataframe['dx'] > dataframe['pdi']) & (dataframe['adx'] > dataframe['pdi']) & (dataframe['mdi'] > dataframe['pdi']) & (dataframe['atr'] > dataframe['pdi']) & (dataframe['slope'] < dataframe['slope'].shift(1)) & (dataframe['slope'] < 0) ), ['enter_short', 'enter_tag'] ] = (1, 'Short DI enter') return dataframe def populate_exit_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame: return dataframe def leverage(self, pair: str, current_time: datetime, current_rate: float, proposed_leverage: float, max_leverage: float, side: str, **kwargs,) -> float: return 10 |
Strategy League — fixed backtest that feeds the ranking
🤖 Machine-learning strategies can't be sandbox-tested for now — they need model libraries, trained model files and (for FreqAI) hours of training compute per run — so this strategy isn't League-ranked. Its code analysis, tags and bias checks above still apply.
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.
🤖 Not available for FreqAI/ML strategies for now — the sandbox has no model libraries or trained model files (see the Strategy League tab).
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
🤖 Not available for FreqAI/ML strategies for now — the sandbox has no model libraries or trained model files (see the Strategy League tab).
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.