Class BillTradeCalculations


  • public class BillTradeCalculations
    extends Object
    Calculates pricing and risk measures for bill trades.

    This provides a high-level entry point for bill pricing and risk measures.

    Each method takes a ResolvedBillTrade, whereas application code will typically work with BillTrade. Call BillTrade::resolve(ReferenceData) to convert BillTrade to ResolvedBillTrade.

    Price and yield

    Strata uses decimal yields and prices for bills in the trade model, pricers and market data. For example, a price of 99.32% is represented in Strata by 0.9932 and a yield of 1.32% is represented by 0.0132.
    • Method Detail

      • pv01CalibratedSum

        public MultiCurrencyScenarioArray pv01CalibratedSum​(ResolvedBillTrade trade,
                                                            LegalEntityDiscountingMarketDataLookup lookup,
                                                            ScenarioMarketData marketData)
        Calculates present value sensitivity across one or more scenarios.

        This is the sensitivity of present value to a one basis point shift in the calibrated curves. The result is the sum of the sensitivities of all affected curves.

        Parameters:
        trade - the trade
        lookup - the lookup used to query the market data
        marketData - the market data
        Returns:
        the present value sensitivity, one entry per scenario
      • pv01CalibratedSum

        public MultiCurrencyAmount pv01CalibratedSum​(ResolvedBillTrade trade,
                                                     LegalEntityDiscountingProvider ratesProvider)
        Calculates present value sensitivity for a single set of market data.

        This is the sensitivity of present value to a one basis point shift in the calibrated curves. The result is the sum of the sensitivities of all affected curves.

        Parameters:
        trade - the trade
        ratesProvider - the market data
        Returns:
        the present value sensitivity
      • pv01CalibratedBucketed

        public CurrencyParameterSensitivities pv01CalibratedBucketed​(ResolvedBillTrade trade,
                                                                     LegalEntityDiscountingProvider ratesProvider)
        Calculates present value sensitivity for a single set of market data.

        This is the sensitivity of present value to a one basis point shift in the calibrated curves. The result is provided for each affected curve and currency, bucketed by curve node.

        Parameters:
        trade - the trade
        ratesProvider - the market data
        Returns:
        the present value sensitivity
      • pv01MarketQuoteSum

        public MultiCurrencyScenarioArray pv01MarketQuoteSum​(ResolvedBillTrade trade,
                                                             LegalEntityDiscountingMarketDataLookup lookup,
                                                             ScenarioMarketData marketData)
        Calculates present value sensitivity across one or more scenarios.

        This is the sensitivity of present value to a one basis point shift in the market quotes used to calibrate the curves. The result is the sum of the sensitivities of all affected curves.

        Parameters:
        trade - the trade
        lookup - the lookup used to query the market data
        marketData - the market data
        Returns:
        the present value sensitivity, one entry per scenario
      • pv01MarketQuoteSum

        public MultiCurrencyAmount pv01MarketQuoteSum​(ResolvedBillTrade trade,
                                                      LegalEntityDiscountingProvider ratesProvider)
        Calculates present value sensitivity for a single set of market data.

        This is the sensitivity of present value to a one basis point shift in the market quotes used to calibrate the curves. The result is the sum of the sensitivities of all affected curves.

        Parameters:
        trade - the trade
        ratesProvider - the market data
        Returns:
        the present value sensitivity
      • pv01MarketQuoteBucketed

        public ScenarioArray<CurrencyParameterSensitivities> pv01MarketQuoteBucketed​(ResolvedBillTrade trade,
                                                                                     LegalEntityDiscountingMarketDataLookup lookup,
                                                                                     ScenarioMarketData marketData)
        Calculates present value sensitivity across one or more scenarios.

        This is the sensitivity of present value to a one basis point shift in the market quotes used to calibrate the curves. The result is provided for each affected curve and currency, bucketed by curve node.

        Parameters:
        trade - the trade
        lookup - the lookup used to query the market data
        marketData - the market data
        Returns:
        the present value sensitivity, one entry per scenario
      • pv01MarketQuoteBucketed

        public CurrencyParameterSensitivities pv01MarketQuoteBucketed​(ResolvedBillTrade trade,
                                                                      LegalEntityDiscountingProvider ratesProvider)
        Calculates present value sensitivity for a single set of market data.

        This is the sensitivity of present value to a one basis point shift in the market quotes used to calibrate the curves. The result is provided for each affected curve and currency, bucketed by curve node.

        Parameters:
        trade - the trade
        ratesProvider - the market data
        Returns:
        the present value sensitivity
      • currencyExposure

        public MultiCurrencyAmount currencyExposure​(ResolvedBillTrade trade,
                                                    LegalEntityDiscountingProvider ratesProvider)
        Calculates currency exposure for a single set of market data.

        The currency risk, expressed as the equivalent amount in each currency.

        Parameters:
        trade - the trade
        ratesProvider - the market data
        Returns:
        the currency exposure
      • currentCash

        public CurrencyAmount currentCash​(ResolvedBillTrade trade,
                                          LegalEntityDiscountingProvider ratesProvider)
        Calculates current cash for a single set of market data.

        The sum of all cash flows paid on the valuation date.

        Parameters:
        trade - the trade
        ratesProvider - the market data
        Returns:
        the current cash