Quantcast
Channel: Strata - OpenGamma Forums
Viewing all 318 articles
Browse latest View live

Strata v0.16 released


Forex options pricing

$
0
0

@djess wrote:

Hi team, I'm wondering whether I'm missing something.
I was trying to construct vanilla options for forex, such as european put/call, digital options (binary) etc.
I saw EuropeanVanillaOption class in the pricer module, but can't find a suitable Trade for calculation.
How is it possible to evaluate such vanilla options in Strata? With relative greeks also?

Posts: 4

Participants: 2

Read full topic

Equity products

$
0
0

@Ahmed_Habib wrote:

Hi all,

I have a question about equity products. In the product coverage tab, I see only rates products. For example, there is no equity option, equity index option, equity swap, index future, etc...

Is it in roadmap ?

Many thx

Posts: 2

Participants: 2

Read full topic

DV01 for fixed and zero coupon treasury bonds as well as DV01 for Fixed-Float swaps

$
0
0

@Sudharshan_Rao wrote:

Hi

I need to calculate DV01 for Fixed and zero coupon bonds for US treasury bonds.
Also, DV01 for fixed-float interest rate swaps in order to support butterfly and curve trades.
Any help would be appreciated.

Regards
Sudharshan

Posts: 14

Participants: 3

Read full topic

Strata v1.0 released

$
0
0

@stephen wrote:

We are pleased to announce the release of Strata v1.0. The first full release of Strata, after two years of development. Strata is already in use in production and has now reached the point where v1.0 is appropriate. The key features are:

  • Measure-level API - a high level API calculating measures for one trade
  • Calc-level API - a high level API calculating measures for a mixed portfolio of trades
  • Pricer-level API - a low level API performing calculations for one trade
  • Market data structures - representations of curves, surfaces and other kinds of market data
  • Product domain model - beans representing different financial instruments
  • Conventions, indices, and holiday calendars for common markets

The supported asset classes are:

  • Swap - including Vanilla, OIS, Basis, Inflation, Cross Currency and Variable Notional
  • Deliverable Swap Future (DSF)
  • Constant Maturity Swap (CMS)
  • Ibor cap/floor
  • Swaptions
  • Forward Rate Agreement (FRA)
  • FX forward/spot - including Non-Delivered Forward (NDF)
  • FX swap
  • FX options - vanilla and single barrier
  • STIR futures/options
  • Bonds - Fixed coupon and Capital indexed
  • Bond futures/option
  • Term deposit
  • Bullet payment
  • CDS

The API refactoring of recent months is now effectively complete and we intend to maintain the v1.0 API with backward compatibility in mind. Note however that CDS is an exception to this, as it is currently undergoing major enhancements.

The full release notes are included in the Strata documentation. The code is available on GitHub at https://github.com/OpenGamma/Strata.

Posts: 2

Participants: 1

Read full topic

Multicurve Calibration

$
0
0

@djess wrote:

Hello again team,
in addition to old-fashioned curve calibration, I also tried a Multicurve Calibration (Eur-OIS + Euribor3M + Euribor6M) but a couple of problems occurred.

First of all, normally we calibrate Forward Curves also using a starting set of short maturity deposits (from SN to 3M for Euribor3M and from ON to 6M for Euribor6M). Inserting this curve nodes in calibration.csv throws a "Non converging Newton method". Deleting them (and starting from first FRA) executes correctly.

Second problem, the mean error in Forward curves (compared to benchmark curve) is E-3, pretty high.

Last problem regards OIS discount curve. From 1Y to 2Y we use EONIA OIS monthly (pays at 1Y and maturity). What is the correct convention to use in this case? EUR-FIXED-1Y-EONIA-OIS or EUR-FIXED-TERM-EONIA-OIS?

Thank you for your time.

Posts: 4

Participants: 3

Read full topic

InflationSwaps Curve

$
0
0

@erezc wrote:

Hi Stephen,
We are trying to process Bloomberg Inflation Swaps examples and getting indexOutOfBound exception.
It seems that while building the curve array according to effective date, termination date and the period, the array is too small.

For example,


2016-07-12

NONE



2021-07-12

NONE



NONE


5
Y
NONE

