模拟行情

开发者接口

用令牌调用和网页同一套模拟报价与账户。

每秒最多 10 次。 注册账户后可以创建接口令牌。演示账户只留在这台浏览器里。

令牌

curl -c jar -H 'content-type: application/json' \
  -d '{"email":"you@example.com","password":"secret12"}' \
  https://YOUR_HOST/api/auth/login

curl -b jar -H 'content-type: application/json' \
  -d '{"name":"bot"}' \
  https://YOUR_HOST/api/v1/tokens

令牌只显示一次。请马上复制。

行情

curl -H 'authorization: Bearer nfx_...' \
  'https://YOUR_HOST/api/v1/quotes?symbols=EURUSD,XAUUSD'

curl -H 'authorization: Bearer nfx_...' \
  'https://YOUR_HOST/api/v1/candles?symbol=XAUUSD&interval=1m&limit=200'

下单

curl -H 'authorization: Bearer nfx_...' -H 'content-type: application/json' \
  -d '{"symbol":"EURUSD","side":"BUY","lots":0.01,"sl":1.05,"tp":1.12,"clientOrderId":"bot-1"}' \
  https://YOUR_HOST/api/v1/orders

持仓

curl -H 'authorization: Bearer nfx_...' https://YOUR_HOST/api/v1/positions

curl -X PATCH -H 'authorization: Bearer nfx_...' -H 'content-type: application/json' \
  -d '{"sl":1.04,"tp":1.13}' \
  https://YOUR_HOST/api/v1/positions/POSITION_ID

curl -H 'authorization: Bearer nfx_...' -H 'content-type: application/json' \
  -d '{"lots":0.01}' \
  https://YOUR_HOST/api/v1/positions/POSITION_ID/close

历史

curl -H 'authorization: Bearer nfx_...' \
  'https://YOUR_HOST/api/v1/history?limit=100'

closeReason: USER, SL, TP, STOP_OUT