The old COPY shared_data/ lines implicitly created /app/data/. After
merging into shared/data, the matcher crashed on startup because
/app/data/ no longer existed for matcher.db.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add real ATHEX/NYSE/Euronext prices, OHLCV data for RL agent, merge shared_data into shared/data
Previous push was fully cached by HF Spaces. Pinning explicit versions
(numpy, pandas, scikit-learn, stable-baselines3, huggingface_hub) changes
the RUN command text, which invalidates the Docker layer cache.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Force Docker rebuild on HF Spaces, add version stamp to startup log
ARG PIP_CACHE_BUST invalidates pip layer cache. Entrypoint now prints
StockEx version at startup so deploys can be verified from container logs.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Integrate Adilbai/stock-trading-rl-agent PPO model as alternative CH
trading strategy (new ch_rl_trader.py)
- CH_AI_STRATEGY: llm/rl/hybrid (default hybrid, dynamically switchable
via POST /ch/api/strategy)
- MDF now uses regime-driven price dynamics (trending/mean-reverting/
volatile/calm) producing meaningful SMA, EMA, MACD, RSI, Bollinger
Band signals embedded in snapshots
- Rename source CLEARINGHOUSE → CLRH in order messages
- Add stable-baselines3, pandas, scikit-learn, huggingface_hub to Docker
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add clearing house simulation with 10 members (USR01-USR10)
- New clearing_house/ Flask service (port 5004) with dedicated dark-themed portal
- SQLite persistence: member capital, holdings, daily trade counters, settlements
- Members start with €100,000; must trade ≥10 securities per trading day
- Password = member ID (e.g. USR01 logs in with password USR01)
- Real users log in to trade manually; AI (LLM via Groq→HF→Ollama) simulates unoccupied members
- Trade attribution via Kafka trades consumer — detects USRxx- cl_ord_id prefix
- EOD settlement triggered by dashboard session end; calculates unrealized P&L
- Leaderboard at /ch/ with real-time auto-refresh and Human/AI badges
- Member portfolio view: holdings, order entry, trade history, settlement history
- Integrated into nginx (/ch/), entrypoint.sh, docker-compose, and HF Dockerfile
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add AI Analyst service: Ollama (local) + HuggingFace (HF Spaces)
New ai_analyst/ai_analyst.py service consumes trades/snapshots from
Kafka, builds a market-context prompt every 30 min, calls Ollama
(llama3.1:8b) locally or HuggingFace Inference API (Mistral-7B) as
fallback, and publishes insights to the ai_insights Kafka topic.
Dashboard consumes ai_insights and broadcasts via SSE. New full-width
AI Analyst panel displays timestamped insights with animated cards.
- ai_analyst/ai_analyst.py: new service (Ollama-first, HF fallback)
- ai_analyst/Dockerfile: minimal Python image for local compose
- shared/config.py: add AI_INSIGHTS_TOPIC
- dashboard/dashboard.py: consume ai_insights, SSE broadcast
- dashboard/templates/index.html: AI Analyst panel + JS handlers
- Dockerfile: copy ai_analyst.py into HF single-container image
- entrypoint.sh: create ai_insights topic, start ai_analyst.py
- docker-compose.yml: ai_analyst service with OLLAMA_HOST + HF_TOKEN
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Fix scheduler: wrong path + no timezone = never fires
Bug 1 — Wrong schedule file path:
SCHEDULE_FILE defaulted to /app/shared_data/market_schedule.txt but
the volume/Dockerfile uses /app/data/. File was never found so
load_market_schedule() silently returned {}, scheduler never triggered.
Fixed default path + added ENV in Dockerfile as belt-and-suspenders.
Bug 2 — Server in UTC, market in Athens (GMT+2):
datetime.now() returned UTC time; at 11:46 Athens = 09:46 UTC the
scheduler saw 09:46 < 10:00 and did nothing.
Added Timezone field to market_schedule.txt and _local_now(tz) helper
that uses zoneinfo (Python 3.9+) with pytz fallback.
market_schedule.txt now:
Timezone Europe/Athens
Start 10:00
End 17:00
Scheduler logs local time on every tick for observability.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add Frontend button to dashboard; wire frontend into single-container
Dashboard:
- FRONTEND_URL env var injected into template; button only shown when set
- docker-compose: FRONTEND_URL=http://localhost:5000 added to dashboard service
- Button opens frontend in new tab (indigo pill style, matching FIX UI)
Single-container (HuggingFace):
- nginx: /frontend/ route added → localhost:5003
- entrypoint.sh: starts frontend on port 5003 with correct template folder
- Dockerfile: copies frontend.py + templates to /app/frontend_templates/
- frontend.py: TEMPLATE_FOLDER env var support added
- Dockerfile: also copies market_schedule.txt to /app/data/
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add FIX UI Client to HuggingFace Space via nginx reverse proxy