| Constructor and Description |
|---|
FxRateImpl(CurrencyPair currencyPair,
String crossCcy,
boolean marketConvention,
BigDecimal bid,
BigDecimal ask,
CurrencyProvider currencyProvider) |
| 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.
|
String |
toString() |
public FxRateImpl(CurrencyPair currencyPair, String crossCcy, boolean marketConvention, BigDecimal bid, BigDecimal ask, CurrencyProvider currencyProvider)
public String getDescription()
CAD.SGD Mkt Convention:true Quoter buys CAD and sells SGD at 1.1279 Quoter sells CAD and buys SGD at 1.1289
getDescription in interface FxRatepublic FxRate createInverse()
FxRatecreateInverse in interface FxRatepublic FxRate createInverse(int precision)
FxRatecreateInverse in interface FxRatepublic BigDecimal getBid()
FxRatepublic BigDecimal getAsk()
FxRatepublic CurrencyPair getCurrencyPair()
FxRategetCurrencyPair in interface FxRatepublic Optional<String> getCrossCcy()
FxRategetCrossCcy in interface FxRatepublic boolean isMarketConvention()
FxRateisMarketConvention in interface FxRatepublic BigDecimal getMid()
FxRatepublic BigDecimal getBidInMarketConvention()
FxRategetBidInMarketConvention in interface FxRatepublic BigDecimal getMidInMarketConvention()
FxRategetMidInMarketConvention in interface FxRatepublic BigDecimal getAskInMarketConvention()
FxRategetAskInMarketConvention in interface FxRatepublic CurrencyAmount convertAmountUsingMid(CurrencyAmount originalAmount)
FxRateconvertAmountUsingMid in interface FxRateoriginalAmount - the monetary amount (currency + amount)public CurrencyAmount convertAmountUsingBidOrAsk(CurrencyAmount originalAmount)
FxRateconvertAmountUsingBidOrAsk in interface FxRateoriginalAmount - the monetary amount (currency + amount)public CurrencyAmount getPaymentAmountForBuying(CurrencyAmount amountToBuy)
getPaymentAmountForBuying in interface FxRateamountToBuy - amount you want to buy.public CurrencyAmount getReceiptAmountForSelling(CurrencyAmount amountToSell)
getReceiptAmountForSelling in interface FxRateamountToSell - amount you want to sell.Copyright © 2006–2022 Appendium - Portfolio Financing Platform. All rights reserved.