MetaTrader
Connect MT4 or MT5 to Finatic with the push-agent connector EA and verify heartbeats.
Connect MT4 or MT5 to Finatic by installing the Finatic Expert Advisor (EA), generating connector credentials, and letting the EA send signed heartbeats from your terminal.
1. Download the terminal and EA
Current release: v0.1.4
View on GitHubChoose your platform in the selector above. Download the terminal if you do not already have MetaTrader installed, then download the matching Finatic EA.
2. Install the EA
Open MetaTrader and choose File → Open Data Folder.
For MT4, copy FinaticMT4ConnectorEA.mq4 into MQL4/Experts, open it in MetaEditor, then compile it so MetaTrader creates the .ex4 file.
For MT5, copy FinaticMT5ConnectorEA.ex5 into MQL5/Experts.
Restart MetaTrader or refresh Navigator → Expert Advisors so the EA appears.
3. Create connector credentials
- Open Finatic Connect.
- Select MetaTrader 4 or MetaTrader 5.
- Complete the connect flow.
- Copy the connector credentials shown by Finatic Connect. The connector secret is shown once.
4. Configure MetaTrader
Attach the Finatic EA to a chart and paste the generated values into the EA Inputs:
FinaticIngestUrlFinaticConnectorIdFinaticConnectorSecretFinaticSecretVersionFinaticSignEnvelopes
Keep FinaticSignEnvelopes enabled unless Finatic support asks you to turn it off.
5. Allow WebRequest
In MetaTrader, open Tools → Options → Expert Advisors, enable Allow WebRequest for listed URL, and add the ingest origin shown in Finatic Connect. The EA cannot send heartbeats until this URL is allowlisted.
6. Verify the connection
Enable AutoTrading in MT4 or Algo Trading in MT5. After the first snapshot and heartbeat, Finatic Connect should show the connector as online.
Troubleshooting
MT4 WebRequest err 5200 (but curl and MT5 work)
MetaTrader 4 WebRequest() only supports default ports: 80 for http:// and 443 for https://. A dev ingest URL like http://127.0.0.1:8001/... returns 5200 from MT4 even when PowerShell curl returns 200 and the URL is allowlisted. MT5 does not have this limitation.
Fixes for local development:
- Reconnect in Finatic Connect using a staging/production ingest origin (e.g.
https://api-staging.finatic.dev) with no custom port, or - Run FinaticBackground behind a local port 80 reverse proxy and set
FINATIC_PUSH_INGEST_PUBLIC_ORIGIN=http://127.0.0.1before connecting. In the Finatic devcontainer,make mt-ingest-proxy(ormake serviceswithbackground) starts socat 80 → 8001 automatically.
Connector does not appear online
- Confirm the terminal is running and the EA is attached to an active chart.
- Enable AutoTrading (MT4) or Algo Trading (MT5).
- Confirm the WebRequest allowlist contains the ingest origin from Finatic Connect.
- Reopen Finatic Connect and confirm credentials match the latest secret (especially after rotate).
- If the connector was revoked, run Connect again from the broker page; you cannot rotate a revoked connector from the manage screen.
Credential errors
- Confirm the connector secret matches the latest value from the portal.
- If the secret was rotated, update EA inputs immediately (heartbeats can return rotation-required until versions align).
- Verify the machine clock is accurate (NTP / Windows time service).
Missing events or stale state
- Send a fresh snapshot from the EA.
- Confirm heartbeat frequency is within the supported range.
Next steps
- Webhooks — Notify your backend when broker data changes.
- Interactive Playground — Try the Finatic SDK in the browser.
- API Reference — Explore broker and trading APIs.
