Specification
Scope
Implement a local automation bridge consisting of:
-
MQL4 Helper EA(s):
-
Take scheduled screenshots from 3 MT4 chart windows (roles: standard , active_open , third_panel ) at 01:30 and 13:30 local machine time.
-
Send the screenshots via WebRequest() to a local Mediator app.
-
-
Mediator App (Python FastAPI or NodeJS):
-
Collect all three screenshots for the same time slot, call ChatGPT (Flow) via API using a strict JSON schema, validate the response, and write the output to Shared/settings.json .
-
The JSON file contains toggle flags (AUTO ON/OFF and M1/M5/M15) for Silver (XAGUSD) and Gold (XAUUSD).
-
If a role is missing or JSON is invalid, the mediator safely ignores the update (no overwrite).
-
-
Benson EA Integration:
-
The existing Benson EA (runs on another MT4 chart) will read the settings.json (or Global Variables mirrored from it) and apply the flags automatically — without needing to open the EA input dialog.
-
-
Compatibility:
-
Must support both single-terminal (multiple chart windows) and multi-terminal setups (shared folder communication).
-
Environment
-
Windows VPS / PC running MetaTrader 4
-
Local loopback connection: http://127.0.0.1:5000
-
Shared folder path: C:\BensonBridge\Shared\
-
ChatGPT API key will be provided by client.
Key Requirements
-
Roles for helper EAs: standard , active_open , third_panel .
-
Collector logic waits for all three roles before a single ChatGPT call.
-
Strict JSON schema validation before any update.
-
Atomic writes to settings.json (no partial files).
-
Logging and error handling (Flow failure, missing role, invalid schema).
-
Clean, documented code (Python + MQL4) with clear variable names.
-
Simple, silent operation (headless).
-
One-click setup (Windows Task Scheduler or service mode).
Deliverables
-
Benson_Helper_EA.mq4 (source + compiled .ex4 )
-
Mediator source (Python FastAPI) + requirements.txt + .env.example
-
flow_schema.json (JSON schema)
-
Logs and sample output ( decisions_latest.json )
-
Step-by-step README / setup guide
-
Short demo screencast (2–5 min) showing:
-
Automatic screenshot, mediator collection, Flow call, settings.json written, and Benson reacting.
-
Timeline & Milestone Table
Phase | Description | Deliverables | Duration | Payment |
---|---|---|---|---|
1. Design & Stubs | Confirm architecture, create folder structure, dummy endpoints, stub EAs, test screenshot & WebRequest. | Folder skeleton + working stub EA + mock API. | Day 1–2 | 20% |
2. Screens & Collector Logic | Implement scheduled screenshots (01:30 / 13:30), mediator collector for roles, test local JSON logging. | Working collector (no API yet). | Day 2–3 | 30% |
3. Flow Integration & Validation | Connect to ChatGPT (Flow) API, enforce strict JSON schema, write settings.json , add logs & error handling. | End-to-end pipeline working. | Day 4–5 | 30% |
4. Final Testing & Handoff | Integration with Benson EA (flags read), cleanup, docs, and screencast demo. | Final code + guide + video. | Day 6–7 | 20% |
🕒 Estimated Total Duration: 4–6 working days (one week total).
You may set deadline = 7 days in the MetaQuotes post for buffer.
Acceptance Tests
-
At 01:30 and 13:30, three screenshots are saved and mediator receives all roles → one ChatGPT call → valid settings.json written.
-
Missing role → no Flow call; last settings persist (safe default).
-
Invalid JSON from Flow → no change applied, error logged.
-
In single-terminal mode: Benson reads Global Variables or settings.json and flips AUTO / TFs correctly.
-
In multi-terminal mode: all terminals share the same settings.json , and Benson reacts correctly.
-
Logs record every action (timestamp, slot, success/failure).
Budget
Fixed price — fair market rate.
$200