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 - spread-post

/v1beta/spread

https://api.cryptowizards.net/v1beta/spread
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.


Dynamic Spread: Provides a speread derived from a time-varying hedge ratio using a Kalman Filter.


OU Spread: Spread estimated using MLE on OU process


Static: Traditionally calculated spread using OLS


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/spread" \
  -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

{
  "spread": [],
  "zscore": [],
  "zscore_roll": [],
  "hedge_ratio": 0.26066950897792207,
  "half_life": 9.638801786487948,
  "hurst": 1.3818318260575893,
  "sigma0crossings": 7,
  "sigma2crossings": 2,
  "log_used": true,
  "last_zscore": {
    "zscore": -1.8292905507644137, // (normalised spread)
    "zscore_roll": -1.0829753075040158
  }
}

Response (with History)

{
  "spread": [
    0.040914855946655226,
    -0.13086802745059822,
    ...,
  ],
  "zscore": [
    0.3799574955314287,
    1.1514627231415435,
    ...
  ],
  "zscore_roll": [
    0.0,
    ...
    -2.8941234586460354,
  ],
  "hedge_ratio": 0.26066950897792207,
  "half_life": 9.638801786487948,
  "hurst": 1.3818318260575893,
  "sigma0crossings": 7,
  "sigma2crossings": 2,
  "log_used": true,
  "last_zscore": {
      "zscore": -1.8292905507644137,
      "zscore_roll": -1.0829753075040158
  }
}