trading-platform/orchestration/tareas/_archive/2026-01/TASK-2026-01-27-PLATFORM-VALIDATION/05-EJECUCION.md
Adrian Flores Cortes df43dd90cb [F0-F2] feat: Coherence analysis baseline + entity types + frontend stores
FASE 0 - Preparación y Purga:
- Archived 21 completed tasks to _archive/2026-01/
- Marked 4 docs as DEPRECATED
- Created 3 baseline coherence reports

FASE 1 - DDL-Backend Coherence:
- audit.types.ts: +4 types (SystemEvent, TradingAudit, ApiRequestLog, DataAccessLog)
- investment.types.ts: +4 types (RiskQuestionnaire, WithdrawalRequest, DailyPerformance, DistributionHistory)
- entity.types.ts: +5 types (Symbol, TradingBot, TradingSignal, TradingMetrics, PaperBalance)

FASE 2 - Backend-Frontend Coherence:
- investmentStore.ts: New Zustand store with 20+ actions
- mlStore.ts: New Zustand store with signal caching
- alerts.service.ts: New service with 15 functions

FASE 3 - Documentation:
- OQI-009: Updated to 100% coverage, added ET-MKT-004-productos.md
- OQI-010: Created full structure (STATUS.md, ROADMAP-MT4.md, ET-MT4-001-gateway.md)

Coherence Baseline Established:
- DDL-Backend: 31% (target 95%)
- Backend-Frontend: 72% (target 85%)
- Global: 39.6% (target 90%)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 22:08:04 -06:00

3.3 KiB

05-EJECUCION - Platform Validation

Task: TASK-2026-01-27-PLATFORM-VALIDATION Fecha: 2026-01-27 Estado: COMPLETADA


1. Verificación TypeScript Backend

Comando Ejecutado

cd apps/backend && npm run build

Resultado

> @trading/backend@0.1.0 build
> tsc

Estado: 0 errores de compilación


2. Verificación TypeScript Frontend

Comando Ejecutado

cd apps/frontend && npm run build

Resultado

✓ built in 10.53s

Estado: 0 errores de compilación, build exitoso


3. Verificación Auth Endpoints y WebSocket URLs

Auth Service

  • Archivo: apps/frontend/src/lib/apiClient.ts
  • Features verificados:
    • Auto-refresh token interceptor
    • Request queue durante refresh
    • Proactive refresh (5min antes de expirar)
    • BroadcastChannel para multi-tab sync

WebSocket URLs

  • Archivo: apps/frontend/src/services/websocket.service.ts
Service URL Puerto
tradingWS ws://localhost:3080/ws 3080 (Backend)
mlSignalsWS ws://localhost:3083/ws/signals 3083 (ML Engine)
portfolioWS ws://localhost:3080/ws 3080 (Backend)

Estado: URLs correctamente configuradas


4. ML Pipeline Data Ingestion (OHLCV)

Script Mejorado

  • Archivo: apps/ml-engine/scripts/ingest_ohlcv_polygon.py
  • Mejoras implementadas:
    • batch_size: 5000 → 500 (para estabilidad)
    • sslmode: disable (evitar SSL timeouts WSL)
    • Lógica de reconexión automática con 3 reintentos
    • Progreso cada 20 batches

Datos Ingestados

Symbol Bars Primer Bar Último Bar
XAUUSD 140,310 2024-01-28 16:00 2026-01-26 17:55
EURUSD 147,296 2024-01-28 16:50 2026-01-26 17:55
GBPUSD 147,091 2024-01-28 16:50 2026-01-26 17:55
BTCUSD 210,227 2024-01-27 18:00 2026-01-26 17:55
USDJPY 147,191 2024-01-28 16:50 2026-01-26 17:55
GBPJPY 146,061 2024-01-28 16:50 2026-01-26 17:55
AUDUSD 146,295 2024-01-28 16:50 2026-01-26 17:55
TOTAL 1,084,471 - -

Comandos de Ingesta

# XAUUSD (previo)
wsl -d Ubuntu-24.04 -u developer -- bash -c "
  cd /mnt/c/.../apps/ml-engine &&
  POLYGON_API_KEY='...' python3 scripts/ingest_ohlcv_polygon.py \
    --symbols XAUUSD --start 2024-01-01 --end 2026-01-27"

# Resto de símbolos
wsl -d Ubuntu-24.04 -u developer -- bash -c "
  cd /mnt/c/.../apps/ml-engine &&
  POLYGON_API_KEY='...' python3 scripts/ingest_ohlcv_polygon.py \
    --symbols EURUSD GBPUSD BTCUSD USDJPY GBPJPY AUDUSD \
    --start 2024-01-01 --end 2026-01-27"

Rate Limiting

  • Polygon API (free tier): ~5 requests/minute
  • Tiempo total ingesta: ~35 minutos
  • Manejo automático de 429 (Rate Limited) con retry

Verificación Final BD

SELECT t.symbol, COUNT(o.id) as bar_count,
       MIN(o.timestamp) as first_bar,
       MAX(o.timestamp) as last_bar
FROM market_data.tickers t
LEFT JOIN market_data.ohlcv_5m o ON t.id = o.ticker_id
GROUP BY t.symbol ORDER BY t.symbol;

Resultado: 7 símbolos con datos completos (~2 años cada uno)


Estado Git

trading-platform: main (up to date with origin)
Working tree: clean

Nota: apps/ml-engine/ está en .gitignore, los cambios al script no se comitean al repo principal.