模擬行情

開發者介面

用權杖呼叫和網頁同一套模擬報價與帳戶。

每秒最多 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