update VaR component
This commit is contained in:
parent
8c66968b25
commit
f58b8ad5aa
@ -21,7 +21,7 @@ export let data;
|
|||||||
let valueAtRisk;
|
let valueAtRisk;
|
||||||
let varDict = {}
|
let varDict = {}
|
||||||
let optionsData;
|
let optionsData;
|
||||||
|
let monthlyVarAvg;
|
||||||
|
|
||||||
function getPlotOptions() {
|
function getPlotOptions() {
|
||||||
let dates = [];
|
let dates = [];
|
||||||
@ -33,6 +33,12 @@ function getPlotOptions() {
|
|||||||
varList?.push(item?.var);
|
varList?.push(item?.var);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const sum = varList.reduce((accumulator, currentValue) => {
|
||||||
|
return accumulator + currentValue;
|
||||||
|
}, 0);
|
||||||
|
|
||||||
|
monthlyVarAvg = (sum / varList?.length)?.toFixed(2);
|
||||||
|
|
||||||
|
|
||||||
const option = {
|
const option = {
|
||||||
silent: true,
|
silent: true,
|
||||||
@ -213,7 +219,13 @@ function getPlotOptions() {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<h2 class="text-white text-xl sm:text-2xl font-semibold mt-5">
|
||||||
|
Historical VaR
|
||||||
|
</h2>
|
||||||
|
<div class="text-white text-[1rem] mt-3">
|
||||||
|
Based on historical price data, the company experienced an average monthly Value at Risk (VaR) of {monthlyVarAvg}%.
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="app w-full h-[300px] mt-5">
|
<div class="app w-full h-[300px] mt-5">
|
||||||
<Chart {init} options={optionsData} class="chart" />
|
<Chart {init} options={optionsData} class="chart" />
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user