el_extrema
♡
Basics
mode: futures
timeframe: 5m
interface version: 3
Settings
stoploss: -0.05
has minimal roi
protections
process only new candles
hyperopt
hyperopt params: 10
Indicators
EMA
RSI
SMA
scipy
talib
Concepts
risk_management
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 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 | import numpy import warnings import talib.abstract as ta import freqtrade.vendor.qtpylib.indicators as qtpylib from datetime import datetime from freqtrade.strategy.interface import IStrategy from typing import Dict, List from functools import reduce from pandas import DataFrame, errors from datetime import datetime import numpy from scipy.signal import argrelextrema from freqtrade.strategy import ( IStrategy, DecimalParameter, IntParameter, CategoricalParameter, BooleanParameter ) warnings.simplefilter(action="ignore", category=errors.PerformanceWarning) class el_extrema(IStrategy): INTERFACE_VERSION = 3 can_short = True entry_params = { 'base_nb_candles_entry': 12, 'ewo_high': 4.428, 'ewo_low': -12.383, 'low_offset': 0.915, 'rsi_entry': 44, } exit_params = { 'base_nb_candles_exit': 72, 'high_offset': 1.008, } 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 = -0.05 max_open_trades = 9 timeframe = '5m' informative_timeframe = '1h' process_only_new_candles = True use_custom_stoploss = False trailing_stop = False use_exit_signal = True exit_profit_only = False exit_profit_offset = 0.01 ignore_roi_if_entry_signal = True base_nb_candles_entry = IntParameter(5, 80, default=entry_params['base_nb_candles_entry'], space='entry', optimize=True) base_nb_candles_exit = IntParameter(5, 80, default=exit_params['base_nb_candles_exit'], space='exit', optimize=True) low_offset = DecimalParameter(0.9, 0.99, default=entry_params['low_offset'], space='entry', optimize=True) high_offset = DecimalParameter(0.99, 1.1, default=exit_params['high_offset'], space='exit', optimize=True) fast_ewo = 50 slow_ewo = 200 ewo_low = DecimalParameter(-20.0, -8.0, default=entry_params['ewo_low'], space='entry', optimize=True) ewo_high = DecimalParameter(2.0, 12.0, default=entry_params['ewo_high'], space='entry', optimize=True) rsi_entry = IntParameter(30, 70, default=entry_params['rsi_entry'], space='entry', optimize=True) cooldown_lookback = IntParameter(2, 48, default=1, space='protection', optimize=True) stop_duration = IntParameter(12, 200, default=4, space='protection', optimize=True) use_stop_protection = BooleanParameter(default=True, space='protection', optimize=True) @property def protections(self): prot = [] prot.append( { 'method': 'CooldownPeriod', 'stop_duration_candles': self.cooldown_lookback.value } ) if self.use_stop_protection.value: prot.append( { 'method': 'StoplossGuard', 'lookback_period_candles': 24 * 3, 'trade_limit': 2, 'stop_duration_candles': self.stop_duration.value, 'only_per_pair': False, } ) return prot @property def plot_config(self): plot_config = {} plot_config['main_plot'] = { '%-obv' : {}, '&-s_close' : {} } plot_config['subplots'] = { 'RSI': { 'rsi': {} }, 'SMA' : { 'sma5' : {}, 'sma35' : {}, }, 'EWO' : { 'EWO' : {} } } return plot_config def informative_pairs(self): pairs = self.dp.current_whitelist() informative_pairs = [(pair, self.informative_timeframe) for pair in pairs] return informative_pairs def get_informative_indicators(self, metadata: dict): dataframe = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.informative_timeframe) return dataframe def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame: for val in self.base_nb_candles_entry.range: dataframe[f'ma_entry_{val}'] = ta.EMA(dataframe, timeperiod=val) for val in self.base_nb_candles_exit.range: dataframe[f'ma_exit_{val}'] = ta.EMA(dataframe, timeperiod=val) dataframe['sma5'] = ta.SMA(dataframe, timeperiod=5) dataframe['sma35'] = ta.SMA(dataframe, timeperiod=35) dataframe['EWO'] = (dataframe['sma5'] - dataframe['sma35']) / dataframe['close'] * 100 dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14) dataframe['&s-extrema'] = 0 dataframe.loc[argrelextrema(dataframe['close'].values, numpy.less, order=5)[0], '&s-extrema'] = -1 dataframe.loc[argrelextrema(dataframe['close'].values, numpy.greater, order=5)[0], '&s-extrema'] = 1 return dataframe def populate_entry_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame: entry_conditions = [ ( (dataframe['&s-extrema'] < 0) & (dataframe['close'] < dataframe[f'ma_entry_{self.base_nb_candles_entry.value}'] * self.low_offset.value) & (dataframe['EWO'] > self.ewo_high.value) & (dataframe['rsi'] < self.rsi_entry.value) & (dataframe['volume'] > 0) ), ( (dataframe['&s-extrema'] < 0) & (dataframe['close'] < dataframe[f'ma_entry_{self.base_nb_candles_entry.value}'] * self.low_offset.value) & (dataframe['EWO'] < self.ewo_low.value) & (dataframe['volume'] > 0) ) ] if entry_conditions: dataframe.loc[reduce(lambda x, y: x | y, entry_conditions), 'enter_long'] = 1 exit_conditions = [ ( (dataframe['&s-extrema'] > 0) & (dataframe['close'] > dataframe[f'ma_exit_{self.base_nb_candles_exit.value}'] * self.high_offset.value) & (dataframe['volume'] > 0) ) ] if exit_conditions: dataframe.loc[reduce(lambda x, y: x | y, exit_conditions), 'enter_short'] = 1 return dataframe def populate_exit_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame: exit_long_conditions = [ ( (dataframe['&s-extrema'] > 0) & (dataframe['close'] > dataframe[f'ma_exit_{self.base_nb_candles_exit.value}'] * self.high_offset.value) & (dataframe['volume'] > 0) ) ] if exit_long_conditions: dataframe.loc[reduce(lambda x, y: x | y, exit_long_conditions), 'exit_long'] = 1 exit_short_conditions = [ ( (dataframe['&s-extrema'] < 0) & (dataframe['close'] < dataframe[f'ma_entry_{self.base_nb_candles_entry.value}'] * self.low_offset.value) & (dataframe['EWO'] > self.ewo_high.value) & (dataframe['rsi'] < self.rsi_entry.value) & (dataframe['volume'] > 0) ), ( (dataframe['close'] < dataframe[f'ma_entry_{self.base_nb_candles_entry.value}'] * self.low_offset.value) & (dataframe['EWO'] < self.ewo_low.value) & (dataframe['volume'] > 0) ) ] if exit_short_conditions: dataframe.loc[reduce(lambda x, y: x | y, exit_short_conditions), 'exit_short'] = 1 return dataframe def leverage(self, pair: str, current_time: datetime, current_rate: float, proposed_leverage: float, max_leverage: float, entry_tag:str, side: str, **kwargs) -> float: return 10.0 |
Strategy League — fixed backtest that feeds the ranking
Failed — timed out after 1800s (strategy too complex/slow for the sandbox)
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.