public final class ResolvedFxSwap extends Object implements ResolvedProduct, org.joda.beans.ImmutableBean, Serializable
This is the resolved form of FxSwap and is an input to the pricers.
Applications will typically create a ResolvedFxSwap from a FxSwap
using FxSwap.resolve(ReferenceData).
A ResolvedFxSwap is bound to data that changes over time, such as holiday calendars.
If the data changes, such as the addition of a new holiday, the resolved form will not be updated.
Care must be taken when placing the resolved form in a cache or persistence layer.
| Modifier and Type | Class and Description |
|---|---|
static class |
ResolvedFxSwap.Meta
The meta-bean for
ResolvedFxSwap. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
ResolvedFxSingle |
getFarLeg()
Gets the foreign exchange transaction at the later date.
|
ResolvedFxSingle |
getNearLeg()
Gets the foreign exchange transaction at the earlier date.
|
int |
hashCode() |
static ResolvedFxSwap.Meta |
meta()
The meta-bean for
ResolvedFxSwap. |
ResolvedFxSwap.Meta |
metaBean() |
static ResolvedFxSwap |
of(ResolvedFxSingle nearLeg,
ResolvedFxSingle farLeg)
Creates a
ResolvedFxSwap from two legs. |
static ResolvedFxSwap |
ofForwardPoints(CurrencyAmount amountCurrency1,
Currency currency2,
double nearFxRate,
double forwardPoints,
LocalDate nearDate,
LocalDate farDate)
Creates a
ResolvedFxSwap using forward points. |
String |
toString() |
public static ResolvedFxSwap of(ResolvedFxSingle nearLeg, ResolvedFxSingle farLeg)
ResolvedFxSwap from two legs.
The transactions must be passed in with payment dates in the correct order. The currency pair of each leg must match and have amounts flowing in opposite directions.
nearLeg - the earlier legfarLeg - the later legpublic static ResolvedFxSwap ofForwardPoints(CurrencyAmount amountCurrency1, Currency currency2, double nearFxRate, double forwardPoints, LocalDate nearDate, LocalDate farDate)
ResolvedFxSwap using forward points.
The FX rate at the near date is specified as fxRate.
The FX rate at the far date is equal to fxRate + forwardPoints
The two currencies must not be equal. The near date must be before the far date. Conventions will be used to determine the base and counter currency.
amountCurrency1 - the amount of the near leg in the first currencycurrency2 - the second currencynearFxRate - the near FX rate, where (1.0 * amountCurrency1 = fxRate * amountCurrency2)forwardPoints - the forward points, where the far FX rate is (fxRate + forwardPoints)nearDate - the near value datefarDate - the far value datepublic static ResolvedFxSwap.Meta meta()
ResolvedFxSwap.public ResolvedFxSwap.Meta metaBean()
metaBean in interface org.joda.beans.Beanpublic ResolvedFxSingle getNearLeg()
This provides details of a single foreign exchange at a specific date. The payment date of this transaction must be before that of the far leg.
public ResolvedFxSingle getFarLeg()
This provides details of a single foreign exchange at a specific date. The payment date of this transaction must be after that of the near leg.
Copyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.