Skip to main content
POST
/
backtest
Backtest a portfolio of companies
curl --request POST \
  --url https://api.noonum.ai/v2/backtest \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "holdings": [
    {
      "companyId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "weight": 0.5
    }
  ],
  "benchmark": "SPY",
  "years": 5
}
'
{
  "benchmarkMetadata": {
    "annualizedReturn": 0.1058,
    "maxDrawdown": -0.2385,
    "returns": 0.6512,
    "sharpeRatio": 0.74,
    "symbol": "SPY",
    "variance": 0.1423
  },
  "benchmarkTimeSeries": [
    [
      1594339200,
      10000
    ],
    [
      1594944000,
      10089.5
    ]
  ],
  "metadata": {
    "annualizedReturn": 0.1242,
    "maxDrawdown": -0.2747,
    "returns": 0.7955,
    "sharpeRatio": 0.76,
    "stockCount": 20,
    "variance": 0.1637,
    "warnings": [
      "<string>"
    ],
    "weekCount": 260
  },
  "timeSeries": [
    [
      1594339200,
      10000
    ],
    [
      1594944000,
      10156.8
    ]
  ]
}

Authorizations

Authorization
string
header
required

Enter 'Bearer' followed by a space and then your JWT or API Key. Example: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9... or Bearer YOUR_API_KEY_HERE

Body

application/json
holdings
object[]
required
benchmark
string
default:SPY

Benchmark symbol for comparison (e.g. SPY, QQQ)

years
integer
default:5
Required range: 1 <= x <= 20

Response

Backtest results

benchmarkMetadata
object

Performance statistics for the benchmark

benchmarkTimeSeries
number[][]

Benchmark price series rebased to 10000, aligned to portfolio dates

Example:
[[1594339200, 10000], [1594944000, 10089.5]]
metadata
object
timeSeries
number[][]
Example:
[[1594339200, 10000], [1594944000, 10156.8]]