setup.cash

MetaTrader Connector Guide

Production-grade setup, operation, and troubleshooting for MT4/MT5 -> setup.cash.

Quick start

Go live in under 10 minutes

  1. Create a setup.cash account and sign in.
  2. Open Connect MT page and generate Pairing Code + Connector Secret.
  3. Install SetupCashConnector.mq4 in MetaTrader 4 or SetupCashConnector.mq5 in MetaTrader 5 and compile.
  4. Enable Algo Trading + WebRequest URL (https://www.setup.cash).
  5. Attach EA to any chart and paste BaseUrl, PairingCode, ConnectorSecret.
  6. Confirm CONNECTED status in setup.cash and verify heartbeat/account values.

1) Generate secure pairing

  • Go to `/connect/metatrader` and click `Generate Pairing`.
  • Copy both values: `Pairing Code` and `Connector Secret`.
  • Treat Connector Secret like an API key. Do not share it.
  • If expired, generate a new pairing and replace values in EA inputs.

2) Install MetaTrader Expert Advisor

  1. Open MT4 or MT5, then go to `File`, then `Open Data Folder`.
  2. MT4: go to `MQL4/Experts` and place `SetupCashConnector.mq4` there.
  3. MT5: go to `MQL5/Experts` and place `SetupCashConnector.mq5` there.
  4. Open MetaEditor and compile the EA (no compile errors).
  5. Back in MT5, refresh Navigator and confirm EA appears under Experts.

3) MetaTrader permissions (required)

  1. Enable global `Algo Trading` button.
  2. Open `Tools`, then `Options`, then `Expert Advisors`.
  3. Enable `Allow WebRequest for listed URL`.
  4. Add `https://www.setup.cash` exactly.

4) Attach EA and configure inputs

  • Attach EA to any chart and keep chart open.
  • `BaseUrl`: `https://www.setup.cash`
  • `PairingCode`: from setup.cash
  • `ConnectorSecret`: from setup.cash
  • `HeartbeatSeconds`: 10 (recommended)
  • `PollSeconds`: 2 (recommended)

5) Verify connection and first command

  1. Return to `/connect/metatrader` and wait for `CONNECTED`.
  2. Confirm account snapshot updates (balance, equity, free margin).
  3. Confirm open positions and open orders appear in snapshot panels.
  4. Queue a very small test market order.
  5. Watch command status move from `PENDING` to `SENT` to `DONE`.
  6. Use `Close by Ticket` for a full lifecycle test.

Troubleshooting

Status stays DISCONNECTED

  • Make sure PairingCode and ConnectorSecret are copied exactly.
  • Pairing expires in 10 minutes. Generate a new one and retry.
  • Confirm EA is attached to an active chart and Algo Trading is enabled.

WebRequest failed / HTTP errors in MT5 logs

  • MetaTrader -> Tools -> Options -> Expert Advisors -> Allow WebRequest.
  • Add exact URL: https://www.setup.cash
  • Check firewall/VPS outbound HTTPS access.

Order command queued but not executed

  • Keep MT5 terminal open (EA polls commands continuously).
  • Check symbol name format (for some brokers: EURUSD, EURUSD.a, etc).
  • Verify lot size/min volume and margin requirements in your broker.

Close by ticket fails

  • Use the live ticket number from Open Positions.
  • Ticket must belong to the same connected account.
  • If position is already closed, command will return FAILED.

Security best practices

  • Never share PairingCode + ConnectorSecret together.
  • Regenerate pairing immediately if credentials leak.
  • Use a dedicated MT5 terminal/VPS for automation.
  • Keep OS and MT5 updated.
  • Use broker-side protections (max lot, exposure limits).

Pro operations checklist

  • Run on low-latency VPS near broker servers.
  • Enable terminal auto-restart on VPS reboot.
  • Monitor heartbeat freshness every minute.
  • Review command failures and broker retcodes daily.
  • Keep one connector per account for clean control.

Need hands-on support?

Include screenshots from MT5 Experts log, the Connect MT page status, and your username. We can diagnose quickly.

support@setup.cash