feat: estructura base para Semanas 3-4 (Backtesting)

- Creada estructura de carpetas src/backtest/ y src/strategies/
- Añadidos archivos vacíos para backtesting engine
- Actualizado README.md con gestión de PostgreSQL:
  * Comandos start/stop/restart/status
  * Habilitar/deshabilitar inicio automático
  * Sección completa de gestión del servicio
- Preparado para implementar motor de backtesting
This commit is contained in:
DaM
2026-01-27 13:45:24 +01:00
parent cc6913168f
commit 0522ea17ca
13 changed files with 69 additions and 1 deletions

0
BACKTESTING.md Normal file
View File

View File

@@ -136,6 +136,43 @@ GRANT ALL ON SCHEMA public TO trading_user;
\q
```
### 6. Gestión del servicio PostgreSQL
**Iniciar PostgreSQL:**
```bash
sudo systemctl start postgresql
```
**Verificar estado:**
```bash
sudo systemctl status postgresql
```
**Detener PostgreSQL:**
```bash
sudo systemctl stop postgresql
```
**Reiniciar PostgreSQL:**
```bash
sudo systemctl restart postgresql
```
**Habilitar inicio automático al arrancar el sistema:**
```bash
sudo systemctl enable postgresql
```
**Deshabilitar inicio automático:**
```bash
sudo systemctl disable postgresql
```
**Ver si está habilitado el inicio automático:**
```bash
systemctl is-enabled postgresql
```
### 6. Instalar Redis (opcional pero recomendado)
**Ubuntu/Debian:**
@@ -316,6 +353,37 @@ sudo -u postgres psql -c "SHOW data_directory;"
# Típicamente: /var/lib/postgresql/16/main
```
### Gestión del servicio PostgreSQL
**Comandos básicos:**
```bash
# Iniciar PostgreSQL
sudo systemctl start postgresql
# Detener PostgreSQL
sudo systemctl stop postgresql
# Reiniciar PostgreSQL
sudo systemctl restart postgresql
# Ver estado
sudo systemctl status postgresql
# Habilitar inicio automático al arrancar el sistema
sudo systemctl enable postgresql
# Deshabilitar inicio automático
sudo systemctl disable postgresql
# Verificar si está habilitado
systemctl is-enabled postgresql
```
**Nota:** Por defecto, después de la instalación PostgreSQL está configurado para iniciar automáticamente. Si prefieres iniciarlo manualmente cada vez:
```bash
sudo systemctl disable postgresql
```
### Tabla OHLCV (estructura)
```sql
@@ -578,7 +646,7 @@ Para dudas sobre el código o siguientes fases de desarrollo, consulta conmigo.
---
**Versión actual:** 0.2.0 (Semanas 1-2 completadas)
**Versión actual:** 0.2.0 (Semanas 1-2 completadas, Semanas 3-4 en preparación)
**Última actualización:** Enero 2026
**Python:** 3.12.3
**PostgreSQL:** 16+

0
backtest.py Normal file
View File

0
src/backtest/__init__.py Normal file
View File

0
src/backtest/engine.py Normal file
View File

0
src/backtest/metrics.py Normal file
View File

0
src/backtest/strategy.py Normal file
View File

0
src/backtest/trade.py Normal file
View File

View File

0
src/strategies/base.py Normal file
View File

View File

View File

View File