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.
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
Currency pair in ABC_DEF form (e.g. EUR_USD). Both must be supported fiat currency codes; ZWG, BTC, and XAG are not supported.
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)
EWMA decay factor (only used when method=ewma). Defaults to 0.94. Must be between 0.80 and 0.99. (Default: 0.94)
Comma-separated forecast horizons in trading days (e.g. 1,5,21,63). Defaults to 1,5,21,63. (Default: 1,5,21,63)
Annualization factor: 252 trading days (default) or 365 calendar days. (Allowed: 252, 365) (Default: 252)