Пример #1
0
        public double atmStrike(DeltaVolQuote.AtmType atmT)
        {
            double ret = NQuantLibcPINVOKE.BlackDeltaCalculator_atmStrike(swigCPtr, (int)atmT);

            if (NQuantLibcPINVOKE.SWIGPendingException.Pending)
            {
                throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
Пример #2
0
        // The following function can be calculated without an explicit strike
        public double atmStrike(DeltaVolQuote.AtmType atmT)
        {
            double res = 0.0;

            switch (atmT)
            {
            case DeltaVolQuote.AtmType.AtmDeltaNeutral:
                if (dt_ == DeltaVolQuote.DeltaType.Spot || dt_ == DeltaVolQuote.DeltaType.Fwd)
                {
                    res = fExpPos_;
                }
                else
                {
                    res = fExpNeg_;
                }
                break;

            case DeltaVolQuote.AtmType.AtmFwd:
                res = forward_;
                break;

            case DeltaVolQuote.AtmType.AtmGammaMax:
            case DeltaVolQuote.AtmType.AtmVegaMax:
                res = fExpPos_;
                break;

            case DeltaVolQuote.AtmType.AtmPutCall50:
                Utils.QL_REQUIRE(dt_ == DeltaVolQuote.DeltaType.Fwd, () =>
                                 "|PutDelta|=CallDelta=0.50 only possible for forward delta.");
                res = fExpPos_;
                break;

            default:
                Utils.QL_FAIL("invalid atm type");
                break;
            }

            return(res);
        }
Пример #3
0
 public DeltaVolQuote(QuoteHandle vol, DeltaVolQuote.DeltaType deltaType, double maturity, DeltaVolQuote.AtmType atmType) : this(NQuantLibcPINVOKE.new_DeltaVolQuote__SWIG_1(QuoteHandle.getCPtr(vol), (int)deltaType, maturity, (int)atmType), true)
 {
     if (NQuantLibcPINVOKE.SWIGPendingException.Pending)
     {
         throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
     }
 }