Seven system layers
Course context: This lesson belongs to a practical beginner curriculum for Pakistan.
| Layer | Responsibility | Failure example |
|---|---|---|
| Data | Receive timestamps, Bid/Ask and instrument state | Missing or stale quote |
| Features | Transform only past information | Future-data leakage |
| Model | Produce a score or forecast | Uncalibrated confidence |
| Decision | Map score to an allowed action | Threshold changed without test |
| Risk | Cap volume, loss and exposure | Model requests oversized order |
| Execution | Submit, modify and reconcile orders | Duplicate or rejected order |
| Monitoring | Detect drift, latency and errors | System trades after feed failure |
Where Exness API fits
The Exness API can expose account details, real-time and historical market data, instrument data, HMR status and order operations. It is available only for eligible Exness platform trading accounts after account verification; standard MetaTrader accounts do not connect to it. The current API does not support stocks or indices through standard endpoints.
EA route versus API route
| Route | Best fit | Main engineering obligation |
|---|---|---|
| MT4 EA | Existing MQL4 strategy | Run MT4 Desktop and manage terminal state |
| MT5 EA | MQL5 and MT5 testing workflow | Run MT5 Desktop and handle MQL5 events |
| Exness API | Custom service in another language | Authentication, state, retries and order reconciliation |
A reliable order state machine
- Receive a fresh quote and instrument status.
- Calculate signal and risk-limited volume.
- Assign a unique client decision ID.
- Send the order once.
- Read the broker response and store the ticket.
- Reconcile open positions before retrying.
- Alert and stop on an unknown state.
Minimum monitoring dashboard
- Last market-data timestamp and gap count.
- Model version and feature version.
- Signals accepted, rejected and skipped.
- Requested versus executed price.
- Current and daily cash exposure.
- Rejected orders, retry count and duplicate protection.
- Kill-switch status.
Official documentation
Exness API · Using Expert Advisors
Questions from a first-time learner
Is an AI model the whole trading system?
No. Data, risk, execution and monitoring are separate required layers.
Can a MetaTrader account use the Exness API?
The official API currently requires an Exness platform trading account, not a standard MetaTrader account.
Why use a unique decision ID?
It helps detect retries and prevents the same signal from creating duplicate orders.
What should happen in an unknown order state?
Stop new orders, reconcile with the broker and require a controlled recovery.
