public class CSVSwaptionParser extends Object
SwaptionDataLattice
from csv files.Constructor and Description |
---|
CSVSwaptionParser(SchedulePrototype fixMetaSchedule,
SchedulePrototype floatMetaSchedule)
Create the parser with no filter on the maturities and tenors.
|
CSVSwaptionParser(String[] maturities,
String[] tenors,
SchedulePrototype fixMetaSchedule,
SchedulePrototype floatMetaSchedule)
Create the parser with filter on maturities and tenors.
|
Modifier and Type | Method and Description |
---|---|
static LocalDate[] |
getReferenceDates(SwaptionDataLattice[] lattices)
Extract the reference date of each SwaptionDataLattice in an array.
|
SwaptionDataLattice |
parseCSV(File atmFile,
File otmFile,
LocalDate referenceDate,
String currency,
String index,
String discountCurveName)
Extract a single lattice from the pair of csv files.
|
Set<SwaptionDataLattice> |
parseCSVMultiShift(File atmFile,
File otmFile,
LocalDate referenceDate,
String currency,
String index,
String discountCurveName)
Extract a set of lattices from the pair of csv files.
|
Map<Double,Set<String>> |
parseTenorsPerShift(File atmFile,
String currency)
Create a map overview of which tenors in the given csv file share the same displacement.
|
SwaptionDataLattice[] |
parseZIP(File atmFile,
File otmFile,
String currency,
String index,
String discountCurveName)
Extract an array of SwaptionDataLattice from the zip files.
|
SwaptionDataLattice[] |
parseZIPToConvention(File atmFile,
File otmFile,
String currency,
String index,
String discountCurveName,
SwaptionDataLattice.QuotingConvention convention,
double displacement,
AnalyticModel... models)
Extract an array of SwaptionDataLattice from the zip files.
|
void |
setFileQuotingConvention(SwaptionDataLattice.QuotingConvention fileQuotingConvention,
double fileQuotingUnit,
double fileQuotingUnitForDisplacement)
Set the quoting convention used in the files, together with their unit and the unit of the displacement.
|
public CSVSwaptionParser(SchedulePrototype fixMetaSchedule, SchedulePrototype floatMetaSchedule)
fixMetaSchedule
- The conventions used for the fixed leg of the swaptions.floatMetaSchedule
- The conventions used for the float leg of the swaptions.public CSVSwaptionParser(String[] maturities, String[] tenors, SchedulePrototype fixMetaSchedule, SchedulePrototype floatMetaSchedule)
maturities
- The maturities, which the parser should consider.tenors
- The tenors, which the parser should consider.fixMetaSchedule
- The conventions used for the fixed leg of the swaptions.floatMetaSchedule
- The conventions used for the float leg of the swaptions.public void setFileQuotingConvention(SwaptionDataLattice.QuotingConvention fileQuotingConvention, double fileQuotingUnit, double fileQuotingUnitForDisplacement)
fileQuotingConvention
- The quoting convention.fileQuotingUnit
- The quoting unit (a scaling factor).fileQuotingUnitForDisplacement
- The unit of the displacement (a scaling factor).public SwaptionDataLattice parseCSV(File atmFile, File otmFile, LocalDate referenceDate, String currency, String index, String discountCurveName) throws IOException
atmFile
- The file containing data on atm swpations.otmFile
- The file containing data on otm swaptions.referenceDate
- The reference date the swaptions should be created with respect to.currency
- The currency, which should be parsed from the files.index
- The index, which should be parsed from the files.discountCurveName
- The name of the discount curve, which should be used by the swaptions.IOException
- Thrown upon io error with File.public SwaptionDataLattice[] parseZIP(File atmFile, File otmFile, String currency, String index, String discountCurveName) throws IOException
atmFile
- The archive containing data on atm swpations.otmFile
- The archive containing data on otm swaptions.currency
- The currency, which should be parsed from the files.index
- The index, which should be parsed from the files.discountCurveName
- The name of the discount curve, which should be used by the swaptions.IOException
- Thrown upon io error with File.public SwaptionDataLattice[] parseZIPToConvention(File atmFile, File otmFile, String currency, String index, String discountCurveName, SwaptionDataLattice.QuotingConvention convention, double displacement, AnalyticModel... models) throws IOException
atmFile
- The archive containing data on atm swpations.otmFile
- The archive containing data on otm swaptions.currency
- The currency, which should be parsed from the files.index
- The index, which should be parsed from the files.discountCurveName
- The name of the discount curve, which should be used by the swaptions.convention
- The quoting convention to store the data in.displacement
- The displacement to use, if storing in convention VOLATILITYLOGNORMALmodels
- The models for context to use for each data set top convert to convention.IOException
- Thrown upon io error with File.public Set<SwaptionDataLattice> parseCSVMultiShift(File atmFile, File otmFile, LocalDate referenceDate, String currency, String index, String discountCurveName) throws IOException
atmFile
- The file containing data on atm swpations.otmFile
- The file containing data on otm swaptions.referenceDate
- The reference date the swaptions should be created with respect to.currency
- The currency, which should be parsed from the files.index
- The index, which should be parsed from the files.discountCurveName
- The name of the discount curve, which should be used by the swaptions.IOException
- Thrown upon io error with atmFile.public Map<Double,Set<String>> parseTenorsPerShift(File atmFile, String currency) throws IOException
atmFile
- The file containing data on atm swpations.currency
- The currency, which should be parsed from the files.IOException
- Thrown upon io error with atmFile.public static LocalDate[] getReferenceDates(SwaptionDataLattice[] lattices)
lattices
- The array of lattices.Copyright © 2020. All rights reserved.