{
  "schemaVersion": "1.0",
  "item": {
    "slug": "mt5-httpapi",
    "name": "mt5-httpapi",
    "source": "tencent",
    "type": "skill",
    "category": "开发工具",
    "sourceUrl": "https://clawhub.ai/psyb0t/mt5-httpapi",
    "canonicalUrl": "https://clawhub.ai/psyb0t/mt5-httpapi",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/mt5-httpapi",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=mt5-httpapi",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "SKILL.md",
      "references/setup.md"
    ],
    "primaryDoc": "SKILL.md",
    "quickSetup": [
      "Download the package from Yavira.",
      "Extract the archive and review SKILL.md first.",
      "Import or place the package into your OpenClaw setup."
    ],
    "agentAssist": {
      "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
      "steps": [
        "Download the package from Yavira.",
        "Extract it into a folder your agent can access.",
        "Paste one of the prompts below and point your agent at the extracted folder."
      ],
      "prompts": [
        {
          "label": "New install",
          "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
        },
        {
          "label": "Upgrade existing",
          "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
        }
      ]
    },
    "sourceHealth": {
      "source": "tencent",
      "slug": "mt5-httpapi",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-05-12T08:29:20.389Z",
      "expiresAt": "2026-05-19T08:29:20.389Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=mt5-httpapi",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=mt5-httpapi",
        "contentDisposition": "attachment; filename=\"mt5-httpapi-1.3.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null,
        "slug": "mt5-httpapi"
      },
      "scope": "item",
      "summary": "Item download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this item.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/mt5-httpapi"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    },
    "downloadPageUrl": "https://openagent3.xyz/downloads/mt5-httpapi",
    "agentPageUrl": "https://openagent3.xyz/skills/mt5-httpapi/agent",
    "manifestUrl": "https://openagent3.xyz/skills/mt5-httpapi/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/mt5-httpapi/agent.md"
  },
  "agentAssist": {
    "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
    "steps": [
      "Download the package from Yavira.",
      "Extract it into a folder your agent can access.",
      "Paste one of the prompts below and point your agent at the extracted folder."
    ],
    "prompts": [
      {
        "label": "New install",
        "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
      },
      {
        "label": "Upgrade existing",
        "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
      }
    ]
  },
  "documentation": {
    "source": "clawhub",
    "primaryDoc": "SKILL.md",
    "sections": [
      {
        "title": "mt5-httpapi",
        "body": "REST API on top of MetaTrader 5 running inside a Windows VM. Talk to it with plain HTTP/JSON — no MT5 libraries, no Windows, no bullshit. Just curl and go.\n\nFor installation and setup, see references/setup.md."
      },
      {
        "title": "Setup",
        "body": "The API should already be running. Set the base URL:\n\nexport MT5_API_URL=http://localhost:6542\n\nEach terminal has its own port (configured in terminals.json). If running multiple terminals, set MT5_API_URL to the port for the terminal you want to talk to.\n\nVerify: curl $MT5_API_URL/ping — should return {\"status\": \"ok\"}. If not, the API isn't up yet (may still be initializing — it retries in the background)."
      },
      {
        "title": "How It Works",
        "body": "GET for reading, POST for creating, PUT for modifying, DELETE for closing/canceling. All bodies are JSON.\n\nEvery error response:\n\n{\"error\": \"description of what went wrong\"}"
      },
      {
        "title": "Pre-Trade Checks (DO NOT SKIP)",
        "body": "Before placing any trade:\n\nGET /account → trade_allowed must be true\nGET /symbols/SYMBOL → trade_mode must be 4 (full trading)\nGET /symbols/SYMBOL → check trade_contract_size — 1 lot of EURUSD = 100,000 EUR, not 1 EUR\nGET /terminal → connected must be true"
      },
      {
        "title": "Health",
        "body": "curl $MT5_API_URL/ping\n# {\"status\": \"ok\"}\n\ncurl $MT5_API_URL/error\n# {\"code\": 1, \"message\": \"Success\"}"
      },
      {
        "title": "Terminal",
        "body": "curl $MT5_API_URL/terminal\ncurl -X POST $MT5_API_URL/terminal/init\ncurl -X POST $MT5_API_URL/terminal/shutdown\n\nKey fields on /terminal: connected, trade_allowed, build, company."
      },
      {
        "title": "Account",
        "body": "curl $MT5_API_URL/account\n\n{\n    \"login\": 12345678,\n    \"balance\": 10000.0,\n    \"equity\": 10000.0,\n    \"margin\": 0.0,\n    \"margin_free\": 10000.0,\n    \"margin_level\": 0.0,\n    \"leverage\": 500,\n    \"currency\": \"USD\",\n    \"trade_allowed\": true,\n    \"margin_so_call\": 70.0,\n    \"margin_so_so\": 20.0\n}"
      },
      {
        "title": "Symbols",
        "body": "curl $MT5_API_URL/symbols\ncurl \"$MT5_API_URL/symbols?group=*USD*\"\ncurl $MT5_API_URL/symbols/EURUSD\ncurl $MT5_API_URL/symbols/EURUSD/tick\ncurl \"$MT5_API_URL/symbols/EURUSD/rates?timeframe=H4&count=100\"\ncurl \"$MT5_API_URL/symbols/EURUSD/ticks?count=100\"\n\nTimeframes: M1 M2 M3 M4 M5 M6 M10 M12 M15 M20 M30 H1 H2 H3 H4 H6 H8 H12 D1 W1 MN1\n\nKey symbol fields: bid, ask, digits, point, trade_contract_size, trade_tick_value, trade_tick_size, volume_min, volume_max, volume_step, spread, swap_long, swap_short, trade_stops_level, trade_mode."
      },
      {
        "title": "Orders",
        "body": "# Place market order\ncurl -X POST $MT5_API_URL/orders \\\n  -H 'Content-Type: application/json' \\\n  -d '{\"symbol\": \"EURUSD\", \"type\": \"BUY\", \"volume\": 0.1, \"sl\": 1.08, \"tp\": 1.10}'\n\n# List pending orders\ncurl $MT5_API_URL/orders\ncurl \"$MT5_API_URL/orders?symbol=EURUSD\"\ncurl $MT5_API_URL/orders/42094812\n\n# Modify pending order\ncurl -X PUT $MT5_API_URL/orders/42094812 \\\n  -H 'Content-Type: application/json' \\\n  -d '{\"price\": 1.09, \"sl\": 1.07, \"tp\": 1.11}'\n\n# Cancel pending order\ncurl -X DELETE $MT5_API_URL/orders/42094812\n\nOrder types: BUY, SELL, BUY_LIMIT, SELL_LIMIT, BUY_STOP, SELL_STOP, BUY_STOP_LIMIT, SELL_STOP_LIMIT\n\nFill policies: FOK, IOC (default), RETURN\n\nExpiration: GTC (default), DAY, SPECIFIED, SPECIFIED_DAY\n\nRequired fields: symbol, type, volume. price auto-fills for market orders.\n\nTrade result:\n\n{\n    \"retcode\": 10009,\n    \"deal\": 40536203,\n    \"order\": 42094820,\n    \"volume\": 0.1,\n    \"price\": 1.0950,\n    \"comment\": \"Request executed\"\n}\n\nretcode 10009 = success. Anything else = something went wrong."
      },
      {
        "title": "Positions",
        "body": "curl $MT5_API_URL/positions\ncurl \"$MT5_API_URL/positions?symbol=EURUSD\"\ncurl $MT5_API_URL/positions/42094820\n\n# Update SL/TP\ncurl -X PUT $MT5_API_URL/positions/42094820 \\\n  -H 'Content-Type: application/json' \\\n  -d '{\"sl\": 1.085, \"tp\": 1.105}'\n\n# Close full position\ncurl -X DELETE $MT5_API_URL/positions/42094820\n\n# Partial close\ncurl -X DELETE $MT5_API_URL/positions/42094820 \\\n  -H 'Content-Type: application/json' \\\n  -d '{\"volume\": 0.05}'\n\nKey position fields: ticket, type (0=buy, 1=sell), volume, price_open, price_current, sl, tp, profit, swap."
      },
      {
        "title": "History",
        "body": "curl \"$MT5_API_URL/history/orders?from=$(date -d '1 day ago' +%s)&to=$(date +%s)\"\ncurl \"$MT5_API_URL/history/deals?from=$(date -d '1 day ago' +%s)&to=$(date +%s)\"\n\nfrom and to are required, unix epoch seconds.\n\nDeal fields: type (0=buy, 1=sell), entry (0=opening, 1=closing), profit (0 for entries, realized P&L for exits)."
      },
      {
        "title": "Position Sizing",
        "body": "risk_amount     = balance * risk_pct\nsl_distance     = ATR * multiplier\nticks_in_sl     = sl_distance / trade_tick_size\nrisk_per_lot    = ticks_in_sl * trade_tick_value\nvolume          = risk_amount / risk_per_lot\n\nRound down to nearest volume_step, clamp to [volume_min, volume_max]. Sanity check: volume * trade_contract_size * price should make sense relative to account balance."
      },
      {
        "title": "Tips",
        "body": "Always check retcode — 10009 = good, anything else = bad\nUse GET /error to debug failed trades\ndeviation on orders = max slippage in points (default 20, raise for volatile markets)\ntype_filling matters — try FOK, IOC, RETURN if orders get rejected\nCandle time is the open time, not close time\ntrade_stops_level = minimum SL/TP distance from current price in points\nMarkets have hours — check trade_mode before placing orders"
      }
    ],
    "body": "mt5-httpapi\n\nREST API on top of MetaTrader 5 running inside a Windows VM. Talk to it with plain HTTP/JSON — no MT5 libraries, no Windows, no bullshit. Just curl and go.\n\nFor installation and setup, see references/setup.md.\n\nSetup\n\nThe API should already be running. Set the base URL:\n\nexport MT5_API_URL=http://localhost:6542\n\n\nEach terminal has its own port (configured in terminals.json). If running multiple terminals, set MT5_API_URL to the port for the terminal you want to talk to.\n\nVerify: curl $MT5_API_URL/ping — should return {\"status\": \"ok\"}. If not, the API isn't up yet (may still be initializing — it retries in the background).\n\nHow It Works\n\nGET for reading, POST for creating, PUT for modifying, DELETE for closing/canceling. All bodies are JSON.\n\nEvery error response:\n\n{\"error\": \"description of what went wrong\"}\n\nPre-Trade Checks (DO NOT SKIP)\n\nBefore placing any trade:\n\nGET /account → trade_allowed must be true\nGET /symbols/SYMBOL → trade_mode must be 4 (full trading)\nGET /symbols/SYMBOL → check trade_contract_size — 1 lot of EURUSD = 100,000 EUR, not 1 EUR\nGET /terminal → connected must be true\nAPI Reference\nHealth\ncurl $MT5_API_URL/ping\n# {\"status\": \"ok\"}\n\ncurl $MT5_API_URL/error\n# {\"code\": 1, \"message\": \"Success\"}\n\nTerminal\ncurl $MT5_API_URL/terminal\ncurl -X POST $MT5_API_URL/terminal/init\ncurl -X POST $MT5_API_URL/terminal/shutdown\n\n\nKey fields on /terminal: connected, trade_allowed, build, company.\n\nAccount\ncurl $MT5_API_URL/account\n\n{\n    \"login\": 12345678,\n    \"balance\": 10000.0,\n    \"equity\": 10000.0,\n    \"margin\": 0.0,\n    \"margin_free\": 10000.0,\n    \"margin_level\": 0.0,\n    \"leverage\": 500,\n    \"currency\": \"USD\",\n    \"trade_allowed\": true,\n    \"margin_so_call\": 70.0,\n    \"margin_so_so\": 20.0\n}\n\nSymbols\ncurl $MT5_API_URL/symbols\ncurl \"$MT5_API_URL/symbols?group=*USD*\"\ncurl $MT5_API_URL/symbols/EURUSD\ncurl $MT5_API_URL/symbols/EURUSD/tick\ncurl \"$MT5_API_URL/symbols/EURUSD/rates?timeframe=H4&count=100\"\ncurl \"$MT5_API_URL/symbols/EURUSD/ticks?count=100\"\n\n\nTimeframes: M1 M2 M3 M4 M5 M6 M10 M12 M15 M20 M30 H1 H2 H3 H4 H6 H8 H12 D1 W1 MN1\n\nKey symbol fields: bid, ask, digits, point, trade_contract_size, trade_tick_value, trade_tick_size, volume_min, volume_max, volume_step, spread, swap_long, swap_short, trade_stops_level, trade_mode.\n\nOrders\n# Place market order\ncurl -X POST $MT5_API_URL/orders \\\n  -H 'Content-Type: application/json' \\\n  -d '{\"symbol\": \"EURUSD\", \"type\": \"BUY\", \"volume\": 0.1, \"sl\": 1.08, \"tp\": 1.10}'\n\n# List pending orders\ncurl $MT5_API_URL/orders\ncurl \"$MT5_API_URL/orders?symbol=EURUSD\"\ncurl $MT5_API_URL/orders/42094812\n\n# Modify pending order\ncurl -X PUT $MT5_API_URL/orders/42094812 \\\n  -H 'Content-Type: application/json' \\\n  -d '{\"price\": 1.09, \"sl\": 1.07, \"tp\": 1.11}'\n\n# Cancel pending order\ncurl -X DELETE $MT5_API_URL/orders/42094812\n\n\nOrder types: BUY, SELL, BUY_LIMIT, SELL_LIMIT, BUY_STOP, SELL_STOP, BUY_STOP_LIMIT, SELL_STOP_LIMIT\n\nFill policies: FOK, IOC (default), RETURN\n\nExpiration: GTC (default), DAY, SPECIFIED, SPECIFIED_DAY\n\nRequired fields: symbol, type, volume. price auto-fills for market orders.\n\nTrade result:\n\n{\n    \"retcode\": 10009,\n    \"deal\": 40536203,\n    \"order\": 42094820,\n    \"volume\": 0.1,\n    \"price\": 1.0950,\n    \"comment\": \"Request executed\"\n}\n\n\nretcode 10009 = success. Anything else = something went wrong.\n\nPositions\ncurl $MT5_API_URL/positions\ncurl \"$MT5_API_URL/positions?symbol=EURUSD\"\ncurl $MT5_API_URL/positions/42094820\n\n# Update SL/TP\ncurl -X PUT $MT5_API_URL/positions/42094820 \\\n  -H 'Content-Type: application/json' \\\n  -d '{\"sl\": 1.085, \"tp\": 1.105}'\n\n# Close full position\ncurl -X DELETE $MT5_API_URL/positions/42094820\n\n# Partial close\ncurl -X DELETE $MT5_API_URL/positions/42094820 \\\n  -H 'Content-Type: application/json' \\\n  -d '{\"volume\": 0.05}'\n\n\nKey position fields: ticket, type (0=buy, 1=sell), volume, price_open, price_current, sl, tp, profit, swap.\n\nHistory\ncurl \"$MT5_API_URL/history/orders?from=$(date -d '1 day ago' +%s)&to=$(date +%s)\"\ncurl \"$MT5_API_URL/history/deals?from=$(date -d '1 day ago' +%s)&to=$(date +%s)\"\n\n\nfrom and to are required, unix epoch seconds.\n\nDeal fields: type (0=buy, 1=sell), entry (0=opening, 1=closing), profit (0 for entries, realized P&L for exits).\n\nPosition Sizing\nrisk_amount     = balance * risk_pct\nsl_distance     = ATR * multiplier\nticks_in_sl     = sl_distance / trade_tick_size\nrisk_per_lot    = ticks_in_sl * trade_tick_value\nvolume          = risk_amount / risk_per_lot\n\n\nRound down to nearest volume_step, clamp to [volume_min, volume_max]. Sanity check: volume * trade_contract_size * price should make sense relative to account balance.\n\nTips\nAlways check retcode — 10009 = good, anything else = bad\nUse GET /error to debug failed trades\ndeviation on orders = max slippage in points (default 20, raise for volatile markets)\ntype_filling matters — try FOK, IOC, RETURN if orders get rejected\nCandle time is the open time, not close time\ntrade_stops_level = minimum SL/TP distance from current price in points\nMarkets have hours — check trade_mode before placing orders"
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/psyb0t/mt5-httpapi",
    "publisherUrl": "https://clawhub.ai/psyb0t/mt5-httpapi",
    "owner": "psyb0t",
    "version": "1.1.0",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/mt5-httpapi",
    "downloadUrl": "https://openagent3.xyz/downloads/mt5-httpapi",
    "agentUrl": "https://openagent3.xyz/skills/mt5-httpapi/agent",
    "manifestUrl": "https://openagent3.xyz/skills/mt5-httpapi/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/mt5-httpapi/agent.md"
  }
}