# Send cTrader Commander to your agent
Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.
## Fast path
- 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.
## Suggested prompts
### New install

```text
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.
```
### Upgrade existing

```text
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.
```
## Machine-readable fields
```json
{
  "schemaVersion": "1.0",
  "item": {
    "slug": "ctrader-commander",
    "name": "cTrader Commander",
    "source": "tencent",
    "type": "skill",
    "category": "开发工具",
    "sourceUrl": "https://clawhub.ai/elmoyeldo/ctrader-commander",
    "canonicalUrl": "https://clawhub.ai/elmoyeldo/ctrader-commander",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadUrl": "/downloads/ctrader-commander",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=ctrader-commander",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "packageFormat": "ZIP package",
    "primaryDoc": "SKILL.md",
    "includedAssets": [
      "endpoints.md",
      "SKILL.md"
    ],
    "downloadMode": "redirect",
    "sourceHealth": {
      "source": "tencent",
      "slug": "ctrader-commander",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-05-11T19:38:37.166Z",
      "expiresAt": "2026-05-18T19:38:37.166Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=ctrader-commander",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=ctrader-commander",
        "contentDisposition": "attachment; filename=\"ctrader-commander-1.0.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null,
        "slug": "ctrader-commander"
      },
      "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/ctrader-commander"
    },
    "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."
      ]
    }
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/ctrader-commander",
    "downloadUrl": "https://openagent3.xyz/downloads/ctrader-commander",
    "agentUrl": "https://openagent3.xyz/skills/ctrader-commander/agent",
    "manifestUrl": "https://openagent3.xyz/skills/ctrader-commander/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/ctrader-commander/agent.md"
  }
}
```
## Documentation

### cTrader Commander

Use when the user wants to place trades, check positions or balance, get live prices, fetch candles, or manage orders on a cTrader account.

All calls go to http://localhost:9009 — credentials live in .env on the server, never passed by callers.

Proxy repo: https://github.com/LogicalSapien/ctrader-openapi-proxy
Clone it, add your .env, and run make run to start the proxy before using this skill.

Full reference: {baseDir}/endpoints.md

### Check proxy is running

curl -s "http://localhost:9009/get-data?command=ProtoOAVersionReq"

If it fails, start the proxy: cd ~/ctrader-openapi-proxy && make run

### Find symbol IDs (do this first)

Symbol IDs are broker-specific — look them up before placing orders or fetching data:

curl -s "http://localhost:9009/get-data?command=ProtoOASymbolsListReq"

Returns symbol[] with symbolId and symbolName. Note the ID for your instrument.

### Place a market order

curl -s -X POST http://localhost:9009/api/market-order \\
  -H "Content-Type: application/json" \\
  -d '{"symbolId": 158, "orderType": "MARKET", "tradeSide": "BUY", "volume": 1000}'

Volume is in units: 1000 = 0.01 lot · 10000 = 0.1 lot · 100000 = 1 lot.
Add "relativeStopLoss": 200, "relativeTakeProfit": 350 (pips, market orders only).

### Place a limit or stop order

curl -s -X POST http://localhost:9009/api/market-order \\
  -H "Content-Type: application/json" \\
  -d '{"symbolId": 158, "orderType": "LIMIT", "tradeSide": "BUY", "volume": 1000, "price": 0.62500}'

orderType: MARKET · LIMIT · STOP — tradeSide: BUY · SELL

### Get OHLC candles

NOW_MS=$(python3 -c "import time; print(int(time.time()*1000))")
FROM_MS=$(python3 -c "import time; print(int(time.time()*1000) - 3600000)")
curl -s -X POST http://localhost:9009/api/trendbars \\
  -H "Content-Type: application/json" \\
  -d "{\\"fromTimestamp\\": $FROM_MS, \\"toTimestamp\\": $NOW_MS, \\"period\\": \\"M5\\", \\"symbolId\\": 158}"

Periods: M1 M2 M3 M4 M5 M10 M15 M30 H1 H4 H12 D1 W1 MN1

### Get live quote (tick data)

curl -s -X POST http://localhost:9009/api/live-quote \\
  -H "Content-Type: application/json" \\
  -d '{"symbolId": 158, "quoteType": "BID", "timeDeltaInSeconds": 60}'

quoteType: BID or ASK

### Open positions and pending orders

curl -s "http://localhost:9009/get-data?command=ProtoOAReconcileReq"

### Close a position

curl -s "http://localhost:9009/get-data?command=ClosePosition%20123456%201000"
# ClosePosition <positionId> <volumeInUnits>

### Cancel a pending order

curl -s "http://localhost:9009/get-data?command=CancelOrder%20789"

### Account info (balance, equity, leverage)

curl -s "http://localhost:9009/get-data?command=ProtoOATraderReq"

A local HTTP proxy (localhost:9009) that wraps the cTrader OpenAPI Protobuf connection and exposes it as a REST API. No credentials are passed at call time — they are loaded from .env on the server.

