live TR
Home / Docs / Guides

A Free Paper Trading API

Testing a strategy against live prices usually means opening a broker demo, installing a terminal and learning its API first. biquote's demo trading API skips all of that: one request opens a virtual margin account, the next one places an order, and the account is marked to the same live prices the rest of the API serves. No signup, no API key, no real money.

Open an account and place a trade

# 1. Open an account. The accountKey is shown once: keep it.
curl -X POST https://biquote.io/api/demo/accounts \
  -H "Content-Type: application/json" \
  -d '{"balance": 10000, "leverage": 100, "stopOutLevel": 50}'

# 2. Buy 0.10 lot of gold with a stop loss and a take profit
curl -X POST https://biquote.io/api/demo/orders \
  -H "X-Demo-Key: bqd_your_key" -H "Content-Type: application/json" \
  -d '{"symbol": "XAUUSD", "side": "buy", "volume": 0.1, "stopLoss": 3000, "takeProfit": 4500}'

# 3. Balance, equity, margin and margin level
curl https://biquote.io/api/demo/account -H "X-Demo-Key: bqd_your_key"

The order answers with the position it opened and the account after it:

{
  "position": {
    "id": 37, "symbol": "XAUUSD", "side": "buy", "volume": 0.1,
    "openPrice": 3643.343, "stopLoss": 3000, "takeProfit": 4500,
    "currentPrice": 3643.204, "profit": -1.39, "margin": 364.33
  },
  "order": null,
  "account": { "balance": 10000, "equity": 9998.61, "margin": 364.33,
               "freeMargin": 9634.28, "marginLevel": 2744.35 }
}

The same thing in Python

# pip install biquote
from biquote import Biquote

bq = Biquote()
acct = bq.create_demo_account(balance=10_000, leverage=100, stop_out_level=50)
print(acct.key)  # shown once: it is the account

opened = acct.buy("XAUUSD", 0.1, stop_loss=3000, take_profit=4500)
position = opened["position"]

s = acct.summary()
print(s["equity"], s["margin"], s["marginLevel"])

acct.close(position["id"])
for deal in acct.history():
    print(deal["reason"], deal["profit"])

No SDK is required: every call is plain JSON over HTTPS with one header, X-Demo-Key.

What an account can do

FeatureDetail
Account settingsStarting balance up to 10,000,000 USD, leverage 1 to 1000, your own stop-out and margin-call levels
OrdersMarket, limit and stop, each with optional stop loss and take profit
PositionsModify stops, close in full or in part, close all
MarginEquity, margin, free margin and margin level, with stop-out when the level falls below yours
HistoryEvery closed trade with its reason: user, stop_loss, take_profit or stop_out
Live eventsFills, closes, stop-outs and margin calls pushed over the SignalR hub
InstrumentsForex, gold and silver, index CFDs, crypto and stock CFDs

How orders fill

A simulator, not a broker. There is no slippage, commission or swap, prices are indicative, and results will differ from any real account. Good for testing logic; not a prediction of live performance.

What people build with it

Questions

Is the paper trading API free? Do I need an account?

It is free and needs no signup or API key. One POST request opens a demo account and returns a key; that key is the account.

Which instruments can I trade?

Any symbol the API quotes whose profit can be converted to USD: forex pairs, gold and silver, index CFDs, crypto and stock CFDs. GET /api/demo/instruments/{symbol} shows the contract size, volume limits and the margin one lot needs.

How realistic are the fills?

Orders fill at the quoted bid or ask with no slippage, commission or swap. Stops and pending orders are checked against sampled prices and fill at the newest price, so through a gap they fill on the far side. Results will differ from a real account.

Can I run a trading bot on it?

Yes. An account holds up to 200 open positions and 200 pending orders, and requests count against the normal limit of 15,000 per minute per IP. You can open 20 new accounts per IP per day; an account unused for 30 days is deleted.

Is real money involved?

No. It is a simulator, not a broker: funds are virtual, nothing is sent to any market, and nothing can be withdrawn.

Try it in the browser →

Full reference, error codes and the live event contract: Demo trading API documentation.