// ************************************************************ // CONSTRUCTORS // ************************************************************ #region // Constructor 1 : From given date, no data //public EquityIndexOption(DateTime pricingDate) : base(pricingDate: pricingDate) { } // Constructor 2: For given date & Markit Volatility surface public EquityIndexOption(DateTime pricingDate, DateTime strikeDate, DateTime forwardStartDate, DateTime expiryDate, Double strikeLevel, MarkitSurface surfaceObject) : base(pricingDate: pricingDate, strikeDate: strikeDate, forwardStartDate: forwardStartDate, expiryDate: expiryDate, strikeLevel: strikeLevel, surfaceObject: surfaceObject) { }
// ************************************************************ // CONSTRUCTORS // ************************************************************ #region // Constructor 1 : Generic // public BaseIndexOption() { } // Constructor 2 : From given date // spublic BaseIndexOption(DateTime pricingDate) { } // Constructor 3 : From a Markit volatility surface public BaseIndexOption(DateTime pricingDate, DateTime strikeDate, DateTime forwardStartDate, DateTime expiryDate, Double strikeLevel, MarkitSurface surfaceObject) { // Dates this.pricingDate = pricingDate; this.strikeDate = strikeDate; this.expiryDate = expiryDate; this.forwardStartDate = forwardStartDate; // Strikes this.strikeLevel = strikeLevel; // Volatility this.impliedVolatilitySurface = surfaceObject; }
// ************************************************************ // INDEXER METHODS // ************************************************************ #region public MarkitSurface this[DateTime i] { get { if (!readerData.ContainsKey(i)) { readerData[i] = new MarkitSurface(i); } return(readerData[i]); } protected set { readerData[i] = value; } }
private void Parse_OldFormat(List <string> line) { DateTime thisPricingDate = this.ParseDate(line[1]); MarkitSurface thisSurface = this[thisPricingDate]; thisSurface.SetName(line[3]); thisSurface.SetImpliedSpot(line[9]); thisSurface.SetReferenceLevel(line[6]); DateTime thisForwardDate = this.ParseDate(line[7]); thisSurface.SetForward(thisPricingDate, thisForwardDate, line[11]); thisSurface.SetDiscountFactor(thisPricingDate, thisForwardDate, line[12]); //thisSurface.SetDividend(thisPricingDate, thisForwardDate, line[xyz]); thisSurface.SetVolatility(thisPricingDate, thisForwardDate, line[8], line[10]); }