Esempio n. 1
0
        public Dictionary <string, IVolSurface> GetRegaScenariosOuterWing(double bumpSize, DateTime?LastSensitivityDate)
        {
            var o = new Dictionary <string, IVolSurface>();

            var lastExpiry     = LastIx(LastSensitivityDate);
            var highDeltaFirst = WingDeltas.First() > WingDeltas.Last();
            var outerWingIx    = WingDeltas.Length - 1;

            for (var i = 0; i < lastExpiry; i++)
            {
                var volsBumped = (double[][])Riskies.Clone();

                if (highDeltaFirst)
                {
                    volsBumped[i][outerWingIx] += bumpSize;
                }
                else
                {
                    volsBumped[i][0] += bumpSize;
                }

                o.Add(PillarLabels[i], new RiskyFlySurface(OriginDate, ATMs, Expiries, WingDeltas, volsBumped, Flies, Forwards, WingQuoteType, AtmVolType, StrikeInterpolatorType, TimeInterpolatorType, PillarLabels));
            }

            return(o);
        }
Esempio n. 2
0
        public Dictionary <string, IVolSurface> GetRegaScenarios(double bumpSize, DateTime?LastSensitivityDate)
        {
            var o = new Dictionary <string, IVolSurface>();

            var lastExpiry     = LastIx(LastSensitivityDate);
            var highDeltaFirst = WingDeltas.First() > WingDeltas.Last();

            for (var i = 0; i < lastExpiry; i++)
            {
                var volsBumped = (double[][])Riskies.Clone();
                if (highDeltaFirst)
                {
                    var ratios = volsBumped[i].Select(x => x / volsBumped[i][0]).ToArray();
                    volsBumped[i] = ratios.Select(r => (volsBumped[i][0] + bumpSize) * r).ToArray();
                }
                else
                {
                    var ratios = volsBumped[i].Select(x => x / volsBumped[i].Last()).ToArray();
                    volsBumped[i] = ratios.Select(r => (volsBumped[i].Last() + bumpSize) * r).ToArray();
                }

                o.Add(PillarLabels[i], new RiskyFlySurface(OriginDate, ATMs, Expiries, WingDeltas, volsBumped, Flies, Forwards, WingQuoteType, AtmVolType, StrikeInterpolatorType, TimeInterpolatorType, PillarLabels));
            }

            return(o);
        }