List backtest positions
GET https://rest.haasapi.com/v1/partner/backtests/{backtest_id}/positions
Every position the backtest opened, with entry/exit prices, size, realized profit and ROI. Available once the status is completed.
Requires the partner scope.
Example request
Section titled “Example request”curl "https://rest.haasapi.com/v1/partner/backtests/{backtest_id}/positions" \ -H "Authorization: Bearer hk_live_YOUR_KEY"Response
Section titled “Response”200 OK. Returns a PartnerBacktestPositions.
{ "data": [ { "position_id": "9a1de95cf1f0459b8b6a7d6a41f6c9d2", "direction": "long", "market_tag": "BINANCE_BTC_USDT", "is_closed": true, "opened_at": "2026-08-29T02:15:00Z", "closed_at": "2026-08-29T07:40:00Z", "amount": "0.00128", "average_price": "78011.42", "realized_profit": "1.83", "fee_costs": "0.2", "roi": "0.023", "profit_currency": "USDT" } ]}Fields
Section titled “Fields”PartnerBacktestPositions
Section titled “PartnerBacktestPositions”| Field | Type | Description |
|---|---|---|
data |
array of PartnerBacktestPosition |
PartnerBacktestPosition
Section titled “PartnerBacktestPosition”| Field | Type | Description |
|---|---|---|
position_id |
string | |
direction |
string | long or short. |
market_tag |
string, nullable | |
is_closed |
boolean | |
opened_at |
string, nullable | |
closed_at |
string, nullable | |
amount |
string (decimal) | |
average_price |
string (decimal) | |
realized_profit |
string (decimal) | |
fee_costs |
string (decimal) | |
roi |
string (decimal) | |
profit_currency |
string, nullable |
Errors
Section titled “Errors”All errors are RFC 9457 problem documents.
| Status | Description |
|---|---|
400 |
The request is malformed (invalid limit, unusable cursor, …). (code: invalid_request) |
401 |
Missing, malformed, disabled, or revoked API key. (code: invalid_api_key) |
404 |
No completed backtest with that id. (code: backtest_not_found) |
500 |
An unexpected error inside the API. Nothing about the request caused it; retry, and quote the instance value if it persists. (code: internal_error) |
502 |
An internal service answered in a way the API could not serve. Retry. (code: upstream_error) |
503 |
The request could not be served right now. Retry with the same key - do not discard it. (code: temporarily_unavailable) |
504 |
An internal service did not answer within the deadline. Retry with backoff. (code: upstream_timeout) |
{ "type": "https://docs.haasapi.com/errors/invalid_request", "title": "Invalid request", "status": 400, "detail": "The request is malformed (invalid limit, unusable cursor, …).", "code": "invalid_request"}