diff --git a/src/lib/components/VaR.svelte b/src/lib/components/VaR.svelte index 017d14da..0e40564c 100644 --- a/src/lib/components/VaR.svelte +++ b/src/lib/components/VaR.svelte @@ -21,7 +21,7 @@ export let data; let valueAtRisk; let varDict = {} let optionsData; - + let monthlyVarAvg; function getPlotOptions() { let dates = []; @@ -33,6 +33,12 @@ function getPlotOptions() { varList?.push(item?.var); }); + const sum = varList.reduce((accumulator, currentValue) => { + return accumulator + currentValue; + }, 0); + + monthlyVarAvg = (sum / varList?.length)?.toFixed(2); + const option = { silent: true, @@ -213,7 +219,13 @@ function getPlotOptions() { - +

+ Historical VaR +

+
+ Based on historical price data, the company experienced an average monthly Value at Risk (VaR) of {monthlyVarAvg}%. +
+