Beispiel #1
0
        private double QOFSwpn()
        {
            double total = 0;

            foreach (int t in _param.SwaptionExpiries)
            {
                if (t > _param.UnderlyingExpiry - 1)
                {
                    break;
                }
                foreach (var t1 in _param.SwaptionTenors)
                {
                    if (t + t1 > _param.UnderlyingTenor - 1)
                    {
                        break;
                    }
                    double tempImpliedVolatility = _economy.ReturnImpliedVolatility(t, t1);
                    if (!(tempImpliedVolatility > 0))
                    {
                        continue;
                    }
                    double temp = Math.Log(_economy.FindImpliedVolatility(t, t1) /
                                           tempImpliedVolatility);
                    total += temp * temp;
                }
            }
            total = total * _sFactor;
            return(total);
        }