FAQ

Frequently asked questions about the API, strategy system, execution model, pricing, and roadmap.

API & Authentication

Where do I generate my API key?

In the Console at console.emidlabs.com, navigate to "API Keys" and click "Generate New Key". The key is shown only once — store it securely.

How do I pass the API key in requests?

Include it in the x-api-key header: x-api-key: em_YOUR_KEY. There are no other authentication methods.

Can I have multiple API keys?

Yes. You can generate multiple keys per account and label them by project or environment.

Is there a rate limit?

Yes. Rate limits depend on your plan. If you exceed them, the API returns a 429 status. Back off and retry with exponential backoff.

Strategy System

What is strategySnapshotJson?

It is your strategy object serialized as a JSON string. You build the strategy as a JavaScript/Python object, then call JSON.stringify() or json.dumps() on it before including it in the request body.

Can I use YAML for strategies?

No. The API only accepts JSON. YAML may appear in older documentation or internal tooling, but the API contract is JSON.

Can inputs reference other inputs?

Yes, as long as there are no circular references. An input can reference any input defined before it in the inputs block.

What happens if a condition references an undefined input?

The API returns a 400 error with code invalid_strategy and a message identifying the undefined variable.

Can I use multiple conditions in the decision block?

Yes. The decision entry expression can reference score and any defined condition by name, combined with AND/OR operators.

Execution & Results

What does "entry on close" mean exactly?

When the decision rule evaluates to true on candle N, the trade is entered at the closing price of candle N — not the open of the next candle.

Why are results in R-units and not dollars?

R-units represent units of risk, not currency. This makes results portable: the same R result applies regardless of account size or position sizing. It also keeps the focus on statistical edge rather than absolute profit.

What is avgLossR always -1.0?

The fixed risk model sets the stop-loss at exactly 1% from entry, which equals -1R. All losses are exactly -1R by design.

Can a strategy go short?

Not in the current version. Only long (buy) entries are supported. Short selling is planned for a future release.

How is bothHit handled?

If both stop-loss and take-profit levels are reached within the same candle (using the high and low), the engine conservatively assumes the stop-loss triggered first. This is the worst-case assumption.

Pricing & Credits

What are credits?

Credits are the unit of infrastructure consumption. Each backtest consumes credits proportional to the number of candles processed (determined by asset pair, timeframe, and date range).

How do I estimate credits before running a backtest?

The Console shows an estimated credit consumption before submission, based on the asset pair, timeframe, and date range. Detailed consumption tables are available in the pricing documentation.

What happens if I run out of credits?

The API returns a 402 insufficient_credits error. The backtest is not executed. You can purchase more credits in the Console.

Do credits expire?

Monthly subscription credits reset each billing cycle. One-time credit top-ups do not expire.

Data & Limitations

Where does the market data come from?

All historical data is sourced from Coinbase. OHLCV data is stored server-side — you do not need to download or manage it.

Are trading fees included in backtest results?

No. The backtest engine does not simulate fees or slippage. Results represent raw edge assuming perfect execution at the specified prices.

Can I run a backtest on stocks or futures?

Not yet. Currently only cryptocurrency pairs on Coinbase are supported. Additional markets are planned in the roadmap.

Still have questions?

If your question is not answered here, you can reach the team through the Console support channel or community forum.

💡
For technical issues with the API (unexpected errors, incorrect results), include the backtest id in your support request. This allows the team to inspect the specific execution.