public PortfolioRiskStatsViewDto(
     int portfolioId,
     RiskStatsViewDto riskStatsViewDto
     ) : base(
         riskStatsViewDto.ValueAtRisk90, riskStatsViewDto.ExpectedShortfall90,
         riskStatsViewDto.ValueAtRisk95, riskStatsViewDto.ExpectedShortfall95,
         riskStatsViewDto.ValueAtRisk99, riskStatsViewDto.ExpectedShortfall99
         )
 {
     PortfolioId = portfolioId;
 }
 public StockRiskStatsViewDto(
     int stockId, string stockName,
     RiskStatsViewDto riskStatsViewDto
     ) : base(
         riskStatsViewDto.ValueAtRisk90, riskStatsViewDto.ExpectedShortfall90,
         riskStatsViewDto.ValueAtRisk95, riskStatsViewDto.ExpectedShortfall95,
         riskStatsViewDto.ValueAtRisk99, riskStatsViewDto.ExpectedShortfall99
         )
 {
     StockId   = stockId;
     StockName = stockName;
 }
Exemplo n.º 3
0
        public static async Task <RiskStatsViewDto> GetAssetRiskStats(List <double> fullReturnSet)
        {
            ImmutableList <double> roReturnSet = fullReturnSet.ToImmutableList();

            (double var, double es)varAndEs90 = await Task.Run(() => GetVarAndEsAtConfidenceLvl(roReturnSet, 90));

            (double var, double es)varAndEs95 = await Task.Run(() => GetVarAndEsAtConfidenceLvl(roReturnSet, 95));

            (double var, double es)varAndEs99 = await Task.Run(() => GetVarAndEsAtConfidenceLvl(roReturnSet, 99));

            RiskStatsViewDto partialResult = new RiskStatsViewDto(
                varAndEs90.var, varAndEs90.es,
                varAndEs95.var, varAndEs95.es,
                varAndEs99.var, varAndEs99.es
                );

            return(partialResult);
        }