Paper Portfolio
On this page
Portfolio and accounts
Paper trading runs a frozen Strategy continuously in an isolated simulation. Choose the reporting currency, initial assets and up to 16 simulated accounts. It does not connect a OnePort trading credential or a real account, so it cannot submit a real order.
Each instrument is routed to one simulated account. Accounts may belong to different venues, and a Strategy may read a signal from one venue while placing its simulated order on another. With a dynamic universe, review the resolved instruments and account routes before creation; if the available universe changes, refresh the preview before continuing.
If the Paper universe includes UPERP, choose USD as base_coin. This keeps perpetual PnL, fees and funding in the same reporting currency without guessing a settlement asset. SPOT-only Paper may use any reporting currency offered by the creation form.
During a run, strategy callbacks use completed KLines from OnePort OpenAPI at the selected frequency. When the Strategy submits or reprices an order, Paper reads a fresh OnePort BBO and applies the result only to the isolated account. Historical Backtest continues to use its historical-bar execution model.
Orders and status
Every order call returns the same OrderSubmitResult shape in Backtest, Paper and Live. It includes a stable local_order_id, submission success, status, requested quantity, filled quantity and average fill price when available. Store the local ID when the Strategy needs to check or cancel the order on a later trigger.
def handle_bar(self, ctx, bars):
pending = getattr(ctx.state, "pending_order_id", None)
if pending is not None:
order = ctx.order_status(pending)
if order and order.terminal is True:
ctx.state.pending_order_id = None
return
result = ctx.place_order(
"okx:UPERP:BTC-USDT-SWAP",
"Buy",
"Market",
0.01,
account="okx-main",
)
if result.success is True:
ctx.state.pending_order_id = result.local_order_idPaper market orders complete immediately when a valid, current BBO is available. If the quote is missing or invalid, the order is rejected and the account is left unchanged. Limit orders and open orders remain visible through order status and the Paper dashboard.
Lifecycle
| Action | Result | What is retained |
|---|---|---|
| Start | Starts the deployment | Uses the selected frozen Strategy and account setup |
| Pause | Stops new strategy triggers temporarily | Accounts, positions and open orders |
| Resume | Continues the paused deployment | Resumes from the retained state |
| Stop | Ends the deployment | History remains available; positions are not closed automatically |
| Delete | Removes a stopped deployment from the workspace | Completed order and fill records are preserved |
The page checks that you are acting on the latest deployment state, so an older browser tab cannot overwrite a newer action. Pausing or stopping never submits a hidden close or cancel request.
Missing market data
For a cross-venue decision, Paper waits until every required instrument has the same completed OnePort OpenAPI KLine slot. It never runs the Strategy with only part of that snapshot. Missing bars are not filled with zero or copied from the previous candle. An order also needs a current valid BBO; without one, positions and balances stay unchanged.
The dashboard keeps the last observed price together with its time and clearly marks stale or unavailable values. It never silently interpolates a gap.
Portfolio dashboard
The dashboard brings together Portfolio performance, account balances, positions, orders, fills, fees, strategy records and runtime health. Use the Portfolio view for the combined NAV and equity, then open an account to inspect its own activity.
Combined Portfolio values are shown only when all accounts can be valued consistently in the reporting currency. Otherwise the account views remain available and the missing aggregate is labelled unavailable instead of being estimated.
Values recorded with ctx.record appear as custom series. You can compare or normalize selected series in the dashboard; missing timestamps are left missing.