Request Founder AccessApplications are open for a limited group of Founder Members

Connecting darwintIQ to MetaTrader

MetaTrader Integration with darwintIQ API

Allow WebRequest

In both MT4 and MT5, you must allow the darwintIQ API URL:

  1. Open Tools → Options → Expert Advisors
  2. Enable “Allow WebRequest for listed URL:”
  3. Add: https://api.darwintiq.com
  4. Click OK, then reattach the EA.

EA Workflow (High-level)

  1. Poll /v1/models every N seconds with your desired symbol, sort, and entryType.
  2. Parse the top-ranked Trading Model (or the one with the most recent entry event).
  3. Map lastEntry.entryType (BUY/SELL), apply risk rules (SL/TP from your manager) and place orders.
  4. Optionally use entryMovePips and fitness as context for your own risk rules.
  5. For production, use a JSON parser library in MQL for robustness.
    Examples here use naive string parsing for simplicity.

Example Expert Advisors

We provide minimal Expert Advisor (EA) examples for MT4 and MT5. Download darwintiq-metatrader-ea-kit.zip (includes MT4/MT5 EAs, bundled JSON header for MT4, and a README)

Both EAs:

  • Expose inputs for SymbolParam, SortParam, SignalsParam, and PollSeconds.
  • Call WebRequest to fetch /v1/models.
  • Log the first Trading Model’s fitness, lastEntry.type, lastEntry.time, and entryMovePips.
  • Include placeholders where you can implement order placement (OrderSend in MT4 / trade functions in MT5).

Notes & Best Practices

  • Replace naive string parsing with a lightweight JSON parser for MQL.
  • Add risk management: lot sizing, stop-loss, take-profit, max spread/slippage, and trading windows.
  • Implement duplicate-entry suppression to avoid opening multiple identical positions.
  • Test in Strategy Tester before using live.

Example Request

GET https://api.darwintiq.com/v1/models?symbol=EURUSD&sort=fitness