Esempio n. 1
0
        public void AddVolParameter(VolParam newVolparam)
        {
            using (var db = new DevDbContext())
            {
                db.VolParam.Add(newVolparam);
                db.SaveChanges();
            }

            log.Info($"Add New Vol product: {newVolparam.Product} price: {newVolparam.MaturityDate}");
        }
Esempio n. 2
0
        public void UpdateVolParams(VolParam updatedParam)
        {
            using (var db = new DevDbContext())
            {
                VolParam param = db.VolParam.First(i => i.MaturityDate == updatedParam.MaturityDate && i.ProductId == updatedParam.ProductId);
                param.A     = updatedParam.A;
                param.B     = updatedParam.B;
                param.Sigma = updatedParam.Sigma;
                param.Rho   = updatedParam.Rho;
                param.M     = updatedParam.M;
                db.SaveChanges();
            }

            log.Info($"Volatility parameters updated for maturity: {updatedParam.MaturityDate} product: {updatedParam.ProductId}");
            log.Info($"New parameters:  A={updatedParam.A} B={updatedParam.B} Sigma={updatedParam.Sigma} Rho={updatedParam.Rho} M={updatedParam.M}");
        }