feat: add MetaTrader 5 bridge for real-time Kronos inference#292
Open
janpauldelacruz wants to merge 8 commits into
Open
feat: add MetaTrader 5 bridge for real-time Kronos inference#292janpauldelacruz wants to merge 8 commits into
janpauldelacruz wants to merge 8 commits into
Conversation
…ment length - pooyer_bridge.py: double-checked locking for _load_model() via _model_lock - pooyer_bridge.py: inner double-check in multi_predict before inference - pooyer_bridge.py: clear_cache() now protected by _lock - pooyer_bridge.py: freq param in payload propagated to _run_inference timestamps - requirements_bridge.txt: add torch>=2.0.0 (required for Kronos model) - POOYER.mq5: ManageOpenPositions — guard cur_sl==0 before breakeven compare - POOYER.mq5: FLAT signals handled explicitly (no longer logged as fetch failure) - POOYER.mq5: order comment truncated to 31 chars (MT5 limit) - POOYER.mq5: PingHealth timeout 3000ms → 1500ms to unblock bar processing - README.md: remove reference to pooyer_dashboard.html (file not in commit) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Percentile path SL/TP, flip-resistant dynamic exit, ensemble variance confidence, NO_TRADE state, forecast expiry, 2.5×ATR SL hard cap. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Full task-by-task build plan: bridge (ensemble variance, percentile path SL/TP, /recheck), EA (flip-resistant exit, forecast expiry), README, launcher scripts. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds the first production-grade MetaTrader 5 ↔ Kronos bridge, enabling live traders to use Kronos OHLCV forecasts directly inside MT5 Expert Advisors — the world's most widely used retail trading platform (millions of users).
What's included
examples/mt5_bridge/pooyer_bridge.py— Flask server that loads Kronos and serves predictions via HTTP on port 7799examples/mt5_bridge/POOYER.mq5— MT5 Expert Advisor that sends OHLCV bars via WebRequest and executes signalsexamples/mt5_bridge/README.md— Full documentation, API reference, and quick start guideexamples/mt5_bridge/requirements_bridge.txt— Python dependenciesWhy this matters
Kronos has no existing integration with live trading platforms. This bridge closes that gap — any MT5 user worldwide can now point their EA at a local Kronos instance and trade with foundation model forecasts.
Features
Tested on
XAUUSD, EURUSD, GBPUSD with Kronos-mini (CPU, ~800-2000ms inference)