API Documentation
version - v1 beta

Post Methods

For flexible, fast, low cost queries


[post]

backtest

[post]

cointegration

[post]

copula

[post]

correlations

[post]

spread

[post]

zscores

Get Methods

Data done for you


[get]

backtest

[get]

cointegration

[get]

copula

[get]

correlations

[get]

credits used

[get]

prescanned

[get]

spread

[get]

zscores

API Route - zscores-post

/v1beta/zscores

https://api.cryptowizards.net/v1beta/zscores
Credits: 1

This is a method whereby you provide the api with any price data you wish for rapid turnaround and much lower credits used.


The Z-Score is simply the spread converted to having a mean of zero and standard deviation of 1. On the platform, we simply refer to this as the spread. This endpoint provides the latest number. For example, if the Z-Score is -2.0, a trader might decide to go long on symbol 2 and short on symbol 1 (i.e. going long on the spread).


The rolling Z-Score is the same calculation but on a rolling window bases.


Post Data

All price series must match in length


series_1_closes (required)
Include between 50 - 1100 floating point numbers
series_2_closes (required)
Include between 50 - 1100 floating point numbers
spread_type
Dynamic, Ou, Static - (default Dynamic)
roll_w
Rolling window for rolling zscore
with_history
true returns results with extra historical data

GitHub Code Examples

Request Body (Curl)

curl -X POST "https://api.cryptowizards.net/v1beta/zscores" \
  -H "Content-Type: application/json" \
  -H "X-api-key: REPLACE_WITH_YOUR_API_KEY" \
  -d '{
    "series_1_closes": [1.1, 1.2, 1.3, 1.4],
    "series_2_closes": [4.1, 4.2, 4.3, 4.4],
    "spread_type": "Static",
    "roll_w": 42,
    "with_history": false
  }'

Response

{
  "data": {
    "zscore": -1.8319234794643324, // latest (normalised spread)
    "zscore_roll": -1.0849313351490961 // latest
  },
  "history": null
}

Response (with History)

{
  "data": {
    "zscore": -1.8371637299593213, // latest (normalised spread)
    "zscore_roll": -1.0888243025746907 // latest
  },
  "history": {
    "spread": [
      0.040914855946655226,
      -0.012394409112054916,
      ...
    ],
    "zscore": [
      0.3800204829367012,
      0.8366369696671615,
      ...
    ],
    "zscore_roll": [
      0.0,
      ...,
      -0.32123719298235043,
    ],
    "hedge_ratio": 0.26065945362141013,
    "half_life": 9.665886757988284,
    "hurst": 1.3818318260575893,
    "sigma0crossings": 7,
    "sigma2crossings": 2,
    "log_used": true,
    "last_zscore": {
      "zscore": -1.8371637299593213,
      "zscore_roll": -1.0888243025746907
    }
  }
}