trading-platform/orchestration/tareas/_archive/2026-01/TASK-2026-01-25-ML-DATA-MIGRATION/01-CONTEXTO.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

1.7 KiB

01-CONTEXTO - ML Data Migration & Model Training

Fecha: 2026-01-25

Fase: CONTEXTO (C)

Estado: COMPLETADA


1. Situacion Inicial

Problema Identificado

  • Los modelos ML en apps/ml-engine/ esperaban datos de MySQL (tabla tickers_agg_data)
  • La base de datos MySQL ya no existe - workspace-v1 fue eliminado
  • No habia datos de mercado cargados en PostgreSQL
  • El esquema market_data existia pero estaba vacio

Infraestructura Existente

  • PostgreSQL 16 en WSL con base trading_platform
  • Esquema market_data con tablas: tickers, ohlcv_5m, ohlcv_15m, ohlcv_1h
  • 6 tickers registrados: XAUUSD, EURUSD, BTCUSD, GBPUSD, USDJPY, AUDUSD
  • API key de Polygon.io disponible

2. Objetivo

  1. Cargar datos historicos desde Polygon API a PostgreSQL
  2. Migrar ML Engine de MySQL a PostgreSQL
  3. Entrenar modelos de atencion (Level 0) con los datos nuevos

3. Alcance

Incluido

  • Script de carga de datos desde Polygon
  • Modulo de acceso a PostgreSQL para ML Engine
  • Capa de compatibilidad MySQL→PostgreSQL
  • Entrenamiento de 12 modelos de atencion
  • Documentacion de inventarios

Excluido

  • Modelos Level 1+ (requieren mas datos historicos)
  • Trading en produccion
  • Frontend de ML

4. Restricciones

Restriccion Descripcion
Rate Limit Polygon 5 requests/min (plan gratuito)
Datos Historicos 1 ano de datos (insuficiente para Level 1+)
Ambiente Solo desarrollo local (WSL)

5. Referencias

  • docs/90-transversal/inventarios/DATABASE_INVENTORY.yml
  • docs/90-transversal/inventarios/ML_INVENTORY.yml
  • apps/ml-engine/models/ATTENTION_TRAINING_REPORT_20260125_060911.md