Sistema NEXUS v3.4 migrado con: Estructura principal: - core/orchestration: Sistema SIMCO + CAPVED (27 directivas, 28 perfiles) - core/catalog: Catalogo de funcionalidades reutilizables - shared/knowledge-base: Base de conocimiento compartida - devtools/scripts: Herramientas de desarrollo - control-plane/registries: Control de servicios y CI/CD - orchestration/: Configuracion de orquestacion de agentes Proyectos incluidos (11): - gamilit (submodule -> GitHub) - trading-platform (OrbiquanTIA) - erp-suite con 5 verticales: - erp-core, construccion, vidrio-templado - mecanicas-diesel, retail, clinicas - betting-analytics - inmobiliaria-analytics - platform_marketing_content - pos-micro, erp-basico Configuracion: - .gitignore completo para Node.js/Python/Docker - gamilit como submodule (git@github.com:rckrdmrd/gamilit-workspace.git) - Sistema de puertos estandarizado (3005-3199) Generated with NEXUS v3.4 Migration System EPIC-010: Configuracion Git y Repositorios |
||
|---|---|---|
| .. | ||
| examples | ||
| migrations | ||
| src | ||
| tests | ||
| .env.example | ||
| ARCHITECTURE.md | ||
| docker-compose.yml | ||
| Dockerfile | ||
| environment.yml | ||
| IMPLEMENTATION_SUMMARY.md | ||
| README_SYNC.md | ||
| README.md | ||
| requirements_sync.txt | ||
| requirements.txt | ||
| TECH_LEADER_REPORT.md | ||
Data Service
Market data service for the OrbiQuant IA Trading Platform.
Features
- REST API: FastAPI-based endpoints for market data
- WebSocket Streaming: Real-time price updates
- Multi-Provider Support: Polygon.io, Binance, MT4/MT5
- Historical Data: OHLCV candles with multiple timeframes
- Spread Tracking: Broker spread monitoring and statistics
- Price Adjustment: ML-based price adjustment models
Quick Start
# Install dependencies
pip install -r requirements.txt
# Set environment variables
cp .env.example .env
# Run development server
python -m uvicorn src.app:app --reload --port 8001
# Or with Docker
docker-compose up -d
API Endpoints
Health
GET /health- Service health statusGET /ready- Kubernetes readiness probeGET /live- Kubernetes liveness probe
Symbols
GET /api/v1/symbols- List trading symbolsGET /api/v1/symbols/{symbol}- Get symbol info
Market Data
GET /api/v1/ticker/{symbol}- Current priceGET /api/v1/tickers- Multiple tickersGET /api/v1/candles/{symbol}- Historical OHLCVGET /api/v1/orderbook/{symbol}- Order book snapshotGET /api/v1/trades/{symbol}- Recent trades
Admin
POST /api/v1/admin/backfill/{symbol}- Trigger data backfillPOST /api/v1/admin/sync- Trigger sync
WebSocket
Connect to /ws/stream for real-time data.
const ws = new WebSocket('ws://localhost:8001/ws/stream');
ws.onopen = () => {
// Subscribe to ticker updates
ws.send(JSON.stringify({
action: 'subscribe',
channel: 'ticker',
symbols: ['EURUSD', 'BTCUSD']
}));
};
ws.onmessage = (event) => {
const data = JSON.parse(event.data);
console.log(data);
};
Channels
ticker- Real-time price updatescandles- OHLCV candle updates (specify timeframe)orderbook- Order book snapshotstrades- Recent tradessignals- ML trading signals
Architecture
src/
├── app.py # FastAPI application
├── main.py # Scheduler-based service
├── config.py # Configuration
├── api/
│ ├── routes.py # REST endpoints
│ └── dependencies.py # FastAPI dependencies
├── websocket/
│ ├── manager.py # Connection management
│ └── handlers.py # WebSocket routes
├── models/
│ └── market.py # Pydantic models
├── providers/
│ ├── polygon_client.py # Polygon.io client
│ ├── binance_client.py # Binance client
│ └── mt4_client.py # MT4/MetaAPI client
└── services/
└── price_adjustment.py # Price adjustment service
Environment Variables
# Database
DB_HOST=localhost
DB_PORT=5432
DB_NAME=orbiquant_trading
DB_USER=orbiquant_user
DB_PASSWORD=orbiquant_dev_2025
# Polygon.io
POLYGON_API_KEY=your_api_key
POLYGON_TIER=basic
# Binance
BINANCE_API_KEY=your_api_key
BINANCE_API_SECRET=your_secret
BINANCE_TESTNET=false
# MetaAPI (MT4/MT5)
METAAPI_TOKEN=your_token
METAAPI_ACCOUNT_ID=your_account_id
# Service
SYNC_INTERVAL_MINUTES=5
BACKFILL_DAYS=30
LOG_LEVEL=INFO
Development
# Run tests
pytest
# Code formatting
black src/
isort src/
# Type checking
mypy src/
API Documentation
When running, visit:
- Swagger UI: http://localhost:8001/docs
- ReDoc: http://localhost:8001/redoc