TrendStrategy
♡
Basics
mode: spot
timeframe: 1d
Settings
stoploss: -0.1
has minimal roi
Concepts
swing
Other
base_strategy
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 | from .base_strategy import BaseStrategy import pandas as pd import numpy as np class TrendStrategy(BaseStrategy): """ Estrategia de Tendencia + Momentum (Versión Pandas Puro) Combina RSI y Bollinger Bands sin dependencias externas pesadas. """ # Configuración SWING TRADING (4H) # Buscamos movimientos del 3% al 10% en días minimal_roi = { "2880": 0.01, # Dsp de 2 dias (48h*60), aceptar 1% "1440": 0.03, # Dsp de 1 dia, aceptar 3% "720": 0.05, # Dsp de 12h, aceptar 5% "0": 0.10 # Aceptar 10% inmediato } stoploss = -0.10 # 10% Stoploss (Swing da espacio) timeframe = '1d' # Gráfico de 1 Día (24h) def populate_indicators(self, dataframe): closes = dataframe['close'] # 1. RSI (Manual calculation) delta = closes.diff() gain = (delta.where(delta > 0, 0)).rolling(window=14).mean() loss = (-delta.where(delta < 0, 0)).rolling(window=14).mean() rs = gain / loss dataframe['rsi'] = 100 - (100 / (1 + rs)) # 2. Bollinger Bands (Manual calculation) sma = closes.rolling(window=20).mean() std = closes.rolling(window=20).std() dataframe['bb_upper'] = sma + (std * 2) dataframe['bb_lower'] = sma - (std * 2) dataframe['bb_middle'] = sma # 3. SMA Shorts & Longs dataframe['sma_50'] = closes.rolling(window=50).mean() return dataframe def populate_entry_trend(self, dataframe): dataframe['enter_long'] = 0 # Regla: RSI bajo (<35) Y Precio tocando banda inferior conditions = ( (dataframe['rsi'] < 35) & (dataframe['close'] <= dataframe['bb_lower']) ) dataframe.loc[conditions, 'enter_long'] = 1 return dataframe def populate_exit_trend(self, dataframe): dataframe['exit_long'] = 0 # Regla: RSI alto (>70) O Precio tocando banda superior conditions = ( (dataframe['rsi'] > 70) | (dataframe['close'] >= dataframe['bb_upper']) ) dataframe.loc[conditions, 'exit_long'] = 1 return dataframe |
Strategy League — fixed backtest that feeds the ranking
Failed — attempted relative import with no known parent package
,618 - freqtrade.configuration.configuration - INFO - Using data directory: /freqle/user_data/data/binance ... 2026-07-28 14:48:04,618 - freqtrade.configuration.configuration - INFO - Parameter --export detected: none ... 2026-07-28 14:48:04,619 - freqtrade.configuration.configuration - INFO - Parameter --cache=none detected ... 2026-07-28 14:48:04,619 - freqtrade.configuration.configuration - INFO - Filter trades by timerange: 20210101-20260101 2026-07-28 14:48:04,620 - freqtrade.exchange.check_exchange - INFO - Checking exchange... 2026-07-28 14:48:04,627 - freqtrade.exchange.check_exchange - INFO - Exchange "binance" is officially supported by the Freqtrade development team. 2026-07-28 14:48:04,627 - freqtrade.configuration.configuration - INFO - Using pairlist from configuration. 2026-07-28 14:48:04,627 - freqtrade.configuration.config_validation - INFO - Validating configuration ... 2026-07-28 14:48:04,629 - freqtrade.exchange.exchange - INFO - Instance is running with dry_run enabled 2026-07-28 14:48:04,630 - freqtrade.exchange.exchange - INFO - Using CCXT 4.5.61 2026-07-28 14:48:04,642 - freqtrade.exchange.exchange - INFO - Using Exchange "Binance" 2026-07-28 14:48:04,827 - freqtrade.resolvers.exchange_resolver - INFO - Using resolved exchange 'Binance'... 2026-07-28 14:48:04,828 - freqtrade.resolvers.iresolver - WARNING - Could not import /freqle/user_data/strategies/TrendStrategy.py due to 'attempted relative import with no known parent package' 2026-07-28 14:48:04,829 - freqtrade.resolvers.iresolver - WARNING - Could not import /freqle/user_data/strategies/TrendStrategy.py due to 'attempted relative import with no known parent package' 2026-07-28 14:48:04,830 - freqtrade.resolvers.iresolver - WARNING - Could not import /freqle/user_data/strategies/TrendStrategy.py due to 'attempted relative import with no known parent package' ft_backtest wrapper failed: Impossible to load Strategy 'TrendStrategy'. 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
no lookahead-bias patterns detected
ran by Ron · took s
Lookahead analysis
freqtrade lookahead-analysis: detects strategies peeking at future candles.