Through debugging we see:
The termInYearsEstimate is 7
frequency.eventsPerYearEstimate() is 0.2
frequency.eventsPerYearEstimate() * termInYearsEstimate is 1.4
int(1.4) is 1

I would have thought that the value should be rounded up rather than truncated and result should be 2

Posts: 7

Participants: 2

Read full topic

Pricing Swaps daily

$
0
0

@dapperturban wrote:

In the "HistoricalScenarioExample" it prices the swap up until the start date of the swap, using the scenario builder.
But, if we change the dates of the swap, i.e change the start date to an earlier date. The code returns an error: "Unable to get fixing for USD-LIBOR-3M on date 2015-02-05" but there is data for 2015-02-05 in the marketdata folder.

Why does it not allow us to price the swap during the progress of the swap?

In the SwapPricingExample, you are able to price the swap in between the start and end date, but that does not use a "all-curves.csv" marketdata file, it uses individual csv files for individual dates instead.

Is there a way to a price a swap through all the days during the start and end date of the swap, whilst passing through 1 csv file called "all-curves.csv" as shows in "HistoricalScenarioExample".

Posts: 4

Participants: 2

Read full topic


Hybrid Heston Hull-White Model

$
0
0

@sdumir wrote:

Hi,

Keen to know if there is any specific medium term plans to implement Models to value Equity Structures, e.g. Hybrid Heston Hull-White Models?

Thanks and best regards,
Sanjeev

Posts: 2

Participants: 2

Read full topic

Pricer API for Fixed Coupon Bonds

$
0
0

@dapperturban wrote:

There are currently examples in Strata to demonstrate how to use the Calc API but I am unable to find an example on how to use the Pricer Level API in strata for the asset types that can not be priced using the Calc API, such as Fixed Coupon Bonds.

http://opengamma.github.io/StrataDocs/product_coverage/#pricer-footnote

Is there any example online or method to teach how to use the pricer api? Currently, I am trying to work on how to price a Fixed Coupon Bond?

Posts: 4

Participants: 2

Read full topic

Historical Scenario Analysis for Generic Securities

$
0
0

@dapperturban wrote:

The "HistoricalScenarioExample" illustrates how to price a an asset over a large date range using the "runner.calculateMultiScenario" method. This works for all assets that use Interest Rate Curves for pricing as there is a "loadAllRatesCurves()" method in MarketDataBuilder.

How do we implement this for Generic Securities. How do we price the generic securities over a large date range using the calculateMultiScenario method. There is no "loadAllQuotes()" method, therefore how would one go about passing multiple dates to be priced without changing the valuationDate() every time.

Posts: 2

Participants: 2

Read full topic

Efficiently updating MarketData

$
0
0

@Erik_G wrote:

Hi,

I'm wondering if it is possible with the Strata library to update market quotes without rebuilding the MarketData object and in such a way that depending market data is invalidated or recalculated? For example, I have constructed a MarketData object with market quotes and a couple of curve definition. When I request the curve Strata will construct the curves based on the definitions and market quotes and stored is in the MarketData object (so it can be reused). But now I get a quote update and only one curve depends on this quote (so the other curves don't have to be recalculated), is Strata able to pick up this dependency and invalidate/recalculate the curve? Or do I have to build the MarketData object and recalculate the curves again?

Erik

Posts: 2

Participants: 2

Read full topic

Migration to strata from OG-Platform

$
0
0

@awarude wrote:

do u guys have any documentation that explains the migration process from older open gamma versions to strata?
how much efforts involved how the market data maps in the new strata land as compared to the older versions etc...

Posts: 2

Participants: 2

Read full topic

Swap calculation anomaly when using discount factors

$
0
0

@corjj wrote:

Hey Strata team,

I'm seeing some strange results when loading DF-based curves (as opposed to zero rates).
I might be misunderstanding something here - but shouldn't I be getting the exact same results if I swap my zero curves with their "twin" df curves?

Here is a full reproduction using the "SwapPricingExample" as reference (this is on the v1.0.0 commit):

  1. Create DiscountTest.java next to SwapPricingExample - http://pastebin.com/raw/u9ALL6cZ
  2. Create bug-report.ini next to swap-report-template.ini - http://pastebin.com/raw/pYJK4p2Y
  3. In example-marketdata/curves/2014-01-22.csv replace the values for USD-Disc and USD-3ML with their discount factor replacements (produced via df = exp(-rT)) - http://pastebin.com/raw/bcambJh8
  4. In example-marketdata/curves/settings.csv replace the Value Type for both from Zero to df