Full endpoint reference: {baseDir}/endpoints.md
Python usage examples: {baseDir}/examples.md

### Prerequisites

The proxy must be running before any call. If unsure, check:

curl -s "http://localhost:9009/get-data?command=ProtoOAVersionReq"

If it returns JSON, the proxy is up. If it fails, start it:

cd ~/ctrader-openapi-proxy && make run

### IMPORTANT: Symbol IDs are broker-specific

Always look up the symbol ID before placing orders or fetching candle/tick data.
Symbol IDs differ between brokers and between demo and live accounts.

curl -s "http://localhost:9009/get-data?command=ProtoOASymbolsListReq"

Response contains symbol[] with symbolId and symbolName. Find your instrument and note its symbolId.

### Get OHLC Candles

POST /api/trendbars

{
  "fromTimestamp": 1700000000000,
  "toTimestamp":   1700086400000,
  "period":        "M5",
  "symbolId":      158
}

period options: M1 M2 M3 M4 M5 M10 M15 M30 H1 H4 H12 D1 W1 MN1

For current time in ms (macOS):

NOW_MS=$(python3 -c "import time; print(int(time.time()*1000))")
FROM_MS=$(python3 -c "import time; print(int(time.time()*1000) - 3600000)")

### Get Live Quote / Tick Data

POST /api/live-quote

{
  "symbolId":           158,
  "quoteType":          "BID",
  "timeDeltaInSeconds": 60
}

quoteType: "BID" or "ASK"

### Place a Market / Limit / Stop Order

POST /api/market-order

{
  "symbolId":           158,
  "orderType":          "MARKET",
  "tradeSide":          "BUY",
  "volume":             1000,
  "comment":            "my trade",
  "relativeStopLoss":   200,
  "relativeTakeProfit": 350
}

orderType values: "MARKET" "LIMIT" "STOP"
tradeSide values: "BUY" "SELL"

For LIMIT and STOP orders, include "price": 0.62500.
relativeStopLoss / relativeTakeProfit are in pips and apply to MARKET orders only.

Volume units (NOT lots):

volumeLotsNotes10000.01Micro lot — typical minimum100000.1Mini lot1000001Standard lot

### Get Open Positions and Pending Orders

GET /get-data?command=ProtoOAReconcileReq

Returns position[] and order[]. Each position has positionId, symbolId, tradeSide, volume, price.

### Close an Open Position

GET /get-data?command=ClosePosition <positionId> <volumeInUnits>

Example — close position 123456 with 1000 units (0.01 lot):

curl -s "http://localhost:9009/get-data?command=ClosePosition%20123456%201000"

### Cancel a Pending Order

GET /get-data?command=CancelOrder <orderId>

curl -s "http://localhost:9009/get-data?command=CancelOrder%20789"

### Set Active Account (optional)

Account is auto-authorised from .env on startup. Only call this to switch accounts at runtime:

curl -s -X POST http://localhost:9009/api/set-account

To switch to a different account pass {"accountId": 12345678} as JSON body.

### Generic Command Passthrough

Any cTrader API command can be called via:

GET /get-data?command=COMMAND_NAME arg1 arg2

No token required — credentials are read from .env on the server.

Full list of supported commands: {baseDir}/endpoints.md

### Workflow: first trade

Look up your symbol ID:
curl -s "http://localhost:9009/get-data?command=ProtoOASymbolsListReq" | python3 -c "
import sys, json
data = json.load(sys.stdin)
[print(s['symbolId'], s['symbolName']) for s in data.get('symbol', []) if 'EURUSD' in s['symbolName']]
"


Check your account details:
curl -s "http://localhost:9009/get-data?command=ProtoOATraderReq"


Place a market buy:
curl -s -X POST http://localhost:9009/api/market-order \\
  -H "Content-Type: application/json" \\
  -d '{"symbolId": 1, "orderType": "MARKET", "tradeSide": "BUY", "volume": 1000}'


Check open positions:
curl -s "http://localhost:9009/get-data?command=ProtoOAReconcileReq"
## Trust
- Source: tencent
- Verification: Indexed source record
- Publisher: elmoyeldo
- Version: 1.0.0
## Source health
- Status: healthy
- Item download looks usable.
- Yavira can redirect you to the upstream package for this item.
- Health scope: item
- Reason: direct_download_ok
- Checked at: 2026-05-11T19:38:37.166Z
- Expires at: 2026-05-18T19:38:37.166Z
- Recommended action: Download for OpenClaw
## Links
- [Detail page](https://openagent3.xyz/skills/ctrader-commander)
- [Send to Agent page](https://openagent3.xyz/skills/ctrader-commander/agent)
- [JSON manifest](https://openagent3.xyz/skills/ctrader-commander/agent.json)
- [Markdown brief](https://openagent3.xyz/skills/ctrader-commander/agent.md)
- [Download page](https://openagent3.xyz/downloads/ctrader-commander)