Documentation

Live Execution API

Subscribe a strategy to a live asset and timeframe — get a signal the moment its entry or exit condition fires on a real, closed candle.

Overview

💡
Live Execution is in beta. The API is stable and available on every plan, including Free — expect the surrounding tooling (dashboards, webhooks) to keep growing from here.

A live subscription watches one asset pair at one timeframe. Every time a candle closes for that pair, your strategy is evaluated against it — the same Strategy DSL and the same evaluation engine the Backtesting API uses, just running continuously instead of over a historical date range.

Base URL: https://live.emidlabs.com/api/public/v1/live

All requests require the x-api-key header with a valid API key scoped for the live service. Keys are generated in the Console — the Live Execution toggle appears there next to Backtesting.

#How it works

There's no polling loop to build. Subscribe once; a signal only exists because a real entry or exit condition became true on a real, closed candle:

StepWhat happens
1. SubscribePOST a strategy + assetPair. The timeframe comes from the strategy's own configuration.timeframe.
2. Candle closesEvery closed candle for that asset+timeframe evaluates your strategy — the same StrategyRunner the Backtesting API uses.
3. Signal firesIf entry or exit evaluates true, it's recorded immediately — poll GET .../signals or check the Console dashboard.
4. Stop anytimeDELETE the subscription — no more evaluations happen for it, no partial-period charge.

#POST /subscriptions — Create

POST/subscriptions

Subscribe a strategy to live evaluation on one asset pair.

Same strategySnapshotJson shape as the Backtesting API — see Strategy System for the full DSL reference. configuration.timeframe inside it is what determines the candle boundary your strategy evaluates on (15M, 1H, etc.) — there's no separate timeframe field on the subscription itself.

Request body

FieldTypeRequiredDescription
strategySnapshotJsonobjectYesStrategy object — configuration, inputs, conditions, score, decision, riskManagement. configuration.timeframe drives evaluation frequency.
assetPairstringYesTrading pair. E.g. "BTC-USDC", "ETH-USDC" — same pairs the Backtesting API supports.

Response

FieldTypeDescription
idstring (UUID)Unique identifier for the subscription.
statusstring"Active" immediately after creation.

#DELETE /subscriptions/{id} — Stop

DELETE/subscriptions/{id}

Stop a subscription. No further candles are evaluated for it.

Returns 404 if the subscription doesn't exist or doesn't belong to your account.

#GET /subscriptions/{id} — Status

GET/subscriptions/{id}

Fetch a single subscription's current status.

Response fields

FieldTypeDescription
idstringUUID of the subscription.
assetPairstringAsset pair being watched.
timeframestringResolved from the strategy's own configuration at creation time.
statusstring"Active" or "Stopped".
lastEvaluatedCandleOpenTimenumber | nullUnix seconds — OpenTime of the most recent candle this subscription evaluated. null if none yet.
createdAtUtcstringCreation timestamp (UTC).
stoppedAtUtcstring | nullWhen the subscription was stopped, if it has been.

#GET /subscriptions — List

GET/subscriptions

List every subscription on your account, active and stopped.

Same fields as the single-subscription response above, wrapped in an items array.

#GET /subscriptions/{id}/signals — Signal Format

GET/subscriptions/{id}/signals

The emitted signal log for a subscription — the live analogue of the Backtesting API's tradesDetail.

Response fields

FieldTypeDescription
candleOpenTimenumberUnix seconds — OpenTime of the candle whose close triggered this signal.
typestring"Entry" or "Exit".
pricenumberClose price of the triggering candle.
💡
v1 emits signals only — there's no position-tracking or order-execution layer here. What you do with a signal (place a trade, alert someone, log it) is entirely up to your own integration.

#Strategy DSL

Live Execution and Backtesting share the exact same DSL and evaluation engine — a strategy that passes a backtest can be subscribed live unchanged. See the full Strategy System reference for indicators, conditions, and the built-in function list.

warmupBars still matters live: the first candles after a subscription starts are excluded from evaluation until enough history has accumulated for your indicators to stabilize — same rule as backtesting, just measured from subscription time instead of the backtest's start date.

#Error Codes

Every error response has the same shape: { "error": "<code>", "message": "<text>" }.

StatusCodeDescription
400invalid_payloadThe request body is malformed, missing required fields, or the strategySnapshotJson fails validation.
401api_key_missingThe x-api-key header wasn't provided.
401api_key_invalidThe provided API key is invalid, revoked, or inactive.
403service_not_enabledThis API key is not scoped for the live execution service — enable it in the Console when creating or editing the key.
404not_foundThe subscription doesn't exist or doesn't belong to your account.
429rate_limit_exceededToo many requests for this account. Back off and retry.