FXTradeLeg
is a concrete implementation of {@link caplin.trading.trademodel.TradeLeg TradeLeg} that
aims to provide most of the fields typically used for FX Trades. Spot/Forward
{@link caplin.fx.trademodel.FxTrade FxTrade} instances contain a single trade leg, whereas swap instances
contain two.
Attributes | Name and Description |
---|---|
|
caplin.fx.trademodel.FxTradeLeg(caplin.trading.trademodel.Trade oTrade, int nLegId)
Constructs an instance of |
Attributes | Name and Description |
---|---|
|
String
getAskFwdPrice()
Returns the price at which the dealer is willing to sell one unit of the base currency on the defined settlement date. |
|
float
getAskPoints()
Returns the number of Forward Points for the Ask Rate. |
|
String
getAskPrice()
Returns the price at which the dealer is willing to sell one unit of the base currency on the defined settlement date. |
|
String
getAskSpotPrice()
Returns the price at which the dealer is willing to buy one unit of the base currency on the spot date. |
|
String
getAskSwapPoints()
Returns the difference between the near and the far legs ask price |
|
String
getBaseCurrency()
Returns the base currency from the currency pair — this is the first currency within the instrument name. |
|
String
getBidFwdPrice()
Returns the price at which the dealer is willing to buy one unit of the base currency on the defined settlement date. |
|
float
getBidPoints()
Returns the number of Forward Points for the Bid Rate. |
|
String
getBidPrice()
Returns the price at which the dealer is willing to buy one unit of the base currency on the defined settlement date. |
|
String
getBidSpotPrice()
Returns the price at which the dealer is willing to sell one unit of the base currency on the spot date. |
|
String
getBidSwapPoints()
Returns the difference between the near and the far legs bid price |
|
String
getBuySell()
Whether the user has requested only buy side prices, only sell side prices, or prices on both sides. |
|
String
getDealtCurrency()
Returns the currency that relates to the amount within the amount field, and which the trade will be performed in. |
|
String
getFXInstrument()
Returns the complete RTTP subject name that this instrument can be requested with. |
|
void
getFxInstrument()
|
|
int
getMaxTierLimit()
Returns the highest tier limit — this is effectively the highest amount the user can trade. |
|
String
getNotDealtCurrency()
A convenience method that returns the currency from the pair that is not being used as the dealt currency. |
|
String
getOppositeCurrency(String sCurrency)
A convenience method that returns the other currency in a currency pair, given one of the two currencies. |
|
int
getPointsScaleFactor()
Returns the decimal point scaling factor that can be used to help determine the number of decimal places of data that should be shown in the pip segment of the display. |
|
String
getPrice()
Returns either the bid price or the ask price, dependent on the side previously set with #setSide. |
|
String
getSettlementDate()
Returns the date the currencies will be exchanged &mdash also known as the delivery date. |
|
String
getSide()
Returns the side of the trade that the user has chosen to trade on. |
|
String
getTenor()
Returns the tenor, which is a standarized code that can be used to determine the settlement date. |
|
String
getTermCurrency()
Returns the term currency from the currency pair — this is the second currency within the instrument name. |
|
int
getTierLimit()
Returns the tier limit up to which the currently quoted prices will continue to be valid. |
|
boolean
isAskSide()
Returns |
|
boolean
isBidSide()
Returns |
|
boolean
isDealtCurrencyBought()
Returns |
|
boolean
isDealtCurrencySold()
Returns |
|
void
setDealtCurrency(String sValue)
Sets the currency that relates to the amount within the amount field, and which the trade will be performed in. |
|
void
setFXInstrument(String sValue)
Sets the instrument name, which consists of two concatenated 3-digit ISO currency codes (e.g. |
|
void
setInstrument(String sValue)
Sets the instrument name, which consists of two concatenated 3-digit ISO currency codes (e.g. |
|
void
setSettlementDate(String sValue)
Set the settlement date for the trade leg. |
|
void
setSide(String sSide)
Sets whether the user wants to trade at the bid or the ask price. |
|
void
setTenor(String sTenor)
Sets the tenor that logically denotes when the trade will be performed. |
|
void
setTradedPrice(String sTradePrice)
Sets the price the user wishes to trade on — this may be different from the last price received from the server due to the latency in displaying updates to the screen. |
|
void
stop()
|
|
void
toggleDealtCurrency()
Switches the dealt currency between the base and the term currency. |
►
caplin.fx.trademodel.FxTradeLeg(caplin.trading.trademodel.Trade oTrade, int nLegId)
Constructs an instance of caplin.fx.trademodel.FxTradeLeg
.
caplin.trading.trademodel.Trade | oTrade | The trade of which this leg is a part. |
int | nLegId | The (one based) leg index of this trade leg. |
►
String
getAskFwdPrice()
Returns the price at which the dealer is willing to sell one unit of the base currency on the defined settlement date.
►
float
getAskPoints()
Returns the number of Forward Points for the Ask Rate. The number of forward points on a given exchange rate will be determined by the prevailing interest rates, the time period between the spot and forward rate, and other market factors.
►
String
getAskPrice()
Returns the price at which the dealer is willing to sell one unit of the base currency on the defined settlement date.
When the settlement date returned by #getSettlementDate is the spot date then this method returns the same value as #getAskSpotPrice.
►
String
getAskSpotPrice()
Returns the price at which the dealer is willing to buy one unit of the base currency on the spot date.
This method will not return a value when this TradeLeg
is the second leg within the parent
{@link caplin.trading.trademodel.Trade Trade} object.
►
String
getAskSwapPoints()
Returns the difference between the near and the far legs ask price
►
String
getBaseCurrency()
Returns the base currency from the currency pair — this is the first currency within the instrument name.
►
String
getBidFwdPrice()
Returns the price at which the dealer is willing to buy one unit of the base currency on the defined settlement date.
►
float
getBidPoints()
Returns the number of Forward Points for the Bid Rate. The number of forward points on a given exchange rate will be determined by the prevailing interest rates, the time period between the spot and forward rate, and other market factors.
►
String
getBidPrice()
Returns the price at which the dealer is willing to buy one unit of the base currency on the defined settlement date.
When the settlement date returned by #getSettlementDate is the spot date then this method returns the same value as #getBidSpotPrice.
►
String
getBidSpotPrice()
Returns the price at which the dealer is willing to sell one unit of the base currency on the spot date.
This method will not return a value when this TradeLeg
is the second leg within the parent
{@link caplin.trading.trademodel.Trade Trade} object.
►
String
getBidSwapPoints()
Returns the difference between the near and the far legs bid price
►
String
getBuySell()
Whether the user has requested only buy side prices, only sell side prices, or prices on both sides.
This value will be disambiguated and given a specific side, once the user executes the trade using #setSide.
►
String
getDealtCurrency()
Returns the currency that relates to the amount within the amount field, and which the trade will be performed in.
This can be either the dealt currency or the term currency, but initially defaults to being the base currency.
►
String
getFXInstrument()
Returns the complete RTTP subject name that this instrument can be requested with.
►
void
getFxInstrument()
#getFXInstrument
instead.
►
int
getMaxTierLimit()
Returns the highest tier limit — this is effectively the highest amount the user can trade.
►
String
getNotDealtCurrency()
A convenience method that returns the currency from the pair that is not being used as the dealt currency.
If the dealt currency is the base currency, then this method will return the term currency, whereas if the dealt currency is the term currency then this method will return the base currency.
►
String
getOppositeCurrency(String sCurrency)
A convenience method that returns the other currency in a currency pair, given one of the two currencies.
String | sCurrency | A string representation of the currency code (e.g GBP). |
►
int
getPointsScaleFactor()
Returns the decimal point scaling factor that can be used to help determine the number of decimal places of data that should be shown in the pip segment of the display.
►
String
getPrice()
Returns either the bid price or the ask price, dependent on the side previously set with #setSide.
If the user has clicked the bid button, and hence #setSide has been called with "BUY", then the bid price is returned, otherwise the "SELL" price will be returned.
►
String
getSettlementDate()
Returns the date the currencies will be exchanged &mdash also known as the delivery date.
►
String
getSide()
Returns the side of the trade that the user has chosen to trade on.
►
String
getTenor()
Returns the tenor, which is a standarized code that can be used to determine the settlement date.
Example tenors are:
►
String
getTermCurrency()
Returns the term currency from the currency pair — this is the second currency within the instrument name.
►
int
getTierLimit()
Returns the tier limit up to which the currently quoted prices will continue to be valid.
The prices quoted are dependent on the amount traded; generally, the greater the amount, the greater the unit price becomes since it requires the dealer to take a greater exposure to change within the market. The tier limit is the largest amount at which the current price will continue to be valid — if an amount larger than this is set (using #setAmount), then the quoted prices will update to reflect the new pricing tier.
►
boolean
isAskSide()
Returns true
if the user is trading on the ask side — i.e. buying the base currency.
►
boolean
isBidSide()
Returns true
if the user is trading on the bid side — i.e. selling the base currency.
►
boolean
isDealtCurrencyBought()
Returns true
if the dealt currency is being bought.
Whether this is a buy or sell from the traders perspective, rather than a bid or ask, as it is from the dealers perspective.
►
boolean
isDealtCurrencySold()
Returns true
if the dealt currency is being sold.
Whether this is a buy or sell from the traders perspective, rather than a bid or ask, as it is from the dealers perspective.
►
void
setDealtCurrency(String sValue)
Sets the currency that relates to the amount within the amount field, and which the trade will be performed in.
String | sValue | A string representation of the currency code (e.g GBP). |
►
void
setFXInstrument(String sValue)
Sets the instrument name, which consists of two concatenated 3-digit ISO currency codes (e.g. GBPUSD or EURSEK).
The first code within the instrument name is called the base currency (retrievable via #getBaseCurrency), while the second currency in the instrument name is called the term currency (retrievable via #getTermCurrency).
String | sValue | 6 digit currency pair code. |
►
void
setInstrument(String sValue)
Sets the instrument name, which consists of two concatenated 3-digit ISO currency codes (e.g. GBPUSD or EURSEK).
The first code within the instrument name is called the base currency (retrievable via #getBaseCurrency), while the second currency in the instrument name is called the term currency (retrievable via #getTermCurrency).
String | sValue | 6 digit currency pair code. |
#setFXInstrument
instead.
►
void
setSettlementDate(String sValue)
Set the settlement date for the trade leg.
String | sValue | Date in YYYYMMDD format. |
►
void
setSide(String sSide)
Sets whether the user wants to trade at the bid or the ask price.
If the side is "Bid", then the user is selling the base currency, and buying the term currency. If the side is "Ask", then the user is buying the base currency, and selling the term currency.
String | sSide | A string representation of the side (either "Bid" or "Ask"). |
►
void
setTenor(String sTenor)
Sets the tenor that logically denotes when the trade will be performed.
The trade leg uses the {@link caplin.services.date.BusinessDateProvider BusinessDateProvider} service to calculate the actual settlement date based on the given tenor code.
String | sTenor | The tenor. |
►
void
setTradedPrice(String sTradePrice)
Sets the price the user wishes to trade on — this may be different from the last price received from the server due to the latency in displaying updates to the screen.
String | sTradePrice | Decimal formatted string. |
►
void
stop()
►
void
toggleDealtCurrency()
Switches the dealt currency between the base and the term currency.