Commit Graph

6 Commits

Author SHA1 Message Date
716b54fc67 Fix: detect dead WebSocket connection and trigger reconnection 2026-08-05 20:26:43 +02:00
0c9dbf43ac Add 5-minute health status log to LiveCandleFetcher with last candle info 2026-08-05 12:09:50 +02:00
967c86e8e9 Fix KeyError for prefixed coins in historical candle fetch
Bypass SDK's name_to_coin lookup in candles_snapshot by calling
http_info.post directly with the raw coin name. This fixes
KeyError for symbols like xyz:GOLD, xyz:CL, mkts:USTECH that
aren't in the name_to_coin dictionary.

The WebSocket subscription already bypassed this lookup (line 154),
but the historical fetch path did not.
2026-08-05 09:20:07 +02:00
7d702e9cbd Migrate data pipeline from SQLite to PostgreSQL + Docker setup
- Add db.py PostgreSQL abstraction layer (connection, upsert, table mgmt)
- Replace sqlite3 with psycopg2 in: live_candle_fetcher, resampler,
  data_fetcher, fetch_history, import_csv, indicators, base_strategy
- Sanitize table names (colons -> underscores) for PostgreSQL compat
- Replace INSERT OR REPLACE with ON CONFLICT upserts
- Replace pandas to_sql() with batch upsert_candles()
- Add scripts: resampler_loop, gap_detector, backup_runner, cron_scheduler
- Add migrate_sqlite_to_pg.py for one-time data migration
- Add Dockerfile, docker-compose.yml, supervisord.conf
- Add postgres/postgresql.conf tuned for 4GB RAM (Synology DS1513+)
- Add .dockerignore, .env.docker.example, secrets template
- Update requirements.txt (psycopg2-binary), .gitignore
- Add MIGRATION_PLAN.md with full plan and todo list
2026-07-30 22:14:31 +02:00
68e528c1f6 Restructured hedger modules: moved CLP hedger and auto hedger into separate folders, updated data fetchers and main app, removed deprecated files 2026-07-28 08:26:14 +02:00
2eef7dbc17 live market web socket 2025-10-21 15:09:14 +02:00