예제 #1
0
 public BachelierSpec()
 {
     type_ = VolatilityType.Normal;
 }
        public double impliedVolatility(double price, YieldTermStructureHandle disc, double guess, double accuracy, uint maxEvaluations, double minVol, double maxVol, VolatilityType type)
        {
            double ret = NQuantLibcPINVOKE.CapFloor_impliedVolatility__SWIG_1(swigCPtr, price, YieldTermStructureHandle.getCPtr(disc), guess, accuracy, maxEvaluations, minVol, maxVol, (int)type);

            if (NQuantLibcPINVOKE.SWIGPendingException.Pending)
            {
                throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
예제 #3
0
 public ConstantOptionletVolatility(uint settlementDays, Calendar cal, BusinessDayConvention bdc, double volatility, DayCounter dayCounter, VolatilityType type) : this(NQuantLibcPINVOKE.new_ConstantOptionletVolatility__SWIG_7(settlementDays, Calendar.getCPtr(cal), (int)bdc, volatility, DayCounter.getCPtr(dayCounter), (int)type), true)
 {
     if (NQuantLibcPINVOKE.SWIGPendingException.Pending)
     {
         throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
     }
 }
예제 #4
0
 public Black76Spec()
 {
     type_ = VolatilityType.ShiftedLognormal;
 }
예제 #5
0
 public LinearInterpolatedSmileSection(double expiryTime, DoubleVector strikes, DoubleVector stdDevs, double atmLevel, Linear interpolator, DayCounter dc, VolatilityType type) : this(NQuantLibcPINVOKE.new_LinearInterpolatedSmileSection__SWIG_6(expiryTime, DoubleVector.getCPtr(strikes), DoubleVector.getCPtr(stdDevs), atmLevel, Linear.getCPtr(interpolator), DayCounter.getCPtr(dc), (int)type), true)
 {
     if (NQuantLibcPINVOKE.SWIGPendingException.Pending)
     {
         throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
     }
 }
예제 #6
0
 public ConstantOptionletVolatility(Date referenceDate, Calendar cal, BusinessDayConvention bdc, QuoteHandle volatility, DayCounter dayCounter, VolatilityType type) : this(NQuantLibcPINVOKE.new_ConstantOptionletVolatility__SWIG_4(Date.getCPtr(referenceDate), Calendar.getCPtr(cal), (int)bdc, QuoteHandle.getCPtr(volatility), DayCounter.getCPtr(dayCounter), (int)type), true)
 {
     if (NQuantLibcPINVOKE.SWIGPendingException.Pending)
     {
         throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
     }
 }
 public SwaptionVolatilityMatrix(Date referenceDate, DateVector dates, PeriodVector lengths, Matrix vols, DayCounter dayCounter, bool flatExtrapolation, VolatilityType type, Matrix shifts) : this(NQuantLibcPINVOKE.new_SwaptionVolatilityMatrix__SWIG_12(Date.getCPtr(referenceDate), DateVector.getCPtr(dates), PeriodVector.getCPtr(lengths), Matrix.getCPtr(vols), DayCounter.getCPtr(dayCounter), flatExtrapolation, (int)type, Matrix.getCPtr(shifts)), true)
 {
     if (NQuantLibcPINVOKE.SWIGPendingException.Pending)
     {
         throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
     }
 }
예제 #8
0
파일: Order.cs 프로젝트: qusma/ib-csharp
        /// <summary>
        /// Default Constructor
        /// </summary>
        public Order()
        {
            openClose = "O";
            origin = OrderOrigin.Customer;
            transmit = true;
            tif = TimeInForce.Day;
            designatedLocation = "";
            minQty = int.MaxValue;
            percentOffset = double.MaxValue;
            nbboPriceCap = decimal.MaxValue;
            startingPrice = decimal.MaxValue;
            stockRefPrice = double.MaxValue;
            delta = double.MaxValue;
            stockRangeLower = double.MaxValue;
            stockRangeUpper = double.MaxValue;
            volatility = double.MaxValue;
            volatilityType = VolatilityType.Undefined;
            deltaNeutralOrderType = OrderType.Empty;
            deltaNeutralAuxPrice = double.MaxValue;
            referencePriceType = int.MaxValue;
            trailStopPrice = decimal.MaxValue;
            basisPoints = decimal.MaxValue;
            basisPointsType = int.MaxValue;
            scaleInitLevelSize = int.MaxValue;
            scaleSubsLevelSize = int.MaxValue;
            scalePriceIncrement = decimal.MaxValue;
            faMethod = FinancialAdvisorAllocationMethod.None;
            notHeld = false;
            exemptCode = -1;

            optOutSmartRouting = false;
            deltaNeutralConId = 0;
            deltaNeutralOrderType = OrderType.Empty;
            deltaNeutralSettlingFirm = string.Empty;
            deltaNeutralClearingAccount = string.Empty;
            deltaNeutralClearingIntent = string.Empty;

            DeltaNeutralOpenClose = "";
            DeltaNeutralShortSale = false;
            DeltaNeutralShortSaleSlot = 0;
            DeltaNeutralDesignatedLocation = "";
            referencePriceType = int.MaxValue;
            trailStopPrice = decimal.MaxValue;
            TrailingPercent = double.MaxValue;
            BasisPoints = decimal.MaxValue;
            basisPointsType = int.MaxValue;
            scaleInitLevelSize = int.MaxValue;
            scaleSubsLevelSize = int.MaxValue;
            scalePriceIncrement = decimal.MaxValue;
            ScalePriceAdjustValue = double.MaxValue;
            ScalePriceAdjustInterval = int.MaxValue;
            ScaleProfitOffset = double.MaxValue;
            ScaleAutoReset = false;
            ScaleInitPosition = int.MaxValue;
            ScaleInitFillQty = int.MaxValue;
            ScaleRandomPercent = false;
            ScaleTable = "";
            whatIf = false;
            notHeld = false;
            Conditions = new List<OrderCondition>();
            TriggerPrice = double.MaxValue;
            LmtPriceOffset = double.MaxValue;
            AdjustedStopPrice = double.MaxValue;
            AdjustedStopLimitPrice = double.MaxValue;
            AdjustedTrailingAmount = double.MaxValue;
            ExtOperator = "";
        }
예제 #9
0
        public SabrSmileSection(Date d, double forward, List <double> sabrParams, DayCounter dc = null, VolatilityType volatilityType = VolatilityType.ShiftedLognormal, double shift = 0.0)
            : base(d, dc ?? new Actual365Fixed(), null, volatilityType, shift)
        {
            forward_        = forward;
            shift_          = shift;
            volatilityType_ = volatilityType;

            alpha_ = sabrParams[0];
            beta_  = sabrParams[1];
            nu_    = sabrParams[2];
            rho_   = sabrParams[3];

            Utils.QL_REQUIRE(volatilityType == VolatilityType.Normal || forward_ + shift_ > 0.0, () => "at the money forward rate +shift must be: " + forward_ + shift_ + " not allowed");
            Utils.validateSabrParameters(alpha_, beta_, nu_, rho_);
        }
예제 #10
0
 public OptionletStripper1(CapFloorTermVolSurface parVolSurface, IborIndex index, double switchStrikes, double accuracy, uint maxIter, YieldTermStructureHandle discount, VolatilityType type) : this(NQuantLibcPINVOKE.new_OptionletStripper1__SWIG_2(CapFloorTermVolSurface.getCPtr(parVolSurface), IborIndex.getCPtr(index), switchStrikes, accuracy, maxIter, YieldTermStructureHandle.getCPtr(discount), (int)type), true)
 {
     if (NQuantLibcPINVOKE.SWIGPendingException.Pending)
     {
         throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
     }
 }
 public ConstantSwaptionVolatility(uint settlementDays, Calendar cal, BusinessDayConvention bdc, QuoteHandle volatility, DayCounter dc, VolatilityType type) : this(NQuantLibcPINVOKE.new_ConstantSwaptionVolatility__SWIG_1(settlementDays, Calendar.getCPtr(cal), (int)bdc, QuoteHandle.getCPtr(volatility), DayCounter.getCPtr(dc), (int)type), true)
 {
     if (NQuantLibcPINVOKE.SWIGPendingException.Pending)
     {
         throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
     }
 }
 public ConstantSwaptionVolatility(Date referenceDate, Calendar cal, BusinessDayConvention bdc, double volatility, DayCounter dc, VolatilityType type) : this(NQuantLibcPINVOKE.new_ConstantSwaptionVolatility__SWIG_10(Date.getCPtr(referenceDate), Calendar.getCPtr(cal), (int)bdc, volatility, DayCounter.getCPtr(dc), (int)type), true)
 {
     if (NQuantLibcPINVOKE.SWIGPendingException.Pending)
     {
         throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
     }
 }
예제 #13
0
        /// <summary>
        /// Default Constructor
        /// </summary>
        public Order()
        {
            openClose             = "O";
            origin                = OrderOrigin.Customer;
            transmit              = true;
            tif                   = TimeInForce.Day;
            designatedLocation    = "";
            minQty                = int.MaxValue;
            percentOffset         = double.MaxValue;
            nbboPriceCap          = decimal.MaxValue;
            startingPrice         = decimal.MaxValue;
            stockRefPrice         = double.MaxValue;
            delta                 = double.MaxValue;
            stockRangeLower       = double.MaxValue;
            stockRangeUpper       = double.MaxValue;
            volatility            = double.MaxValue;
            volatilityType        = VolatilityType.Undefined;
            deltaNeutralOrderType = OrderType.Empty;
            deltaNeutralAuxPrice  = double.MaxValue;
            referencePriceType    = int.MaxValue;
            trailStopPrice        = decimal.MaxValue;
            basisPoints           = decimal.MaxValue;
            basisPointsType       = int.MaxValue;
            scaleInitLevelSize    = int.MaxValue;
            scaleSubsLevelSize    = int.MaxValue;
            scalePriceIncrement   = decimal.MaxValue;
            faMethod              = FinancialAdvisorAllocationMethod.None;
            notHeld               = false;
            exemptCode            = -1;

            optOutSmartRouting          = false;
            deltaNeutralConId           = 0;
            deltaNeutralOrderType       = OrderType.Empty;
            deltaNeutralSettlingFirm    = string.Empty;
            deltaNeutralClearingAccount = string.Empty;
            deltaNeutralClearingIntent  = string.Empty;

            DeltaNeutralOpenClose          = "";
            DeltaNeutralShortSale          = false;
            DeltaNeutralShortSaleSlot      = 0;
            DeltaNeutralDesignatedLocation = "";
            referencePriceType             = int.MaxValue;
            trailStopPrice           = decimal.MaxValue;
            TrailingPercent          = double.MaxValue;
            BasisPoints              = decimal.MaxValue;
            basisPointsType          = int.MaxValue;
            scaleInitLevelSize       = int.MaxValue;
            scaleSubsLevelSize       = int.MaxValue;
            scalePriceIncrement      = decimal.MaxValue;
            ScalePriceAdjustValue    = double.MaxValue;
            ScalePriceAdjustInterval = int.MaxValue;
            ScaleProfitOffset        = double.MaxValue;
            ScaleAutoReset           = false;
            ScaleInitPosition        = int.MaxValue;
            ScaleInitFillQty         = int.MaxValue;
            ScaleRandomPercent       = false;
            ScaleTable             = "";
            whatIf                 = false;
            notHeld                = false;
            Conditions             = new List <OrderCondition>();
            TriggerPrice           = double.MaxValue;
            LmtPriceOffset         = double.MaxValue;
            AdjustedStopPrice      = double.MaxValue;
            AdjustedStopLimitPrice = double.MaxValue;
            AdjustedTrailingAmount = double.MaxValue;
            ExtOperator            = "";
        }
 public MonotonicCubicInterpolatedSmileSection(Date d, DoubleVector strikes, DoubleVector stdDevs, double atmLevel, DayCounter dc, MonotonicCubic interpolator, Date referenceDate, VolatilityType type) : this(NQuantLibcPINVOKE.new_MonotonicCubicInterpolatedSmileSection__SWIG_17(Date.getCPtr(d), DoubleVector.getCPtr(strikes), DoubleVector.getCPtr(stdDevs), atmLevel, DayCounter.getCPtr(dc), MonotonicCubic.getCPtr(interpolator), Date.getCPtr(referenceDate), (int)type), true)
 {
     if (NQuantLibcPINVOKE.SWIGPendingException.Pending)
     {
         throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
     }
 }
 public SwaptionVolatilityMatrix(Date referenceDate, Calendar calendar, BusinessDayConvention bdc, DateVector dates, PeriodVector lengths, Matrix vols, DayCounter dayCounter, bool flatExtrapolation, VolatilityType type) : this(NQuantLibcPINVOKE.new_SwaptionVolatilityMatrix__SWIG_1(Date.getCPtr(referenceDate), Calendar.getCPtr(calendar), (int)bdc, DateVector.getCPtr(dates), PeriodVector.getCPtr(lengths), Matrix.getCPtr(vols), DayCounter.getCPtr(dayCounter), flatExtrapolation, (int)type), true)
 {
     if (NQuantLibcPINVOKE.SWIGPendingException.Pending)
     {
         throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
     }
 }
 public MonotonicCubicInterpolatedSmileSection(double expiryTime, DoubleVector strikes, QuoteHandleVector stdDevHandles, QuoteHandle atmLevel, MonotonicCubic interpolator, DayCounter dc, VolatilityType type) : this(NQuantLibcPINVOKE.new_MonotonicCubicInterpolatedSmileSection__SWIG_1(expiryTime, DoubleVector.getCPtr(strikes), QuoteHandleVector.getCPtr(stdDevHandles), QuoteHandle.getCPtr(atmLevel), MonotonicCubic.getCPtr(interpolator), DayCounter.getCPtr(dc), (int)type), true)
 {
     if (NQuantLibcPINVOKE.SWIGPendingException.Pending)
     {
         throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
     }
 }
 public SwaptionVolatilityMatrix(Calendar calendar, BusinessDayConvention bdc, PeriodVector optionTenors, PeriodVector swapTenors, QuoteHandleVectorVector vols, DayCounter dayCounter, bool flatExtrapolation, VolatilityType type) : this(NQuantLibcPINVOKE.new_SwaptionVolatilityMatrix__SWIG_5(Calendar.getCPtr(calendar), (int)bdc, PeriodVector.getCPtr(optionTenors), PeriodVector.getCPtr(swapTenors), QuoteHandleVectorVector.getCPtr(vols), DayCounter.getCPtr(dayCounter), flatExtrapolation, (int)type), true)
 {
     if (NQuantLibcPINVOKE.SWIGPendingException.Pending)
     {
         throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
     }
 }
예제 #18
0
 /// <summary>
 /// Default Constructor
 /// </summary>
 public Order()
 {
     openClose = "O";
     origin = OrderOrigin.Customer;
     transmit = true;
     tif = TimeInForce.Day;
     designatedLocation = "";
     minQty = Int32.MaxValue;
     percentOffset = Double.MaxValue;
     nbboPriceCap = decimal.MaxValue;
     startingPrice = decimal.MaxValue;
     stockRefPrice = Double.MaxValue;
     delta = Double.MaxValue;
     stockRangeLower = Double.MaxValue;
     stockRangeUpper = Double.MaxValue;
     volatility = Double.MaxValue;
     volatilityType = VolatilityType.Undefined;
     deltaNeutralOrderType = OrderType.Empty;
     deltaNeutralAuxPrice = Double.MaxValue;
     referencePriceType = Int32.MaxValue;
     trailStopPrice = decimal.MaxValue;
     basisPoints = decimal.MaxValue;
     basisPointsType = Int32.MaxValue;
     scaleInitLevelSize = Int32.MaxValue;
     scaleSubsLevelSize = Int32.MaxValue;
     scalePriceIncrement = decimal.MaxValue;
     faMethod = FinancialAdvisorAllocationMethod.None;
     notHeld = false;
     exemptCode = -1;
     
     optOutSmartRouting = false;
     deltaNeutralConId = 0;
     deltaNeutralOrderType = OrderType.Empty;
     deltaNeutralSettlingFirm = string.Empty;
     deltaNeutralClearingAccount = string.Empty;
     deltaNeutralClearingIntent = string.Empty;
 }
예제 #19
0
 public LinearInterpolatedSmileSection(Date d, DoubleVector strikes, DoubleVector stdDevs, double atmLevel, DayCounter dc, Linear interpolator, Date referenceDate, VolatilityType type, double shift) : this(NQuantLibcPINVOKE.new_LinearInterpolatedSmileSection__SWIG_16(Date.getCPtr(d), DoubleVector.getCPtr(strikes), DoubleVector.getCPtr(stdDevs), atmLevel, DayCounter.getCPtr(dc), Linear.getCPtr(interpolator), Date.getCPtr(referenceDate), (int)type, shift), true)
 {
     if (NQuantLibcPINVOKE.SWIGPendingException.Pending)
     {
         throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
     }
 }