New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bill and bill trade description. #1748

Merged
merged 3 commits into from Jun 28, 2018

Conversation

Projects
None yet
2 participants
@marc-henrard
Contributor

marc-henrard commented Jun 21, 2018

  • Created bill product and bill trade
  • Resolved versions

@marc-henrard marc-henrard requested a review from jodastephen Jun 21, 2018

.settlementDateOffset(DaysAdjustment.ofBusinessDays(2, EUTA, BUSINESS_ADJUST))
.yieldConvention(BillYieldConvention.INTEREST_AT_MATURITY).build();
private static final double TOLERANCE_PRICE = 1.0E-8;

This comment has been minimized.

@jodastephen

jodastephen Jun 27, 2018

Member

Om;y one blank line

@jodastephen

jodastephen Jun 27, 2018

Member

Om;y one blank line

Show outdated Hide outdated modules/product/src/main/java/com/opengamma/strata/product/bond/Bill.java
Show outdated Hide outdated modules/product/src/main/java/com/opengamma/strata/product/bond/Bill.java
* @return the price
*/
public double priceFromYield(double yield, LocalDate settlementDate) {
double accrualFactor = dayCount.relativeYearFraction(settlementDate, notional.getDate().getUnadjusted());

This comment has been minimized.

@jodastephen

jodastephen Jun 27, 2018

Member

The logic below should move onto BillConvention (taking accrualFactor)

@jodastephen

jodastephen Jun 27, 2018

Member

The logic below should move onto BillConvention (taking accrualFactor)

Show outdated Hide outdated modules/product/src/main/java/com/opengamma/strata/product/bond/Bill.java
Show outdated Hide outdated ...s/product/src/main/java/com/opengamma/strata/product/bond/BillTrade.java
Show outdated Hide outdated ...roduct/src/main/java/com/opengamma/strata/product/bond/ResolvedBill.java
* @return the price
*/
public double priceFromYield(double yield, LocalDate settlementDate) {
double accrualFactor = dayCount.relativeYearFraction(settlementDate, notional.getDate());

This comment has been minimized.

@jodastephen

jodastephen Jun 27, 2018

Member

Logic on convention

@jodastephen

jodastephen Jun 27, 2018

Member

Logic on convention

Show outdated Hide outdated ...roduct/src/main/java/com/opengamma/strata/product/bond/ResolvedBill.java
@ImmutablePreBuild
private static void preBuild(Builder builder) {
if (builder.settlement != null) {
ArgChecker.isTrue(builder.quantity * builder.settlement.getAmount() <= 0); // Amount negative for buy

This comment has been minimized.

@jodastephen

jodastephen Jun 27, 2018

Member

Is this right?

@jodastephen

jodastephen Jun 27, 2018

Member

Is this right?

This comment has been minimized.

@marc-henrard

marc-henrard Jun 27, 2018

Contributor

When buying, quantity > 0 and amount is paid and so < 0. This is to check that the user does not get confused on the signs.

@marc-henrard

marc-henrard Jun 27, 2018

Contributor

When buying, quantity > 0 and amount is paid and so < 0. This is to check that the user does not get confused on the signs.

marc-henrard added some commits Jun 27, 2018

@jodastephen

Still got singular/plural comment and ofPrice() to do

@jodastephen jodastephen merged commit f9a068f into master Jun 28, 2018

15 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
security/snyk - modules/basics/pom.xml No dependency changes
Details
security/snyk - modules/calc/pom.xml No dependency changes
Details
security/snyk - modules/collect/pom.xml No dependency changes
Details
security/snyk - modules/data/pom.xml No dependency changes
Details
security/snyk - modules/loader/pom.xml No dependency changes
Details
security/snyk - modules/market/pom.xml No dependency changes
Details
security/snyk - modules/math/pom.xml No dependency changes
Details
security/snyk - modules/measure/pom.xml No dependency changes
Details
security/snyk - modules/pom.xml No dependency changes
Details
security/snyk - modules/pricer/pom.xml No dependency changes
Details
security/snyk - modules/product/pom.xml No dependency changes
Details
security/snyk - modules/report/pom.xml No dependency changes
Details
security/snyk - pom.xml No dependency changes
Details

@jodastephen jodastephen deleted the topic/bill-trade branch Jun 28, 2018

@jodastephen jodastephen added this to the v2.0 milestone Jul 5, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment