Skip to content
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

Add traded price for more security products #1721

Merged
merged 1 commit into from Jun 11, 2018

Conversation

jodastephen
Copy link
Member

No description provided.

@jodastephen jodastephen force-pushed the topic/security-traded-price branch 2 times, most recently from ab9440e to 272736e Compare June 8, 2018 18:11
Extend use of `TradedPrice`
@jodastephen jodastephen requested review from Mistuus and removed request for yukiiwashita June 11, 2018 12:21
@jodastephen jodastephen assigned Mistuus and unassigned yukiiwashita Jun 11, 2018
@@ -265,24 +265,19 @@ public void priceSensitivity() {

public void presentValue() {
// March 2016
CurrencyAmount pvMar = TRADE_PRICER.presentValue(FUTURE_TRADE_MAR, RATES_PROVIDER,
FUTURE_TRADE_MAR.getPrice());
CurrencyAmount pvMar = TRADE_PRICER.presentValue(FUTURE_TRADE_MAR, RATES_PROVIDER, REF_PRICE_MAR_DECIMAL);
assertEquals(pvMar.getAmount(), -9738.418878056109, TOL * NOTIONAL);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of curiosity, why do we use TOL * NOTIONAL instead of just doing 0.01d or having a constant DELTA = 0.01d?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It makes the tolerance proportional to the trade size, converting it to be more like a percentage of the trade value rather than an absolute amount,

@Mistuus Mistuus merged commit 09358e0 into master Jun 11, 2018
@Mistuus Mistuus deleted the topic/security-traded-price branch June 11, 2018 14:29
@jodastephen jodastephen added this to the v2.0 milestone Jun 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants