Hi,
I have problem in capflatvolatilityvector class. I implementing it in .net and using C# 3.1 library by thiel.
I am getting InvalidCastException error : "Specified cast not vaid error"
I hav coded it in following form
*------------------------------------------------
int SettlementDays=2;
int swFixedLegFrequency = 1;
Thirty360US swFixedLegDayCounter = new Thirty360US();
London LN=new London();
DateTime todaysDate=System.DateTime.Today;
settlementDate= LN.Advance(todaysDate, SettlementDays, TimeUnit.Days);
ArrayList Periodstest=new ArrayList();
DoubleVector Periodsvol=new DoubleVector();
volperiod=new Period(1,TimeUnit.Years);
Periodstest.Insert(0,volperiod.Length);
volperiod=new Period(2,TimeUnit.Years);
Periodstest.Insert(1,volperiod.Length);
volperiod=new Period(3,TimeUnit.Years);
Periodstest.Insert(2,volperiod.Length);
volperiod=new Period(4,TimeUnit.Years);
Periodstest.Insert(3,volperiod.Length);
Periodsvol.Insert(0,20);
Periodsvol.Insert(1,30);
Periodsvol.Insert(2,40);
Periodsvol.Insert(3,50);
CapVol=new CapFlatVolatilityVector
(todaysDate,LN,SettlementDays,Periodstest,
Periodsvol,swFixedLegDayCounter);
I would appreciate your comments on the error above.
regards,
Vitthal