Hi,

We are trying to use strata pricing and are stuck at the following points:

- To be able to use different discount curve for the same currency depending on the currency pair.
- To be able to use a composite Ibor curve for discounting

For example, for USD/INR trades, we want to discount USD using USD-LIBOR-6M and use this discounting method in the corresponding pricers while EUR/USD discounting happening on USD-LIBOR-3M. I’d be grateful if you could provide hints on where to start tweaking.

Thanks,

Nitesh

The answer to this depends on which API level you are using - strata-pricer or strata-calc.

At the strata-pricer level, it is up to the caller to create two different `RatesProvider`

instances, and pass the correct one when invoking the pricer (by inspecting the details of the instrument).

At the strata-calc level, the relevant plugin points have been changed since the last release. The new way that the strata-calc layer works is simple - the application passes a single instance of `RatesMarketDataLookup`

to the `CalculationRunner`

, and that is used to determine what discount and forward curves are used. To achieve your goal, you would implement `RatesMarketDataLookup`

and add the logic to choose the correct discount curve. One way to do this would be to override just the `filter()`

method and return one of two “normal” instances of `RatesMarketDataLookup`

based on the instrument. We want to make this process simpler over time, but it should be possible now.

It is possible to use a curve of zero rates or discount factors for discounting. The implementation will adapt based on the curve you provide, using the metadata to decide. See the `Curves`

class to create the relevant metadata.

Hope that helps, and feel free to discuss your use of Strata here, or contact us via OpenGamma directly.

Hi Stephen,

Thank you for the prompt reply. I am using it at the strata-calc level and will try the approach you’ve suggested.

With regarded to point 2, I meant a composite rate curve made up of simple rate curves (basis curves). The zero rates of the composite curve need to be calculated from individual curves using a specified formula (e.g.`-ln(df_curve1*df_curve2)/time_fraction`

) and these zero rates are to be used for discounting. To achieve this should I be implementing `NodalCurve, DiscountFactors`

interfaces or is there a better way? Again, this is also at strata-calc level. My apologies for not being clear.

Thanks,

Nitesh

The existing class `AddFixedCurve`

is an example of a `Curve`

implementation that combines two curves. I suspect your implementation would be similar, with the formula added in the `yValue(double)`

method.

Note that the methods with “parameter” in the name would probably need to merge the parameters of the two underlying curves, see `DiscountFxForwardRates`

for an example of how to do the merge. (`AddFixedCurve`

“cheats” in that it ignores the parameters of one of the underlying curves)

Your new curve implementation will still need to be setup with metadata that describe the meaning of the x-value and y-value (year fraction and zero rates), see `Curves.zeroRates()`

.

To achieve your goals you will probably need to use the latest code on the master branch. This code is changing frequently, including backwards incompatible. Our current goal is to reach a v1.0 at the end of the month, which will involve making these APIs a lot more stable.

Hope that helps

1 Like

I’ve added a new class `TargetTypeCalculationParameter`

:

https://github.com/OpenGamma/Strata/commit/3e63026f52b38a2436decf6a20f3ee74b09e0d7e#diff-0a565c1e72a603d8429379525d28b5acR27

This class does a very similar task to what you want in point 1. Rather than implementing `RatesMarketDataLookup`

, you can just implement `CalculationParameter`

, and in `filter()`

you can examine the trade and decide which `RatesMarketDataLookup`

instance to return.

Hope that helps.