Running the test gives me the following:

with zero rates:
+----+--------------+-----------+
| Id |          NPV |      PV01 |
+----+--------------+-----------+
| 1  | 5,965,705.04 | 62,626.50 |
+----+--------------+-----------+

with discount factors:
+----+--------------+------------+
| Id |          NPV |       PV01 |
+----+--------------+------------+
| 1  | 6,047,308.43 | (1,067.91) |
+----+--------------+------------+

Any idea what's happening? Is this a bug or am I misunderstanding the value types?
Thanks!

Posts: 3

Participants: 2

Read full topic

PV01 and DV01 for fixed-float interest rate vanilla swaps

$
0
0

@Sudharshan_Rao wrote:

Hi

I am trying to calculate the PV and DV01 for a plain vanilla 3 year interest rate swap.

Have the following code modified from SwapPricingTest.java:

SwapLeg payLeg = RateCalculationSwapLeg.builder()
.payReceive(PayReceive.PAY)
.accrualSchedule(PeriodicSchedule.builder()
.startDate(LocalDate.of(2016, 8, 10))
.endDate(LocalDate.of(2019, 8, 10))
.frequency(Frequency.P6M)
.businessDayAdjustment(BusinessDayAdjustment.of(BusinessDayConventions.MODIFIED_FOLLOWING, CalendarUSD.NYC))
.stubConvention(null)
.build())
.paymentSchedule(PaymentSchedule.builder()
.paymentFrequency(Frequency.P6M)
.paymentDateOffset(DaysAdjustment.NONE)
.build())
.notionalSchedule(NOTIONAL)
.calculation(FixedRateCalculation.of(1.072 * 0.01, THIRTY_U_360))
.build();

    SwapLeg receiveLeg = RateCalculationSwapLeg.builder()
        .payReceive(RECEIVE)
        .accrualSchedule(PeriodicSchedule.builder()
            .startDate(LocalDate.of(2016, 8, 10))
            .endDate(LocalDate.of(2019, 8, 10))
            .frequency(Frequency.P1M)
            .businessDayAdjustment(BusinessDayAdjustment.of(BusinessDayConventions.MODIFIED_FOLLOWING, CalendarUSD.NYC))
            .build())
        .paymentSchedule(PaymentSchedule.builder()
            .paymentFrequency(Frequency.P1M)
            .paymentDateOffset(DaysAdjustment.NONE)
            .build())
        .notionalSchedule(NOTIONAL)
        .calculation(IborRateCalculation.builder()
            .index(USD_LIBOR_1M)
            .fixingDateOffset(DaysAdjustment.ofBusinessDays(-2, CalendarUSD.NYC, BDA_P))
            .build())
        .build();

    Swap swap = Swap.of(payLeg, receiveLeg);
    SwapTrade trade = SwapTrade.builder()
        .info(TradeInfo.builder().tradeDate(LocalDate.of(2016, 8, 8)).build())
        .product(swap).build();
    
    CurveGroupName groupName = CurveGroupName.of("Test");
    CurveId idUsdDsc = CurveId.of(groupName, StandardDataSets.GROUP1_USD_DSC.getName());
    CurveId idUsdOn = CurveId.of(groupName, StandardDataSets.GROUP1_USD_ON.getName());
    CurveId idUsdL1M = CurveId.of(groupName, StandardDataSets.GROUP1_USD_L1M.getName());
    CurveId idUsdL3M = CurveId.of(groupName, StandardDataSets.GROUP1_USD_L3M.getName());
    CurveId idUsdL6M = CurveId.of(groupName, StandardDataSets.GROUP1_USD_L6M.getName());
    MarketData suppliedData = ImmutableMarketData.builder(VAL_DATE)
        .addValue(idUsdDsc, StandardDataSets.GROUP1_USD_DSC)
        .addValue(idUsdOn, StandardDataSets.GROUP1_USD_ON)
        .addValue(idUsdL1M, StandardDataSets.GROUP1_USD_L1M)
        .addValue(idUsdL3M, StandardDataSets.GROUP1_USD_L3M)
        .addValue(idUsdL6M, StandardDataSets.GROUP1_USD_L6M)
        .build();

    CalculationFunctions functions = StandardComponents.calculationFunctions();

    RatesMarketDataLookup ratesLookup = RatesMarketDataLookup.of(
        ImmutableMap.of(
            USD, idUsdDsc),
        ImmutableMap.of(
            USD_FED_FUND, idUsdOn,
            USD_LIBOR_1M, idUsdL1M,
            USD_LIBOR_3M, idUsdL3M,
            USD_LIBOR_6M, idUsdL6M));

    // create the calculation runner
    List<SwapTrade> trades = ImmutableList.of(trade);
    List<Column> columns = ImmutableList.of(
            Column.of(Measures.LEG_INITIAL_NOTIONAL),
            Column.of(Measures.PRESENT_VALUE),
            Column.of(Measures.LEG_PRESENT_VALUE),
            Column.of(Measures.PV01_CALIBRATED_SUM),
            Column.of(Measures.PAR_RATE),
            Column.of(Measures.ACCRUED_INTEREST));
    CalculationRules rules = CalculationRules.of(functions, USD, ratesLookup);

    // calculate results using the runner
    // using the direct executor means there is no need to close/shutdown the runner
    CalculationRunner runner = CalculationRunner.of(MoreExecutors.newDirectExecutorService());
    Results results = runner.calculate(rules, trades, columns, suppliedData, REF_DATA);
    //System.out.println(JodaBeanSer.PRETTY.xmlWriter().write(swap));
    
    for(int i = 0; i< results.getRowCount(); i++){
    	for(int j =0;j < results.getColumnCount(); j++){
	    	Result<?> result = results.get(i, j);
		    System.out.println(result.getClass()+":"+result.getValue());
    	}
    }

