Beispiel #1
0
 public void Initialisation()
 {
     _handle     = "SABR Calibration Settings Unit Test";
     _instrument = InstrumentType.Instrument.Swaption;
     _currency   = "AUD";
     _beta       = 0.85m;
 }
 /// <summary>
 /// Constructor for the  class <see cref="SABRCalibrationSettings"/>.
 /// </summary>
 /// <param name="handle">Name that identifies the SABR calibration
 ///  settings object.</param>
 /// <param name="instrument">The instrument type, for example
 /// Swaption.</param>
 /// <param name="currency">Currency as a three letter code.</param>
 /// <param name="beta">The value of the SABR parameter beta.
 /// Beta must be in the range [0.0, 1.0].</param>
 public SABRCalibrationSettings(string handle,
                                InstrumentType.Instrument instrument,
                                string currency,
                                decimal beta)
 {
     // Initialise all fields, other than the SABR parameter beta.
     Handle     = handle;
     Instrument = instrument;
     Currency   = currency;
     // Initialise the SABR parameter beta.
     InitialiseBeta(beta);
 }
 /// <summary>
 /// Constructor for the class <see cref="TwoDimensionalKey"/>.
 /// </summary>
 /// <param name="firstKeyPart">The first part of the key.</param>
 /// <param name="secondKeyPart">The second part of the key.</param>
 public TwoDimensionalKey(InstrumentType.Instrument firstKeyPart,
                          string secondKeyPart)
 {
     FirstKeyPart  = firstKeyPart;
     SecondKeyPart = secondKeyPart;
 }
Beispiel #4
0
        //
        // Use TestInitialize to run code before running each test
        // [TestInitialize()]
        // public void MyTestInitialize() { }
        //
        // Use TestCleanup to run code after each test has run
        // [TestCleanup()]
        // public void MyTestCleanup() { }
        //
        #endregion

        #region Setup

        public void Initialisation()
        {
            // Initialise the SABR calibration settings object.
            _settingsHandle = "SABR Calibration Engine Unit Test.";
            _currency       = "AUD";
            _instrument     = InstrumentType.Instrument.CallPut;
            _beta           = 0.85m;
            //_calibrationError = 0.0m;
            _calibrationSettings = new SABRCalibrationSettings(_settingsHandle,
                                                               _instrument,
                                                               _currency,
                                                               _beta);

            // Initialise  the SABR calibration engine object.
            _assetPrice   = 1350.00m;
            _engineHandle = _settingsHandle;
            _exerciseTime = 5.0m;

            decimal[] tempStrikes = { 1242.00m,
                                      1269.00m,
                                      1283.00m,
                                      1296.00m,
                                      1323.00m,
                                      1350.00m,
                                      1377.00m,
                                      1404.00m,
                                      1418.00m,
                                      1431.00m,
                                      1458.00m,
                                      1485.00m,
                                      1519.00m };

            _strikes = new List <decimal>();
            foreach (decimal strike in tempStrikes)
            {
                _strikes.Add(strike);
            }

            decimal[] tempVolatilities =
            { 0.3108m,
              0.3012m,
              0.2966m,
              0.2925m,
              0.2847m,
              0.2784m,
              0.2738m,
              0.2709m,
              0.2700m,
              0.2696m,
              0.2697m,
              0.2710m,
              0.2744m };

            _volatilities = new List <decimal>();
            foreach (decimal volatility in tempVolatilities)
            {
                _volatilities.Add(volatility);
            }

            _calibrationEngine = new SABRCalibrationEngine(_engineHandle,
                                                           _calibrationSettings,
                                                           _strikes,
                                                           _volatilities,
                                                           _assetPrice,
                                                           _exerciseTime);

            // Initialise the collection of SABR calibration engine objects.
            //_engineHandles = null;
        }
Beispiel #5
0
 public void Initialization()
 {
     _first  = InstrumentType.Instrument.Swaption;
     _second = "USD";
 }