Ichimoku
♡
Basics
mode: spot
Settings
hyperopt
hyperopt params: 11
Indicators
EMA
Ichimoku
finta
pandas_ta
talib
Concepts
trend_following
Methods
get_entry_signals
get_exit_signals
Other
SimpleStrategy
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 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 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 | from freqtrade.strategy import IStrategy import pandas as pd import pandas_ta as pta import numpy as np from pandas import DataFrame, Series import talib.abstract as ta import freqtrade.vendor.qtpylib.indicators as qtpylib from freqtrade.strategy import ( CategoricalParameter, DecimalParameter, IntParameter, IStrategy, merge_informative_pair, stoploss_from_open, ) # set paths so that we can find imports in parallel directories import os import sys from pathlib import Path group_dir = str(Path(__file__).parent) strat_dir = str(Path(__file__).parent.parent) sys.path.append(strat_dir) sys.path.append(group_dir) import warnings warnings.filterwarnings("ignore", message="The objective has been evaluated at this point before.") from SimpleStrategy import SimpleStrategy from finta import TA as fta ''' Ichimoku indicators and cloud ''' class Ichimoku(SimpleStrategy): plot_config = { 'main_plot': { 'close': {'color': 'lightsteelblue'}, 'senkou_span_a': {'color': 'lightseagreen'}, 'senkou_span_b': {'color': 'lightsalmon'}, 'chikou_span': {'color': 'lightgrey'}, }, 'subplots': { "Diff": { 'tenkan_sen': {'color': 'lightseagreen'}, 'kijun_sen': {'color': 'lightsalmon'}, }, } } enable_guards = True # set to True for testing, False for debug # Buy hyperspace params: buy_params = { **SimpleStrategy.buy_params, "entry_guard_metric": -0.3, "entry_senkou_period": 52, "entry_tenkan_period": 12, "entry_chikou_period": 26, # value loaded from strategy "entry_kijun_period": 26, # value loaded from strategy "entry_momentum_filter": "roc", "entry_tenkan_kijun_filter": "above", "entry_price_action_filter": "higher_low", "entry_use_cloud_thickness": True, "entry_cloud_thickness_max": 0.011, "entry_use_htf_filter": True, "entry_htf_timeframe": "1h", } # Sell hyperspace params: sell_params = { **SimpleStrategy.sell_params, "exit_guard_metric": 0.0, } strategy_type = SimpleStrategy.StrategyType.TREND # Strategy parameters opt_base_params = True opt_filter_params = False # entry_tenkan_period = IntParameter( # 9, 14, default=9, space="buy", load=True, optimize=True # ) # entry_kijun_period = IntParameter( # 26, 40, default=26, space="buy", load=True, optimize=False # ) # entry_senkou_period = IntParameter( # 50, 70, default=52, space="buy", load=True, optimize=True # ) # entry_chikou_period = IntParameter( # 24, 26, default=26, space="buy", load=True, optimize=False # ) entry_tenkan_period = IntParameter( 9, 14, default=9, space="buy", load=True, optimize=opt_base_params ) entry_kijun_period = IntParameter( 26, 40, default=26, space="buy", load=True, optimize=False ) entry_senkou_period = IntParameter( 50, 70, default=52, space="buy", load=True, optimize=opt_base_params ) entry_chikou_period = IntParameter( 24, 26, default=26, space="buy", load=True, optimize=False ) entry_momentum_filter = CategoricalParameter( ["lagging", "roc", "none"], default="roc", space="buy", load=True, optimize=opt_filter_params, ) entry_tenkan_kijun_filter = CategoricalParameter( ["above", "cross"], default="above", space="buy", load=True, optimize=opt_filter_params, ) entry_price_action_filter = CategoricalParameter( ["none", "close_above_prev_high", "higher_low"], default="higher_low", space="buy", load=True, optimize=opt_filter_params, ) entry_use_cloud_thickness = CategoricalParameter( [True, False], default=True, space="buy", load=True, optimize=opt_filter_params ) entry_cloud_thickness_max = DecimalParameter( 0.005, 0.05, default=0.011, decimals=3, space="buy", load=True, optimize=opt_filter_params, ) entry_use_htf_filter = CategoricalParameter( [True, False], default=True, space="buy", load=True, optimize=opt_filter_params ) entry_htf_timeframe = CategoricalParameter( ["1h", "4h"], default="1h", space="buy", load=True, optimize=opt_filter_params ) def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame: dataframe = super().populate_indicators(dataframe, metadata) if self.entry_use_htf_filter.value and self.dp: htf_tf = self.entry_htf_timeframe.value informative = self.dp.get_pair_dataframe(pair=metadata["pair"], timeframe=htf_tf).copy() if "date" not in informative.columns: informative["date"] = informative.index informative["ema200"] = ta.EMA(informative, timeperiod=200) informative = informative[["date", "close", "ema200"]] dataframe = merge_informative_pair( dataframe, informative, self.timeframe, htf_tf, ffill=True ) dataframe["htf_close"] = dataframe[f"close_{htf_tf}"] dataframe["htf_ema200"] = dataframe[f"ema200_{htf_tf}"] # Recalculate signals after adding HTF columns (if any) if self.dp.runmode.value not in ("hyperopt"): dataframe["entry_signals"] = self.get_entry_signals(dataframe) dataframe["exit_signals"] = self.get_exit_signals(dataframe) return dataframe def get_entry_signals(self, dataframe): ichimoku = fta.ICHIMOKU(dataframe, tenkan_period=self.entry_tenkan_period.value, kijun_period=self.entry_kijun_period.value, senkou_period=self.entry_senkou_period.value, chikou_period=self.entry_chikou_period.value ) dataframe['senkou_span_a'] = ichimoku['senkou_span_a'] dataframe['senkou_span_b'] = ichimoku['SENKOU'] dataframe['tenkan_sen'] = ichimoku['TENKAN'] dataframe['kijun_sen'] = ichimoku['KIJUN'] momentum_filter = self.entry_momentum_filter.value if momentum_filter == "roc": momentum_ok = dataframe["roc"] > 0.0 elif momentum_filter == "lagging": momentum_ok = dataframe["close"] > dataframe["close"].shift( int(self.entry_chikou_period.value) ) else: momentum_ok = True tenkan_kijun_filter = self.entry_tenkan_kijun_filter.value if tenkan_kijun_filter == "cross": tk_ok = qtpylib.crossed_above( dataframe["tenkan_sen"], dataframe["kijun_sen"] ) else: tk_ok = dataframe["tenkan_sen"] > dataframe["kijun_sen"] price_action_filter = self.entry_price_action_filter.value if price_action_filter == "close_above_prev_high": price_action_ok = dataframe["close"] > dataframe["high"].shift(1) elif price_action_filter == "higher_low": price_action_ok = dataframe["low"] > dataframe["low"].shift(1) else: price_action_ok = True if self.entry_use_cloud_thickness.value: cloud_thickness = (dataframe["senkou_span_a"] - dataframe["senkou_span_b"]).abs() / dataframe["close"] cloud_ok = cloud_thickness < self.entry_cloud_thickness_max.value else: cloud_ok = True if self.entry_use_htf_filter.value and "htf_ema200" in dataframe: htf_ok = dataframe["htf_close"] > dataframe["htf_ema200"] else: htf_ok = True series = np.where( ( (tk_ok) & (dataframe['senkou_span_a'] > dataframe['senkou_span_b']) & (dataframe['close'] > dataframe['senkou_span_b']) & (momentum_ok) & (price_action_ok) & (cloud_ok) & (htf_ok) ), 1, 0) return series def get_exit_signals(self, dataframe): momentum_filter = self.entry_momentum_filter.value if momentum_filter == "roc": momentum_exit = dataframe["roc"] < 0.0 elif momentum_filter == "lagging": momentum_exit = dataframe["close"] < dataframe["close"].shift( int(self.entry_chikou_period.value) ) else: momentum_exit = True tenkan_kijun_filter = self.entry_tenkan_kijun_filter.value if tenkan_kijun_filter == "cross": tk_exit = qtpylib.crossed_below( dataframe["tenkan_sen"], dataframe["kijun_sen"] ) else: tk_exit = dataframe["tenkan_sen"] < dataframe["kijun_sen"] series = np.where( ( (tk_exit) & (dataframe['senkou_span_a'] < dataframe['senkou_span_b']) & (dataframe['close'] < dataframe['senkou_span_b']) & (momentum_exit) ), 1, 0) return series |
Strategy League — fixed backtest that feeds the ranking
Failed — strategy imports unavailable module: SimpleStrategy
- INFO - Using data directory: /freqle/user_data/data/binance ... 2026-07-21 04:31:48,799 - freqtrade.configuration.configuration - INFO - Parameter --export detected: trades ... 2026-07-21 04:31:48,799 - freqtrade.configuration.configuration - INFO - Parameter --cache=none detected ... 2026-07-21 04:31:48,800 - freqtrade.configuration.configuration - INFO - Filter trades by timerange: 20210101-20260101 2026-07-21 04:31:48,801 - freqtrade.exchange.check_exchange - INFO - Checking exchange... 2026-07-21 04:31:48,807 - freqtrade.exchange.check_exchange - INFO - Exchange "binance" is officially supported by the Freqtrade development team. 2026-07-21 04:31:48,807 - freqtrade.configuration.configuration - INFO - Using pairlist from configuration. 2026-07-21 04:31:48,808 - freqtrade.configuration.config_validation - INFO - Validating configuration ... 2026-07-21 04:31:48,809 - freqtrade.commands.optimize_commands - INFO - Starting freqtrade in Backtesting mode 2026-07-21 04:31:48,810 - freqtrade.exchange.exchange - INFO - Instance is running with dry_run enabled 2026-07-21 04:31:48,810 - freqtrade.exchange.exchange - INFO - Using CCXT 4.5.61 2026-07-21 04:31:48,821 - freqtrade.exchange.exchange - INFO - Using Exchange "Binance" 2026-07-21 04:31:48,998 - freqtrade.resolvers.exchange_resolver - INFO - Using resolved exchange 'Binance'... 2026-07-21 04:31:49,032 - freqtrade.resolvers.iresolver - WARNING - Could not import /freqle/user_data/strategies/Ichimoku.py due to 'No module named 'SimpleStrategy'' 2026-07-21 04:31:49,034 - freqtrade.resolvers.iresolver - WARNING - Could not import /freqle/user_data/strategies/Ichimoku.py due to 'No module named 'SimpleStrategy'' 2026-07-21 04:31:49,035 - freqtrade.resolvers.iresolver - WARNING - Could not import /freqle/user_data/strategies/Ichimoku.py due to 'No module named 'SimpleStrategy'' 2026-07-21 04:31:49,036 - freqtrade - ERROR - Impossible to load Strategy 'Ichimoku'. This class does not exist or contains Python code errors.
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.