Predict-A-Trade Platform & API Docs
Integration guides for the non-custodial MT4/MT5 Bridge Expert Advisors, external REST & SSE streaming endpoints, HMAC-SHA256 webhook verification, and deterministic 45-Gate risk controls.
1. MetaTrader 4 & 5 Bridge EA Setup
Predict-A-Trade executes strictly non-custodially inside your own MT4 or MT5 client terminal using thin outbound HMAC-authenticated HTTPS polling. No broker passwords or investor credentials are ever transmitted.
Install the Expert Advisor
Download PredictATrade.mq5 (or .mq4) from your Dashboard under Terminals & Bridge → Download Bridge EAs, copy it into MQL5/Experts (or MQL4/Experts), and compile with F7 in MetaEditor.
Whitelist WebRequest URLs
In MetaTrader open Tools → Options → Expert Advisors, enable Allow WebRequest for listed URL, and add https://platform.predictatrade.com and https://predictatrade.com.
Attach & Enter Licence Key
Attach the EA to any single chart with Algo Trading enabled and paste your InpLicenceKey from Terminals & Bridge → Licence & Setup. One attachment manages all routed instruments.
Verify Dedicated Isolation
Ensure no third-party EAs run on the same account. Local Gate L01–L06 automatically pauses signal delivery if conflicting external magic numbers are detected.
2. External REST & SSE API Reference
Base URLs: https://api.predictatrade.com (dedicated API endpoint) or https://platform.predictatrade.com. Pass your session token via Authorization: Bearer <token>.
| Method | Endpoint | Auth | Description |
|---|---|---|---|
| POST | /api/v1/auth/login | Public | Authenticate with email and password; issues an HttpOnly session token. |
| GET | /api/v1/signals | Bearer / Session | Retrieve active OOS-qualified signals cleared by all 45 deterministic risk gates. |
| GET | /api/v1/signals/stream | Bearer / Session | Server-Sent Events (SSE) real-time push stream for live signal dispatches. |
| GET | /api/v1/positions | Bearer / Session | Fetch reconciled live open positions across enrolled MT4/MT5 terminals. |
| GET | /api/v1/market/assets | Public | List all 826 registered instruments across FX, Commodities, Crypto, Indices, and Equities. |
| GET | /api/v1/terminals/compatibility | Bearer / Session | Inspect broker symbol mapping, spread-to-edge cost gates (AGT-17), and routing rules. |
3. Outbound Webhooks & HMAC-SHA256 Verification
Quant Desk and B2B accounts can register HTTPS webhook endpoints under Alerts & Channels. Every webhook delivery is signed using HMAC-SHA256 in the X-PAT-Signature header.
import hmac, hashlib
def verify_pat_signature(raw_body: bytes, header_sig: str, webhook_secret: str) -> bool:
expected = hmac.new(
webhook_secret.encode("utf-8"),
raw_body,
hashlib.sha256
).hexdigest()
return hmac.compare_digest(expected, header_sig)4. 45-Gate Fail-Closed Risk Pipeline
Every trade candidate must pass all 45 deterministic gates sequentially. There are no warn-only or shadow overrides — if any single gate fails, the signal is rejected before reaching execution.
Platform & Market Gates
Feed freshness, regime coherence, spread-to-ATR limits, high-impact macro news embargoes, and Wednesday triple-swap carry shielding.
Account & Portfolio Gates
Per-trade risk cap, daily drawdown ceiling, concurrent position limits, currency correlation exposure, and subscriber asset routing policy.
Local Terminal EA Gates
Broker free-margin verification, tick slippage tolerance, symbol trade-mode check, stop-distance validation, and dedicated account isolation.
Start with the live monitor.
Create your free account to access live quotes, M15 institutional charts, and execution telemetry.
Decision-support software. Your money stays at your own broker.