Skip to main content

Environments & testing

One environment: production​

OnlyTrade runs a single environment — production. There is no separate sandbox or staging server. Each broker has its own deployment, so your API host is your broker's. The public reference deployment is:

https://api.onlytradeplatform.com

Test on a demo account​

You test on a demo account instead. It runs on the same production system, with the same live prices, order rules, margin and stop-out, but with virtual money.

Get one by:

  • opening a free trial on your broker's website, or
  • asking your broker for a demo account.

GET /api/v1/accounts/me tells you which one you're on: trade_type is 1 for demo and 0 for live.

A demo account typically starts with $100,000 of virtual balance and runs for a limited trial period (30 days by default — your broker can change it). When it expires, logins return this trial account has expired.

Guard against the wrong account

Have your bot read trade_type at startup and refuse to run if it doesn't match what you expect — for example, a --live flag that must be set before it trades on trade_type: 0.

Going live​

Nothing in your code changes: same host, same endpoints. Create an API key on your live account and point the bot at it. Go through the production checklist first.