2 questions:

1) I have my own real-time source of Libor and swap rates. How do I build the MarketData for the CalculationRunner in order to match the Bloomberg terminal ?
2) Measures/AdvancedMeasures doesn't have DV01. Do you currently support it ?

Posts: 5

Participants: 2

Read full topic


Interpolation: Hagan & West Forward Monotone Convex

FRA present value calculation (possible bug?)

$
0
0

@djess wrote:

Hi team,
during my analisys of Strata calibrated curves vs benchmark curves, I found great differences in forward ones. Digging deeper I found something strange on PV calculation of FRA instruments:

ExplainMap {
EntryType = FRA,
PaymentDate = 2016-09-11,
StartDate = 2016-09-12,
EndDate = 2016-12-12,
AccrualYearFraction = 0.25277777777777777,
Days = 91,
PaymentCurrency = EUR,
Notional = EUR -1,
TradeNotional = EUR -1,
Observations = [{
EntryType = IborIndexObservation,
FixingDate = 2016-09-08,
Index = EUR-EURIBOR-3M,
IndexValue = -0.0033000000000031724
}],

As you can see, the payment date is 1day before the start date, but in the benchmark FRA the payment and the start date are the same (2016-09-12). This happens on some FRAs of the curve, while other FRAs have the same payment and start date.

How do I ensure that the two dates are the same for all FRAs?

Posts: 6

Participants: 2

Read full topic

PV01CalibratedBucketed - unexpected results

$
0
0

@yanivh wrote:

Hello,

When I ask OG to calculate measure of PV01CalibratedBucketed (with ordinary market data), I expect to get similar values of sensitivity for buckets. However, the results show concentration in the one before last bucket (same results for other trades as well), see below:

Trade
<trade>
		<tradeHeader>
			<partyTradeIdentifier>
				<partyReference href="ExecutionFacility"/>
				<tradeId tradeIdScheme="http://www.tradeweb.com/swaps/trade-id">SEF_ORDER00002001_028-01</tradeId>
			</partyTradeIdentifier>
			<tradeDate>2016-08-25</tradeDate>
		</tradeHeader>
		<swap>
			<productType>InterestRate:IRSwap:FixedFloat</productType>
			<swapStream id="floatingLeg">
				<payerPartyReference href="party1"/>
				<receiverPartyReference href="party2"/>
				<calculationPeriodDates id="payCalcDates">
					<effectiveDate>
						<unadjustedDate>2016-08-30</unadjustedDate>
						<dateAdjustments>
							<businessDayConvention>NONE</businessDayConvention>
						</dateAdjustments>
					</effectiveDate>
					<terminationDate>
						<unadjustedDate>2021-08-30</unadjustedDate>
						<dateAdjustments>
							<businessDayConvention>MODFOLLOWING</businessDayConvention>
							<businessCenters>
								<businessCenter businessCenterScheme="http://www.fpml.org/coding-scheme/business-center">NYFD</businessCenter>
								<businessCenter businessCenterScheme="http://www.fpml.org/coding-scheme/business-center">GBLO</businessCenter>
							</businessCenters>
						</dateAdjustments>
					</terminationDate>
					<calculationPeriodDatesAdjustments>
						<businessDayConvention>MODFOLLOWING</businessDayConvention>
						<businessCenters>
							<businessCenter businessCenterScheme="http://www.fpml.org/coding-scheme/business-center">NYFD</businessCenter>
							<businessCenter businessCenterScheme="http://www.fpml.org/coding-scheme/business-center">GBLO</businessCenter>
						</businessCenters>
					</calculationPeriodDatesAdjustments>
					<calculationPeriodFrequency>
						<periodMultiplier>3</periodMultiplier>
						<period>M</period>
						<rollConvention>30</rollConvention>
					</calculationPeriodFrequency>
				</calculationPeriodDates>
				<paymentDates>
					<calculationPeriodDatesReference href="payCalcDates"/>
					<paymentFrequency>
						<periodMultiplier>3</periodMultiplier>
						<period>M</period>
					</paymentFrequency>
					<payRelativeTo>CalculationPeriodEndDate</payRelativeTo>
					<paymentDatesAdjustments>
						<businessDayConvention>MODFOLLOWING</businessDayConvention>
						<businessCenters>
							<businessCenter businessCenterScheme="http://www.fpml.org/coding-scheme/business-center">NYFD</businessCenter>
							<businessCenter businessCenterScheme="http://www.fpml.org/coding-scheme/business-center">GBLO</businessCenter>
						</businessCenters>
					</paymentDatesAdjustments>
				</paymentDates>
				<resetDates id="payResetDates">
					<calculationPeriodDatesReference href="payCalcDates"/>
					<resetRelativeTo>CalculationPeriodStartDate</resetRelativeTo>
					<fixingDates>
						<periodMultiplier>-2</periodMultiplier>
						<period>D</period>
						<dayType>Business</dayType>
						<businessDayConvention>NONE</businessDayConvention>
						<businessCenters>
							<businessCenter businessCenterScheme="http://www.fpml.org/coding-scheme/business-center">GBLO</businessCenter>
						</businessCenters>
						<dateRelativeTo href="payResetDates"/>
					</fixingDates>
					<resetFrequency>
						<periodMultiplier>3</periodMultiplier>
						<period>M</period>
					</resetFrequency>
					<resetDatesAdjustments>
						<businessDayConvention>MODFOLLOWING</businessDayConvention>
						<businessCenters>
							<businessCenter businessCenterScheme="http://www.fpml.org/coding-scheme/business-center">NYFD</businessCenter>
							<businessCenter businessCenterScheme="http://www.fpml.org/coding-scheme/business-center">GBLO</businessCenter>
						</businessCenters>
					</resetDatesAdjustments>
				</resetDates>
				<calculationPeriodAmount>
					<calculation>
						<notionalSchedule id="payNotionalSchedule">
							<notionalStepSchedule>
								<initialValue>10000000</initialValue>
								<currency currencyScheme="http://www.fpml.org/coding-scheme/external/iso4217-2001-08-15">USD</currency>
							</notionalStepSchedule>
						</notionalSchedule>
						<floatingRateCalculation>
							<floatingRateIndex floatingRateIndexScheme="http://www.fpml.org/coding-scheme/floating-rate-index">USD-LIBOR-BBA</floatingRateIndex>
							<indexTenor>
								<periodMultiplier>3</periodMultiplier>
								<period>M</period>
							</indexTenor>
						</floatingRateCalculation>
						<dayCountFraction dayCountFractionScheme="http://www.fpml.org/coding-scheme/day-count-fraction">30/360</dayCountFraction>
					</calculation>
				</calculationPeriodAmount>
			</swapStream>
			<swapStream id="fixedLeg">
				<payerPartyReference href="party2"/>
				<receiverPartyReference href="party1"/>
				<calculationPeriodDates id="recCalcDates">
					<effectiveDate>
						<unadjustedDate>2016-08-30</unadjustedDate>
						<dateAdjustments>
							<businessDayConvention>NONE</businessDayConvention>
						</dateAdjustments>
					</effectiveDate>
					<terminationDate>
						<unadjustedDate>2021-08-30</unadjustedDate>
						<dateAdjustments>
							<businessDayConvention>MODFOLLOWING</businessDayConvention>
							<businessCenters>
								<businessCenter businessCenterScheme="http://www.fpml.org/coding-scheme/business-center">NYFD</businessCenter>
								<businessCenter businessCenterScheme="http://www.fpml.org/coding-scheme/business-center">GBLO</businessCenter>
							</businessCenters>
						</dateAdjustments>
					</terminationDate>
					<calculationPeriodDatesAdjustments>
						<businessDayConvention>MODFOLLOWING</businessDayConvention>
						<businessCenters>
							<businessCenter businessCenterScheme="http://www.fpml.org/coding-scheme/business-center">NYFD</businessCenter>
							<businessCenter businessCenterScheme="http://www.fpml.org/coding-scheme/business-center">GBLO</businessCenter>
						</businessCenters>
					</calculationPeriodDatesAdjustments>
					<calculationPeriodFrequency>
						<periodMultiplier>6</periodMultiplier>
						<period>M</period>
						<rollConvention>30</rollConvention>
					</calculationPeriodFrequency>
				</calculationPeriodDates>
				<paymentDates>
					<calculationPeriodDatesReference href="recCalcDates"/>
					<paymentFrequency>
						<periodMultiplier>6</periodMultiplier>
						<period>M</period>
					</paymentFrequency>
					<payRelativeTo>CalculationPeriodEndDate</payRelativeTo>
					<paymentDatesAdjustments>
						<businessDayConvention>MODFOLLOWING</businessDayConvention>
						<businessCenters>
							<businessCenter businessCenterScheme="http://www.fpml.org/coding-scheme/business-center">NYFD</businessCenter>
							<businessCenter businessCenterScheme="http://www.fpml.org/coding-scheme/business-center">GBLO</businessCenter>
						</businessCenters>
					</paymentDatesAdjustments>
				</paymentDates>
				<calculationPeriodAmount>
					<calculation>
						<notionalSchedule id="receiveNotionalSchedule">
							<notionalStepSchedule>
								<initialValue>10000000</initialValue>
								<currency currencyScheme="http://www.fpml.org/coding-scheme/external/iso4217-2001-08-15">USD</currency>
							</notionalStepSchedule>
						</notionalSchedule>
						<fixedRateSchedule>
							<initialValue>0.0114652967</initialValue>
						</fixedRateSchedule>
						<dayCountFraction dayCountFractionScheme="http://www.fpml.org/coding-scheme/day-count-fraction">30/360</dayCountFraction>
					</calculation>
				</calculationPeriodAmount>
			</swapStream>
		</swap>
	</trade>
Bucketed results

marketDataName = {com.opengamma.strata.market.curve.CurveName@14546} "USD_IRS_3M"
parameterMetadata = {com.google.common.collect.RegularImmutableList@14547} size = 52
sensitivity = {com.opengamma.strata.collect.array.DoubleArray@15780} "[0.0, 0.0, 0.0, 0.0, 0.0, -250.6229579146853, -8.40850284262374, -12.285655034908746, 9.34233169844132, 2.0147828998608515, 18.08171847680155, -30.885579035948034, 21.660147856313735, 4.272865596238152, 31.277464058282227, -47.5813548023805, 2.567995340775326, 134.65570560204796, -62.238883978869026, -64.0832913678527, 6.32539025412947, -81.76604432477131, 336.6192413901672, -179.23409043204413, 4475.823621412836, 368.8355249877134, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]"
array = {double[52]@15783}
0 = 0.0
1 = 0.0
2 = 0.0
3 = 0.0
4 = 0.0
5 = -250.6229579146853
6 = -8.40850284262374
7 = -12.285655034908746
8 = 9.34233169844132
9 = 2.0147828998608515
10 = 18.08171847680155
11 = -30.885579035948034
12 = 21.660147856313735
13 = 4.272865596238152
14 = 31.277464058282227
15 = -47.5813548023805
16 = 2.567995340775326
17 = 134.65570560204796
18 = -62.238883978869026
19 = -64.0832913678527
20 = 6.32539025412947
21 = -81.76604432477131
22 = 336.6192413901672
23 = -179.23409043204413
24 = 4475.823621412836
25 = 368.8355249877134

Posts: 10

Participants: 4

Read full topic

Small differences in bond YTM calculation inside odd coupon period

$
0
0

@adam wrote:

Hi,

I'm seeing some differences between Strata's YTM calculation and Bloomberg's where the pricing date is inside an odd coupon period. It's not a huge difference in most cases, but could be bigger if the stub was longer.

For this bond: DE0001104644

Issue date: 13/5/2016
First coupon: 15/6/2017
Maturity: 15/06/2018
Coupon: 0%
Coupon freq: Annual
First period type : Long First
Pricing Date: 30/08/2016

For a bond price of 101.102, Bloomberg has a YTM of -0.610%, Strata has -0.633% . Not a big difference at all, but I still wanted to explain it, as it was bang on for most other bonds.

I can replicate Bloomberg's calculation, and the difference is how the pvAtFirstCoupon is discounted to the pricing date.

Strata considers the 'factorToNextCoupon' to be the factor for the whole first coupon period (very roughly (nextCoupon-settlement)/(nextCoupon-issue)) = 0.7262951900298692

But Bloomberg ignores the little stub at the start of the first coupon period and uses a denominator of what would have been the regular period (((nextCoupon-settlement)/(nextCoupon-"15/6/2016") = 0.7917808219

I'm struggling to find much information on what the standard actually is, but using this quasi coupon period also agrees with our existing risk system.

Can you see if the problem is with the code I’m using (below), with strata or with Bloomberg?

Thanks,
Adam

Here's the Strata 1.0.0 code I'm using:

FixedCouponBond bond = FixedCouponBond.builder()
.currency(Currency.EUR)
.securityId(SecurityId.of("ISIN", "DE0001104644"))
.dayCount(DayCounts.ACT_ACT_ICMA)
.fixedRate(0)
.notional(1)
.accrualSchedule(
PeriodicSchedule.builder()
.startDate(LocalDate.of(2016, 5, 13))
.endDate(LocalDate.of(2018, 6, 15))
.firstRegularStartDate(LocalDate.of(2017, 6, 15))
.frequency(Frequency.P12M)
.businessDayAdjustment(BusinessDayAdjustment.of(BusinessDayConventions.MODIFIED_FOLLOWING, HolidayCalendarIds.EUTA))
.build()
)
.yieldConvention(FixedCouponBondYieldConvention.DE_BONDS)
.legalEntityId(StandardId.of("LegalEntity", "DUMMY"))
.settlementDateOffset(DaysAdjustment.ofBusinessDays(2, HolidayCalendarIds.EUTA))
.exCouponPeriod(DaysAdjustment.NONE)
.build();

ResolvedFixedCouponBond resolvedBond = bond.resolve(ReferenceData.standard());

double yield = DiscountingFixedCouponBondProductPricer.DEFAULT.yieldFromDirtyPrice(resolvedBond, LocalDate.of(2016, 8, 30), 1.01102);
System.out.println(yield); // -0.006328584959046614, expected -0.006097996

double price = DiscountingFixedCouponBondProductPricer.DEFAULT.dirtyPriceFromYield(resolvedBond, LocalDate.of(2016, 8, 30), -0.00609799584105163);
System.out.println(price); // 1.0106151133505177, expected 1.01102

Posts: 1

Participants: 1

Read full topic

Accrued Interest for Bonds

$
0
0

@TkNeo wrote:

I am new to OG. Can someone please guide me to the API for calculating accrued interest on bonds. I have the specifics such as settle date, day count , coupon, previous payment date. Wondering if there is a way in OG to calculate how much accrued is due at the time of the transaction.

Posts: 4

Participants: 2

Read full topic

Viewing all 318 articles
Browse latest View live