public interface FxRate
Modifier and Type | Method and Description |
---|---|
CurrencyAmount |
convertAmountUsingBidOrAsk(CurrencyAmount originalAmount)
Given a monetary amount in the original currency, calculate the resulting amount in the other currency, using BID or ASK
depending on the originalAmount.currency.
|
CurrencyAmount |
convertAmountUsingMid(CurrencyAmount originalAmount)
Given a monetary amount in the original currency, calculate the resulting amount in the other currency, using MID rate.
|
FxRate |
createInverse()
Create the FX Rate for ccy2 / ccy1, return a new FxRate; the inverse of bid / ask are swapped around.
|
FxRate |
createInverse(int precision)
Create the FX Rate for ccy2 / ccy1, return a new FxRate with given precision; the inverse of bid / ask are swapped around.
|
BigDecimal |
getAsk()
The price at which the 'quoter' is willing to buy ccy1 and sell ccy2.
|
BigDecimal |
getAskInMarketConvention()
Useful for human readable display, returns the same value as Ask if FxRate is in market convention otherwise 1/bid.
|
BigDecimal |
getBid()
The price at which the 'quoter' is willing to sell ccy1 and buy ccy2.
|
BigDecimal |
getBidInMarketConvention()
Useful for human readable display, returns the same value as Bid if FxRate is in market convention otherwise 1/ask.
|
Optional<String> |
getCrossCcy()
This FxRate might come from a combination of 2 rates through a cross currency, if it is the case,
return the cross currency.
|
CurrencyPair |
getCurrencyPair()
The CurrencyPair as in Ccy1/Ccy2 where the Bid will be the price for selling ccy1 and buying ccy2.
|
String |
getDescription()
Nice human readable description of the FX Rate, useful reminder.
|
BigDecimal |
getMid()
Mid = (bid + ask) / 2
|
BigDecimal |
getMidInMarketConvention()
Mid = (bid + ask) / 2
|
CurrencyAmount |
getPaymentAmountForBuying(CurrencyAmount amountToBuy)
Calculates the amount to pay given an amount to buy, e.g.
|
CurrencyAmount |
getReceiptAmountForSelling(CurrencyAmount amountToSell)
Calculates the amount the seller would receive given an amount to sell, e.g.
|
boolean |
isMarketConvention()
true if the CurrencyPair follows market convention, e.g.
|
CurrencyPair getCurrencyPair()
Optional<String> getCrossCcy()
boolean isMarketConvention()
BigDecimal getBid()
BigDecimal getMid()
BigDecimal getAsk()
BigDecimal getBidInMarketConvention()
BigDecimal getMidInMarketConvention()
BigDecimal getAskInMarketConvention()
FxRate createInverse()
FxRate createInverse(int precision)
String getDescription()
CurrencyAmount convertAmountUsingMid(CurrencyAmount originalAmount)
originalAmount
- the monetary amount (currency + amount)IllegalArgumentException
- if the originalAmount.currency is not one of the currency pair.CurrencyAmount convertAmountUsingBidOrAsk(CurrencyAmount originalAmount)
originalAmount
- the monetary amount (currency + amount)IllegalArgumentException
- if the originalAmount.currency is not one of the currency pair.CurrencyAmount getPaymentAmountForBuying(CurrencyAmount amountToBuy)
amountToBuy
- amount you want to buy.CurrencyAmount getReceiptAmountForSelling(CurrencyAmount amountToSell)
amountToSell
- amount you want to sell.Copyright © 2006–2022 Appendium - Portfolio Financing Platform. All rights reserved.