Agent-readable docs index: /llms.txt. Full docs in one file: /llms-full.txt. Download /docs.zip to grep all markdown files locally.

繁體中文快速入門

FiveSocket 是託管的 MetaTrader 5 REST API 與遠端 MCP 伺服器。無需在本機執行 Windows、VPS 或保持 MT5 終端開啟。用登入號、密碼和伺服器名稱連結任意券商的帳戶後,即可從 Claude、ChatGPT 或你自己的程式讀取餘額、持倉、歷史與圖表;prop 風控與回測已包含,交易為可選項。
產品介紹見 繁體中文落地頁。英文 API 概覽見 MT5 REST API 與 MT5 MCP server。
  1. 註冊
    開啟 app.fivesocket.com,建立帳戶並完成電子郵件驗證。先連結 MT5 帳戶免費試用(24 小時或 100 次呼叫,以先到為準,無需綁卡),再進入 7 天免費試用(需綁卡,可隨時取消)。
  2. 連結 MT5 帳戶
    在控制台的 Accounts 頁面輸入登入號、密碼,以及 MT5 顯示的精確伺服器名稱。連結時會做真實登入校驗;憑證加密儲存,任何介面都不會回傳密碼。
    也可用 API 連結(需帶 Idempotency-Key):
    export FIVESOCKET_KEY="mt5_live_..." curl -X POST https://api.fivesocket.com/v1/accounts \ -H "Authorization: Bearer $FIVESOCKET_KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: link-1" \ -d '{ "login": "12345678", "password": "your-investor-password", "server": "YourBroker-Demo" }'
    回應中的 id(例如 acc_...)用於後續所有讀取。
    server 必須與桌面版 MT5 中成功登入時使用的伺服器名完全一致。
  3. 連接 Claude 或 ChatGPT
    MCP 端點:
    https://api.fivesocket.com/mcp
    不要把 REST API 金鑰貼進 MCP 用戶端。用戶端透過 OAuth 開啟瀏覽器完成 FiveSocket 登入與授權。
    • Claude: 可從 Claude 目錄中的 FiveSocket 新增,或在自訂連線中貼上上述 URL。
    • ChatGPT: 在 Settings → Apps & Connectors → Advanced 開啟 Developer mode,建立自訂連接器並貼上同一 URL,依提示完成登入。
    唯讀端點(不含交易工具):https://api.fivesocket.com/mcp/read。
    更細的步驟見英文 MCP setup 與產品頁上的 Connect MT5 to Claude、Connect MT5 to ChatGPT。
  4. 用 Python 做第一次 REST 讀取
    建立帶 accounts:read 與 data:read 的 API 金鑰,並安裝 requests:
    pip install requests export FIVESOCKET_KEY="mt5_live_..."
    import os import time import requests BASE = "https://api.fivesocket.com/v1" session = requests.Session() session.headers["Authorization"] = f"Bearer {os.environ['FIVESOCKET_KEY']}" def get(path, **params): for attempt in range(6): response = session.get(f"{BASE}{path}", params=params, timeout=60) if response.status_code in (202, 429, 503) and attempt < 5: wait = response.headers.get("Retry-After", "") time.sleep(int(wait) if wait.isdigit() and int(wait) > 0 else 2**attempt) continue response.raise_for_status() return response.json() account_id = get("/accounts")["data"][0]["id"] balance = get(f"/accounts/{account_id}/balance") print(balance["balance"], balance["equity"], balance["currency"]) for position in get(f"/accounts/{account_id}/positions")["positions"]: print(position["symbol"], position["side"], position["volume"], position["profit"])
    202 account_warming 表示工作階段正在登入券商,請依 Retry-After 重試同一請求。金額與價格為十進位字串。

接下來