docs: update backtesting research, optimizer, ADX and visual analysis

This commit is contained in:
DaM
2026-01-28 16:24:34 +01:00
parent 1add69eb56
commit e15074c0a7
10 changed files with 396 additions and 408 deletions

View File

@@ -1,5 +1,4 @@
# src/data/fetcher.py
# src/data/fetcher.py
"""
Módulo para obtener datos de exchanges usando CCXT
"""
@@ -110,7 +109,9 @@ class DataFetcher:
self,
symbol: str,
timeframe: str = '1h',
days: int = 30,
since: Optional[datetime] = None,
until: Optional[datetime] = None,
days: Optional[int] = None,
max_retries: int = 3
) -> pd.DataFrame:
"""
@@ -126,7 +127,13 @@ class DataFetcher:
DataFrame con todos los datos históricos
"""
all_data = []
since = datetime.now() - timedelta(days=days)
if since is None:
if days is None:
raise ValueError("Debes proporcionar 'since' o 'days'")
since = datetime.utcnow() - timedelta(days=days)
if until is None:
until = datetime.utcnow()
log.info(f"Iniciando descarga histórica: {symbol} desde {since.date()}")
@@ -151,7 +158,8 @@ class DataFetcher:
# Actualizar 'since' al último timestamp + 1
last_timestamp = df.index[-1]
since = last_timestamp + pd.Timedelta(seconds=1)
timeframe_seconds = self.exchange.parse_timeframe(timeframe)
since = last_timestamp + pd.Timedelta(seconds=timeframe_seconds)
# Verificar si ya llegamos al presente
if since >= datetime.now():