public class BondManager
extends java.lang.Object
Constructor and Description |
---|
BondManager() |
Modifier and Type | Method and Description |
---|---|
static BondComponent |
BuildBondFromResultSet(java.sql.ResultSet rs,
MarketParams mpc)
Build a bond from the input result set
|
static boolean |
CalcAndLoadBondClosingMeasures(MarketParams mpc,
java.sql.Statement stmt,
JulianDate dtEODStart,
JulianDate dtEODFinish)
Calculate and saves the measures for all the bonds from their market prices for all EODs between a
given pair of dates
|
static boolean |
CalcAndLoadBondMeasuresFromPrice(java.sql.Statement stmt,
Bond bond,
ValuationParams valParams,
MarketParams mpc,
double dblPrice)
Calculate the bond measures for the given bond and price, and loads them onto the DB
|
static CaseInsensitiveTreeMap<BondRVMeasures> |
CalcBondAnalyticsFromPrice(java.lang.String strCUSIPIn,
MarketParams mpc,
JulianDate dt,
double dblBidPrice,
double dblAskPrice)
Calculate the full set of calculable bond measures given the CUSIP, the valuation parameters, and the
prices.
|
static CaseInsensitiveTreeMap<BondRVMeasures> |
CalcBondMeasures(java.lang.String strBondDescription,
Bond bond,
ValuationParams valParams,
MarketParams mpc,
double dblBidPrice,
double dblAskPrice)
Calculate the full set of calculable bond measures given the bond, the valuation parameters, and the
prices.
|
static int |
CalcFullBondAnalytics(MarketParams mpc,
JulianDate dt,
double dblBidPrice,
double dblAskPrice)
Calculate the full set of bond measures for all available bonds given the same bid and ask prices.
|
static boolean |
CalcMarketMeasuresForTicker(java.lang.String strTicker,
MarketParams mpc,
JulianDate dt)
Calculate the bond measures corresponding to the bonds in the ticker from their market prices
|
static boolean |
CalcMeasuresForTicker(java.lang.String strTicker,
MarketParams mpc,
JulianDate dt,
double dblBidPrice,
double dblAskPrice)
Calculate the bond measures corresponding to the bonds in the ticker from the given price
|
static int |
CommitBondsToMem(MarketParams mpc,
java.sql.Statement stmt)
Create all the bonds, and loads them onto the memory
|
static int |
FullBondMarketAnalytics(MarketParams mpc,
JulianDate dt)
Calculate the complete set of bond measures for all the bonds from their closing bid/ask prices.
|
static boolean |
GenerateBondCreatorFile(MarketParams mpc,
java.sql.Statement stmt)
Generate the bond creator file
|
static java.util.Set<java.lang.String> |
GetAvailableTickers(java.sql.Statement stmt)
Get all the available tickers from the database
|
static java.util.List<java.lang.String> |
GetISINsForTicker(java.sql.Statement stmt,
java.lang.String strTicker)
Retrieve all the ISINs for the given ticker
|
static double |
GetMidMarksForCUSIP(java.lang.String strCUSIP,
JulianDate dt,
java.sql.Statement stmt)
Retrieve the mid marks (price/spreads) for the given ISIN/CUSIP and the valuation date
|
static BondRefDataBuilder |
LoadBondRefData(java.sql.Statement stmt,
java.lang.String strBondId)
Load the reference data corresponding to the input bond ID
|
static Bond |
LoadFromBondId(MarketParams mpc,
java.sql.Statement stmt,
java.lang.String strBondId,
double dblScheduleStart)
Load the bond object using its ID
|
static boolean |
LoadMidBondMarks(JulianDate dt,
java.sql.Statement stmt)
Load all the mid bond marks for the given EOD
|
static void |
main(java.lang.String[] astrArgs) |
static int |
SaveBondCalcMeasures(java.sql.Statement stmt,
JulianDate dtEOD)
Calculate and saves the measures for all the bonds form their market prices for a given EOD
|
static boolean |
SetEOS(java.sql.Statement stmt)
Set the option schedule for all the bonds by extracting them from the database
|
public static final boolean SetEOS(java.sql.Statement stmt)
stmt
- SQL Statement object representing the query to be executedpublic static CaseInsensitiveTreeMap<BondRVMeasures> CalcBondMeasures(java.lang.String strBondDescription, Bond bond, ValuationParams valParams, MarketParams mpc, double dblBidPrice, double dblAskPrice)
strBondDescription
- String describing the bondbond
- Bond objectvalParams
- ValuationParamsmpc
- MarkerParamsContainer containing all the curvesdblBidPrice
- Double representing the bid pricedblAskPrice
- Double representing the ask pricepublic static CaseInsensitiveTreeMap<BondRVMeasures> CalcBondAnalyticsFromPrice(java.lang.String strCUSIPIn, MarketParams mpc, JulianDate dt, double dblBidPrice, double dblAskPrice)
strCUSIPIn
- Bond CUSIP/ISINmpc
- MarkerParamsContainer containing all the curvesdt
- Valuation DatedblBidPrice
- Bid PricedblAskPrice
- Ask Pricepublic static int CalcFullBondAnalytics(MarketParams mpc, JulianDate dt, double dblBidPrice, double dblAskPrice)
mpc
- org.drip.param.definition.MarketParams containing the curvesdt
- Valuation datedblBidPrice
- Bid PricedblAskPrice
- Ask Pricepublic static int FullBondMarketAnalytics(MarketParams mpc, JulianDate dt)
mpc
- org.drip.param.definition.MarketParams containing the curvesdt
- Valuation Datepublic static final double GetMidMarksForCUSIP(java.lang.String strCUSIP, JulianDate dt, java.sql.Statement stmt) throws java.lang.Exception
strCUSIP
- ISIN/CUSIP stringdt
- Valuation Datestmt
- SQL Statement object representing the connectionjava.lang.Exception
- Thrown if there is an input error or a database failurepublic static final boolean LoadMidBondMarks(JulianDate dt, java.sql.Statement stmt)
dt
- EOD datestmt
- SQL Statement object representing the querypublic static final BondComponent BuildBondFromResultSet(java.sql.ResultSet rs, MarketParams mpc)
rs
- ResultSet containing the list of queried bondsmpc
- org.drip.param.definition.MarketParams containing the closing curvespublic static final Bond LoadFromBondId(MarketParams mpc, java.sql.Statement stmt, java.lang.String strBondId, double dblScheduleStart)
mpc
- org.drip.param.definition.MarketParams containing the closing curvesstmt
- SQL Statement object representing the querystrBondId
- ISIN/CUSIP/other identifiable bond IDsdblScheduleStart
- Schedule start date - needed for bonds with embedded American options, so that
the discretized schedules can start from this date (usually the Valuation date)public static final BondRefDataBuilder LoadBondRefData(java.sql.Statement stmt, java.lang.String strBondId)
stmt
- SQL Statement representing the querystrBondId
- Bond IDpublic static final java.util.Set<java.lang.String> GetAvailableTickers(java.sql.Statement stmt)
stmt
- SQL Statement object representing the executable querypublic static final java.util.List<java.lang.String> GetISINsForTicker(java.sql.Statement stmt, java.lang.String strTicker)
stmt
- SQL Statement object representing the executable querystrTicker
- String representing the tickerpublic static final int CommitBondsToMem(MarketParams mpc, java.sql.Statement stmt)
mpc
- MarketParamasContainer containing the closing curvesstmt
- SQL Statement object representing the executable querypublic static final boolean CalcMeasuresForTicker(java.lang.String strTicker, MarketParams mpc, JulianDate dt, double dblBidPrice, double dblAskPrice)
strTicker
- Ticker stringmpc
- MarketParamasContainer containing the closing curvesdt
- Valuation datedblBidPrice
- Bid PricedblAskPrice
- Ask Pricepublic static final boolean CalcMarketMeasuresForTicker(java.lang.String strTicker, MarketParams mpc, JulianDate dt)
strTicker
- Ticker stringmpc
- MarketParamasContainer containing the closing curvesdt
- Valuation datepublic static final boolean CalcAndLoadBondMeasuresFromPrice(java.sql.Statement stmt, Bond bond, ValuationParams valParams, MarketParams mpc, double dblPrice)
stmt
- SQL Statement object representing the executable querybond
- Input bondvalParams
- ValuationParams containing the EODmpc
- org.drip.param.definition.MarketParams containing the EOD curvesdblPrice
- Double pricepublic static int SaveBondCalcMeasures(java.sql.Statement stmt, JulianDate dtEOD)
stmt
- SQL Statement object representing the executable querydtEOD
- EOD Datepublic static final boolean CalcAndLoadBondClosingMeasures(MarketParams mpc, java.sql.Statement stmt, JulianDate dtEODStart, JulianDate dtEODFinish)
mpc
- MarketParams containing the curvesstmt
- SQL Statement object representing the executable querydtEODStart
- EOD startdtEODFinish
- EOD finishpublic static final boolean GenerateBondCreatorFile(MarketParams mpc, java.sql.Statement stmt)
mpc
- MarketParamasContainer containing the closing curvesstmt
- SQL Statement object representing the executable querypublic static final void main(java.lang.String[] astrArgs)