Basics
mode: spot
timeframe: 15m
Settings
stoploss: -0.03
has minimal roi
process only new candles
startup candle count: 120
3 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 | from __future__ import annotations from typing import Any import numpy as np import pandas as pd from freqtrade.strategy import IStrategy class VisualPriceAction(IStrategy): """ Range odaklı price-action stratejisi. - Swing high/low (2 sol + 2 sağ) - Trend: UP / DOWN / RANGE - RANGE alt bandında wick + hacim filtresiyle giriş - RANGE üst bandında wick + hacim filtresiyle çıkış """ timeframe = "15m" minimal_roi = {"0": 0.02} stoploss = -0.03 trailing_stop = False process_only_new_candles = True startup_candle_count = 120 use_exit_signal = True range_tolerance = 0.003 touch_lookback = 30 min_touches = 3 wick_ratio = 1.5 def populate_indicators(self, dataframe: pd.DataFrame, metadata: dict[str, Any]) -> pd.DataFrame: df = dataframe df["body"] = (df["close"] - df["open"]).abs() df["upper_wick"] = df["high"] - df[["close", "open"]].max(axis=1) df["lower_wick"] = df[["close", "open"]].min(axis=1) - df["low"] df["volume_sma_20"] = df["volume"].rolling(20).mean() raw_swing_high = ( (df["high"] > df["high"].shift(1)) & (df["high"] > df["high"].shift(2)) & (df["high"] > df["high"].shift(-1)) & (df["high"] > df["high"].shift(-2)) ) raw_swing_low = ( (df["low"] < df["low"].shift(1)) & (df["low"] < df["low"].shift(2)) & (df["low"] < df["low"].shift(-1)) & (df["low"] < df["low"].shift(-2)) ) # Lookahead bias engeli için swing onayı 2 mum sonra aktif olur. df["swing_high"] = raw_swing_high.shift(2).fillna(False) df["swing_low"] = raw_swing_low.shift(2).fillna(False) last_high = np.nan prev_high = np.nan last_low = np.nan prev_low = np.nan last_highs: list[float] = [] prev_highs: list[float] = [] last_lows: list[float] = [] prev_lows: list[float] = [] for high, low, is_high, is_low in zip(df["high"], df["low"], df["swing_high"], df["swing_low"]): if is_high: prev_high = last_high last_high = high if is_low: prev_low = last_low last_low = low last_highs.append(last_high) prev_highs.append(prev_high) last_lows.append(last_low) prev_lows.append(prev_low) df["last_swing_high"] = pd.Series(last_highs, index=df.index) df["prev_swing_high"] = pd.Series(prev_highs, index=df.index) df["last_swing_low"] = pd.Series(last_lows, index=df.index) df["prev_swing_low"] = pd.Series(prev_lows, index=df.index) trend_up = (df["last_swing_high"] > df["prev_swing_high"]) & (df["last_swing_low"] > df["prev_swing_low"]) trend_down = (df["last_swing_high"] < df["prev_swing_high"]) & (df["last_swing_low"] < df["prev_swing_low"]) df["trend"] = np.select([trend_up, trend_down], ["UP", "DOWN"], default="RANGE") df["range_high"] = df["last_swing_high"] df["range_low"] = df["last_swing_low"] df["near_range_low"] = ((df["close"] - df["range_low"]).abs() / df["range_low"]) <= self.range_tolerance df["near_range_high"] = ((df["close"] - df["range_high"]).abs() / df["range_high"]) <= self.range_tolerance df["touch_low"] = df["low"] <= (df["range_low"] * (1 + self.range_tolerance)) df["touch_high"] = df["high"] >= (df["range_high"] * (1 - self.range_tolerance)) df["touch_low_bounce"] = df["touch_low"] & (df["close"] > df["open"]) df["touch_high_reject"] = df["touch_high"] & (df["close"] < df["open"]) df["touch_low_count"] = df["touch_low_bounce"].rolling(self.touch_lookback).sum() df["touch_high_count"] = df["touch_high_reject"].rolling(self.touch_lookback).sum() df["lower_wick_ratio"] = df["lower_wick"] / df["body"].replace(0, np.nan) df["upper_wick_ratio"] = df["upper_wick"] / df["body"].replace(0, np.nan) return df def populate_entry_trend(self, dataframe: pd.DataFrame, metadata: dict[str, Any]) -> pd.DataFrame: df = dataframe long_condition = ( (df["trend"] == "RANGE") & df["near_range_low"] & (df["touch_low_count"] >= self.min_touches) & (df["lower_wick_ratio"] > self.wick_ratio) & (df["volume"] < df["volume_sma_20"]) ) df.loc[long_condition, ["enter_long", "enter_tag"]] = (1, "range_support_bounce") return df def populate_exit_trend(self, dataframe: pd.DataFrame, metadata: dict[str, Any]) -> pd.DataFrame: df = dataframe exit_condition = ( (df["trend"] == "RANGE") & df["near_range_high"] & (df["touch_high_count"] >= self.min_touches) & (df["upper_wick_ratio"] > self.wick_ratio) & (df["volume"] < df["volume_sma_20"]) ) df.loc[exit_condition, ["exit_long", "exit_tag"]] = (1, "range_resistance_reject") return df |
Strategy League — fixed backtest that feeds the ranking
Export report Freqtrade logsRun finished · took 126.8s
pairs 33 pairs
timerange 20210101-20260101
mode spot
timeframe 15m
stake 100 USDT
wallet 1000 USDT
max open trades 10
fee exchange lowest tier
total profit-89.90%
final wallet101 USDT
win rate55.3%
max drawdown-90.73%
market change+457.08%
vs market-546.98%
timeframe15m
profit factor0.86
expectancy ratio-0.062
break-even fee0.0266%
sharpe-4.232
sortino-7.59
CAGR-36.8%
calmar-1.037
avg MFE+1.70%
avg MAE-1.82%
avg profit/trade-0.15%
avg duration4h 30m
best trade+2.06%
worst trade-3.19%
win/loss streak29 / 19
positive months3/17
consistent (3-mo)6.7%
worst 3-mo-32.67%
trades6136
revision1
likely annual return-81%
range (5th–95th)-88% … -71%
chance of profit0.0%
worst-5% outcome-89%
significance (p)1.0
risk of ruin0.0%
- profit isn't statistically significant (p=1.00) — hard to tell apart from luck
- only 0% of resampled runs were profitable
- profitable in only 7% 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 |
|---|---|---|---|---|---|---|---|---|---|
| May 2022 | bearish trending high vol | 50 | -5.07 | -1.01 | 17 | 33 | 34.0 | -90.73 | 3h 40m |
| Apr 2022 | bearish choppy high vol | 80 | -4.02 | -0.50 | 37 | 43 | 46.2 | -86.07 | 7h 35m |
| Mar 2022 | bullish choppy high vol | 94 | -0.12 | -0.01 | 51 | 43 | 54.3 | -84.7 | 6h 32m |
| Feb 2022 | bearish trending high vol | 160 | -5.37 | -0.34 | 79 | 81 | 49.4 | -82.92 | 5h 20m |
| Jan 2022 | bearish trending high vol | 209 | -4.65 | -0.22 | 110 | 99 | 52.6 | -78.74 | 5h 04m |
| Dec 2021 | bearish trending high vol | 253 | -8.07 | -0.32 | 123 | 130 | 48.6 | -73.53 | 6h 01m |
| Nov 2021 | bullish trending high vol | 318 | -5.74 | -0.18 | 170 | 148 | 53.5 | -67.18 | 6h 12m |
| Oct 2021 | bullish trending high vol | 392 | -4.31 | -0.11 | 209 | 183 | 53.3 | -61.56 | 5h 35m |
| Sep 2021 | bearish trending high vol | 432 | -13.95 | -0.32 | 221 | 211 | 51.2 | -58.19 | 5h 09m |
| Aug 2021 | bullish trending high vol | 498 | +1.71 | 0.03 | 299 | 199 | 60.0 | -48.28 | 4h 44m |
| Jul 2021 | bearish trending high vol | 481 | -4.50 | -0.09 | 265 | 216 | 55.1 | -50.79 | 5h 29m |
| Jun 2021 | bearish trending high vol | 474 | -15.88 | -0.34 | 250 | 224 | 52.7 | -41.34 | 3h 59m |
| May 2021 | bearish trending high vol | 473 | -12.29 | -0.26 | 260 | 213 | 55.0 | -29.09 | 2h 33m |
| Apr 2021 | bearish choppy high vol | 555 | +1.07 | 0.02 | 335 | 220 | 60.4 | -22.63 | 3h 43m |
| Mar 2021 | bullish choppy high vol | 651 | -3.77 | -0.06 | 375 | 276 | 57.6 | -20.94 | 4h 44m |
| Feb 2021 | bullish trending high vol | 449 | +4.04 | 0.09 | 278 | 171 | 61.9 | -16.23 | 3h 05m |
| Jan 2021 | bullish trending high vol | 567 | -9.00 | -0.16 | 314 | 253 | 55.4 | -17.68 | 3h 06m |
Yearly breakdown
| Year | Trades | Profit % | Avg % | Win | Loss | Win % | DD % | Avg dur |
|---|---|---|---|---|---|---|---|---|
| 2022 | 593 | -19.23 | -0.32 | 294 | 299 | 49.6 | -90.73 | 5h 36m |
| 2021 | 5543 | -70.69 | -0.13 | 3099 | 2444 | 55.9 | -73.53 | 4h 23m |
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
6 potential lookahead pattern(s) found · 1 to review
| Line | Pattern | Detail | |
|---|---|---|---|
| 38 | leak | whole_series_reduction | .max() over the whole column sees future rows (use .rolling(window).max() for a causal value) |
| 39 | leak | whole_series_reduction | .min() over the whole column sees future rows (use .rolling(window).min() for a causal value) |
| 46 | leak | negative_shift | shift() with negative periods reads future candles |
| 52 | |||
| 45 | |||
| 51 | |||
| 121 | 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.