Skip to content

Tracking Error


Tracking error is the divergence between the price behavior of a position or a portfolio and the price behavior of a benchmark. This is often in the context of a hedge fund, mutual fund, or exchange-traded fund (ETF) that did not work as effectively as intended, creating an unexpected profit or loss.

HTTP Request

POST /calculations/marginal_tracking_error

HTTP Parameters

Parameter Description
portfolio1 string REQUIRED The portfolio to be analyzed.
portfolio2 string REQUIRED The portfolio used as a benchmark to calculate deviations or differences.
weekly boolean optional, default is True If True, the Calculation API uses weekly returns to calculate the tracking error.
EWMA boolean optional, default is False If True, the exponentially weighted moving average will be applied to volatilities.
exponential_decay float optional, default is 0.94 Weighting factor that determines the rate at which older data enters the EWMA calculation. Accepts float values from 0 to 1. Only used when EWMA is True.
nDays integer optional, default is 252 Number of historical business days used in the calculation when weekly is False.
nWeeks integer optional, default is 200 Number of historical weeks used in the calculation when weekly is True.

To calculate the tracking errors, run the following:

curl https://api.everysk.com/v2/calculations/marginal_tracking_error \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <ACCESS_TOKEN>" \
  -d '{
          "securities1": [
            {
              "id": "id1",
              "symbol": "AAPL",
              "quantity": 1000.0
            },
            {
              "id": "id2",
              "symbol": "MSFT",
              "quantity": 500.0
            }
          ],
          "securities2": [
            {
              "id": "id3",
              "symbol": "SPY",
              "quantity": 1000.0
            }
          ],
          "weekly": false
      }' \
  -X POST

The above call returns the following JSON object:

{
  "marginal_tracking_error": {
    "unmapped_tickers": [],
    "results": {
      "mcte": {
        "id1": 0.005884471459323663,
        "id2": 0.006365037307355700
      },
      "te": 0.008751094213396014,
      "corr": 0.8394975109763287
    }
  }
}