# Quickstart: your first MT5 API trade

This guide takes you from zero to a live MetaTrader 5 order in about five minutes. You need an MT5 account at any broker or prop firm (a demo account is fine) and nothing else: no MetaTrader terminal, no Expert Advisor, no VPS.

## 1. Create an AlgoDeltaFX account

[Sign up](https://www.algodeltafx.com/platform/register) and open the dashboard. Every plan includes API access, and there is a 1-week free demo.

## 2. Connect your MT5 account

In the dashboard, add the MT5 account with its **login**, **password** and **broker server** (for example `Exness-MT5Real29` or `ICMarketsSC-Demo`). The server name is shown in the MetaTrader 5 login window.

Prefer to automate this? Use [Add MT5 Account](/api/add-account/) from the Master API.

## 3. Copy the account token

Each connected account has its own API token (a JWT). Copy it from the dashboard and keep it in an environment variable:

```bash
export ACCOUNT_TOKEN="eyJhbGciOi..."
```

## 4. Check the connection

```bash
curl https://api.algodeltafx.com/api/v2/forexaccount/getprofile \
  -H "Authorization: Bearer $ACCOUNT_TOKEN"
```

A response with `"status": true` means the token is valid and the account is connected.

## 5. Find the exact symbol name

Brokers name symbols differently (`EURUSD`, `EURUSDm`, `EURUSD.pro`). Read the exact name first:

```bash
curl https://api.algodeltafx.com/api/v2/forexaccount/getsymbols \
  -H "Authorization: Bearer $ACCOUNT_TOKEN"
```

## 6. Place a trade

Open a 0.01 lot market Buy on EURUSD with a stop loss and take profit:

```bash
curl -X POST https://api.algodeltafx.com/api/v2/forexaccount/placeorder \
  -H "Authorization: Bearer $ACCOUNT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"symbol": "EURUSD", "type": 0, "volume": 0.01, "sl": 1.0750, "tp": 1.0950}'
```

```json
{ "status": true, "msg": "Order placed", "data": { "ticket": 1093918439 } }
```

`type: 0` is a market Buy. See all eight [order types](/reference/order-types/).

## 7. Manage and close it

```bash
# See it in open positions
curl https://api.algodeltafx.com/api/v2/forexaccount/getopenpositions \
  -H "Authorization: Bearer $ACCOUNT_TOKEN"

# Close it by ticket
curl -X POST https://api.algodeltafx.com/api/v2/forexaccount/squareoffposition \
  -H "Authorization: Bearer $ACCOUNT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"ticket": 1093918439}'
```

## Next steps

- [Authentication](/authentication/): Account tokens vs master tokens.
- [Trade MT5 with Python](/guides/mt5-api-python/): a complete Python client.
- [MT5 copy trading API](/guides/mt5-copy-trading-api/): manage many accounts from one master.
- [Download the Postman collection](/algodeltafx-mt5-api.postman_collection.json) or the [OpenAPI spec](/openapi.json).

---
Source: https://docs.algodeltafx.com/quickstart/
