public class DiscountingSwapTradePricer extends Object
This function provides the ability to price a ResolvedSwapTrade
.
The product is priced by pricing the product.
Modifier and Type | Field and Description |
---|---|
static DiscountingSwapTradePricer |
DEFAULT
Default implementation.
|
Constructor and Description |
---|
DiscountingSwapTradePricer(DiscountingSwapProductPricer productPricer)
Creates an instance.
|
Modifier and Type | Method and Description |
---|---|
MultiCurrencyAmount |
accruedInterest(ResolvedSwapTrade trade,
RatesProvider provider)
Calculates the accrued interest since the last payment.
|
CashFlows |
cashFlows(ResolvedSwapTrade trade,
RatesProvider provider)
Calculates the future cash flows of the swap trade.
|
MultiCurrencyAmount |
currencyExposure(ResolvedSwapTrade trade,
RatesProvider provider)
Calculates the currency exposure of the swap trade.
|
MultiCurrencyAmount |
currentCash(ResolvedSwapTrade trade,
RatesProvider provider)
Calculates the current cash of the swap trade.
|
ExplainMap |
explainPresentValue(ResolvedSwapTrade trade,
RatesProvider provider)
Explains the present value of the swap trade.
|
MultiCurrencyAmount |
forecastValue(ResolvedSwapTrade trade,
RatesProvider provider)
Calculates the forecast value of the swap trade.
|
PointSensitivities |
forecastValueSensitivity(ResolvedSwapTrade trade,
RatesProvider provider)
Calculates the forecast value sensitivity of the swap trade.
|
DiscountingSwapProductPricer |
getProductPricer()
Gets the underlying product pricer.
|
double |
parRate(ResolvedSwapTrade trade,
RatesProvider provider)
Calculates the par rate of the swap trade.
|
PointSensitivities |
parRateSensitivity(ResolvedSwapTrade trade,
RatesProvider provider)
Calculates the par rate curve sensitivity of the swap trade.
|
double |
parSpread(ResolvedSwapTrade trade,
RatesProvider provider)
Calculates the par spread of the swap trade.
|
PointSensitivities |
parSpreadSensitivity(ResolvedSwapTrade trade,
RatesProvider provider)
Calculates the par spread curve sensitivity of the swap trade.
|
CurrencyAmount |
presentValue(ResolvedSwapTrade trade,
Currency currency,
RatesProvider provider)
Calculates the present value of the swap trade, converted to the specified currency.
|
MultiCurrencyAmount |
presentValue(ResolvedSwapTrade trade,
RatesProvider provider)
Calculates the present value of the swap trade.
|
PointSensitivities |
presentValueSensitivity(ResolvedSwapTrade trade,
RatesProvider provider)
Calculates the present value sensitivity of the swap trade.
|
public static final DiscountingSwapTradePricer DEFAULT
public DiscountingSwapTradePricer(DiscountingSwapProductPricer productPricer)
productPricer
- the pricer for ResolvedSwap
public DiscountingSwapProductPricer getProductPricer()
public CurrencyAmount presentValue(ResolvedSwapTrade trade, Currency currency, RatesProvider provider)
The present value of the trade is the value on the valuation date. This is the discounted forecast value. The result is converted to the specified currency.
trade
- the tradecurrency
- the currency to convert toprovider
- the rates providerpublic MultiCurrencyAmount presentValue(ResolvedSwapTrade trade, RatesProvider provider)
The present value of the trade is the value on the valuation date. This is the discounted forecast value. The result is expressed using the payment currency of each leg.
trade
- the tradeprovider
- the rates providerpublic ExplainMap explainPresentValue(ResolvedSwapTrade trade, RatesProvider provider)
This returns explanatory information about the calculation.
trade
- the tradeprovider
- the rates providerpublic PointSensitivities presentValueSensitivity(ResolvedSwapTrade trade, RatesProvider provider)
The present value sensitivity of the trade is the sensitivity of the present value to the underlying curves.
trade
- the tradeprovider
- the rates providerpublic MultiCurrencyAmount forecastValue(ResolvedSwapTrade trade, RatesProvider provider)
The forecast value of the trade is the value on the valuation date without present value discounting. The result is expressed using the payment currency of each leg.
trade
- the tradeprovider
- the rates providerpublic PointSensitivities forecastValueSensitivity(ResolvedSwapTrade trade, RatesProvider provider)
The forecast value sensitivity of the trade is the sensitivity of the forecast value to the underlying curves.
trade
- the tradeprovider
- the rates providerpublic double parRate(ResolvedSwapTrade trade, RatesProvider provider)
The par rate is the rate for which the swap present value is 0.
trade
- the tradeprovider
- the rates providerpublic PointSensitivities parRateSensitivity(ResolvedSwapTrade trade, RatesProvider provider)
The par rate curve sensitivity of the product is the sensitivity of the par rate to the underlying curves.
trade
- the tradeprovider
- the rates providerpublic double parSpread(ResolvedSwapTrade trade, RatesProvider provider)
This is spread to be added to the fixed rate to have a present value of 0.
trade
- the tradeprovider
- the rates providerpublic PointSensitivities parSpreadSensitivity(ResolvedSwapTrade trade, RatesProvider provider)
The par spread curve sensitivity of the product is the sensitivity of the par spread to the underlying curves.
trade
- the tradeprovider
- the rates providerpublic CashFlows cashFlows(ResolvedSwapTrade trade, RatesProvider provider)
Each expected cash flow is added to the result.
This is based on forecastValue(ResolvedSwapTrade, RatesProvider)
.
trade
- the tradeprovider
- the rates providerpublic MultiCurrencyAmount accruedInterest(ResolvedSwapTrade trade, RatesProvider provider)
This determines the payment period applicable at the valuation date and calculates the accrued interest since the last payment.
trade
- the tradeprovider
- the rates providerpublic MultiCurrencyAmount currencyExposure(ResolvedSwapTrade trade, RatesProvider provider)
trade
- the tradeprovider
- the rates providerpublic MultiCurrencyAmount currentCash(ResolvedSwapTrade trade, RatesProvider provider)
trade
- the tradeprovider
- the rates providerCopyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.