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:
0
BACKTESTING.md
Normal file
0
BACKTESTING.md
Normal file
70
README.md
70
README.md
@@ -136,6 +136,43 @@ GRANT ALL ON SCHEMA public TO trading_user;
|
|||||||
\q
|
\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)
|
### 6. Instalar Redis (opcional pero recomendado)
|
||||||
|
|
||||||
**Ubuntu/Debian:**
|
**Ubuntu/Debian:**
|
||||||
@@ -316,6 +353,37 @@ sudo -u postgres psql -c "SHOW data_directory;"
|
|||||||
# Típicamente: /var/lib/postgresql/16/main
|
# 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)
|
### Tabla OHLCV (estructura)
|
||||||
|
|
||||||
```sql
|
```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
|
**Última actualización:** Enero 2026
|
||||||
**Python:** 3.12.3
|
**Python:** 3.12.3
|
||||||
**PostgreSQL:** 16+
|
**PostgreSQL:** 16+
|
||||||
|
|||||||
0
backtest.py
Normal file
0
backtest.py
Normal file
0
src/backtest/__init__.py
Normal file
0
src/backtest/__init__.py
Normal file
0
src/backtest/engine.py
Normal file
0
src/backtest/engine.py
Normal file
0
src/backtest/metrics.py
Normal file
0
src/backtest/metrics.py
Normal file
0
src/backtest/strategy.py
Normal file
0
src/backtest/strategy.py
Normal file
0
src/backtest/trade.py
Normal file
0
src/backtest/trade.py
Normal file
0
src/strategies/__init__.py
Normal file
0
src/strategies/__init__.py
Normal file
0
src/strategies/base.py
Normal file
0
src/strategies/base.py
Normal file
0
src/strategies/ml_model.py
Normal file
0
src/strategies/ml_model.py
Normal file
0
src/strategies/moving_average.py
Normal file
0
src/strategies/moving_average.py
Normal file
0
src/strategies/signals.py
Normal file
0
src/strategies/signals.py
Normal file
Reference in New Issue
Block a user