class O2GOfferTableRow

Parents
O2GOfferRow

Brief

The class provides access to the offer information and calculated fields.

Details

The class represents a single row of the Offers table. In addition to the methods of its parent class, the O2GOfferTableRow class provides methods to access calculated fields, such as cost of one pip per lot.

Prerequisites

The class is available only through the use of the O2GTableManager. The O2GTableManager object must have the O2GTableManagerStatus.TABLES_LOADED status.
For complete instructions on the table manager usage, see the How to use table manager in ForexConnect API section.
After tables are loaded, you must obtain an instance of the O2GOffersTable class. For example,

O2GOffersTable offersTable = (O2GOffersTable)tableManager.getTable(O2GTableType.OFFERS);

Instantiating the class

If you need access to the current offer information, get an instance of the class by calling any of the following methods of the O2GOffersTable class:

O2GOffersTable method

Syntax example

getRow

O2GOfferTableRow offer = offersTable.getRow(i);

findRow

O2GOfferTableRow offer = offersTable.findRow(mOfferID);

getNextRow

O2GOfferTableRow offer = offersTable.getNextRow(mIterator);

getNextRowByColumnValue

O2GOfferTableRow offer = offersTable.getNextRowByColumnValue("InstrumentType", mInstrumentType, mIterator);

getNextRowByColumnValues

O2GOfferTableRow offer = offersTable.getNextRowByColumnValues("PointSize", new Object[] { 0.1, 0.01, 0.001 }, mIterator);

getNextRowByMultiColumnValues

O2GOfferTableRow offer = offersTable.getNextRowByMultiColumnValues(new String[] { "InstrumentType", "TradingStatus" }, new Object[] { mInstrumentType, mTradingStatus }, mIterator);

If you want to track the Offers table updates, your application must have a listener class that implements the IO2GTableListener interface. An instance of the listener class must be subscribed to the table updates. Subscription to each update type is done individually. Before the logout, you must unsubscribe the listener from each update type individually. The examples of subscription/unsubscription syntax are listed below.

IO2GTableListener method

Subscribe syntax

Unsubscribe syntax

onAdded

offersTable.subscribeUpdate(O2GTableUpdateType.INSERT, tableListener);

offersTable.unsubscribeUpdate(O2GTableUpdateType.INSERT, tableListener);

onChanged

offersTable.subscribeUpdate(O2GTableUpdateType.UPDATE, tableListener);

offersTable.unsubscribeUpdate(O2GTableUpdateType.UPDATE, tableListener);

To instantiate the O2GOfferTableRow class, you must cast the rowData parameter of the methods above to the O2GOfferTableRow type. For example,

O2GOfferTableRow row = (O2GOfferTableRow)(rowData);

Example

Get Instrument, Bid/Ask prices and Pip cost [show]

The namespace is com.fxcore2.

Public Methods

getAsk

Gets the current market price an instrument can be bought at.

getAskTradable

Gets the usage of an ask price.

getBid

Gets the current market price an instrument can be sold at.

getBidTradable

Gets the usage of a bid price.

getBuyInterest

Gets the interest amount applied to the account balance for holding a one-lot long (buy) position opened overnight.

getCell

Gets a cell of the table.

getColumns

Gets the columns of the table.

getContractCurrency

Gets the base currency of an instrument.

getContractMultiplier

Gets the contract multiplier for some CFD instruments only.

getDigits

Gets the instrument price precision.

getHigh

Gets the highest ask price (buy price) of an instrument for the current trading day.

getInstrument

Gets the symbol of an instrument.

getInstrumentType

Gets the type of an instrument.

getLow

Gets the lowest bid price (sell price) of an instrument for the current trading day.

getOfferID

Gets the unique identification number of an instrument.

getPipCost

Gets the cost of one pip per lot.

getPointSize

Gets the size of one pip.

getQuoteID

Gets the unique identifier of the pair of prices (bid and ask) an instrument can be traded at.

getSellInterest

Gets the interest amount applied to the account balance for holding a one-lot short (sell) position opened overnight.

getSubscriptionStatus

Gets the subscription status.

getTableType

Gets the type of the table.

getTime

Gets the date and time of the last update of the instrument.

getTradingStatus

Gets the trading status.

getValueDate

Gets the simulated delivery date.

getVolume

Gets a tick volume of the current minute.

isAskTradableValid

Gets the flag indicating whether the AskTradable field is valid or not.

isAskValid

Gets the flag indicating whether the Ask field is valid.

isBidTradableValid

Gets the flag indicating whether the BidTradable field is valid.

isBidValid

Gets the flag indicating whether the Bid field is valid.

isBuyInterestValid

Gets the flag indicating whether the BuyInterest field is valid.

isCellChanged

Gets a flag indicating whether the value of the cell is changed.

isContractCurrencyValid

Gets the flag indicating whether the ContractCurrency field is valid.

isContractMultiplierValid

Gets the flag indicating whether the ContractMultiplier field is valid.

isDigitsValid

Gets the flag indicating whether the Digits field is valid.

isHighValid

Gets the flag indicating whether the High field is valid.

isInstrumentTypeValid

Gets the flag indicating whether the InstrumentType field is valid.

isInstrumentValid

Gets the flag indicating whether the Instrument field is valid or not.

isLowValid

Gets the flag indicating whether the Low field is valid.

isOfferIDValid

Gets the flag indicating whether the OfferID field is valid or not.

isPointSizeValid

Gets the flag indicating whether the PointSize field is valid.

isQuoteIDValid

Gets the flag indicating whether the QuoteID field is valid.

isSellInterestValid

Gets the flag indicating whether the SellInterest field is valid.

isSubscriptionStatusValid

Gets the flag indicating whether the SubscriptionStatus field is valid.

isTimeValid

Gets the flag indicating whether the date and time of the last update of the instrument is valid.

isTradingStatusValid

Gets the flag indicating whether the TradingStatus field is valid.

isValueDateValid

Gets the flag indicating whether the ValueDate field is valid.

isVolumeValid

Gets a flag indicating whether the Volume field is valid or not.

back