← Back to API Ninjas
GET/v1/currencyvolatilityforecast

EWMA and GARCH(1,1) volatility forecasts for a currency pair.

Projects forward volatility for a currency `pair` over a `horizon`, using EWMA or a comparable `method`. For realised values instead use /currencyvolatility.

API Ninjas·$0.001 per call

Example code

// Using @orth/sdk - The simplest way to call APIs // Install: npm install @orth/sdk import Orthogonal from "@orth/sdk"; const orthogonal = new Orthogonal({ apiKey: process.env.ORTHOGONAL_API_KEY, }); const output = await orthogonal.run({ api: "api-ninjas", path: "/v1/currencyvolatilityforecast", query: { "pair": "example" } }); console.log(output);

Query parameters

pairrequired
string

Currency pair in ABC_DEF form (e.g. EUR_USD). Both must be supported fiat currency codes; ZWG, BTC, and XAG are not supported.

method
string

Forecast method: garch_11 (default) or ewma. If a GARCH fit does not converge the response falls back to EWMA. (Allowed: garch_11, ewma) (Default: garch_11)

lambda
number

EWMA decay factor (only used when method=ewma). Defaults to 0.94. Must be between 0.80 and 0.99. (Default: 0.94)

horizon
string

Comma-separated forecast horizons in trading days (e.g. 1,5,21,63). Defaults to 1,5,21,63. (Default: 1,5,21,63)

day_count
number

Annualization factor: 252 trading days (default) or 365 calendar days. (Allowed: 252, 365) (Default: 252)

    Orthogonal - Giving AI agents the tools they need.