2.11.1Framework.Account properties

The Framework.Account has the following properties. To watch for changes in the account metrics - balance, equity etc - you can use an OnMessage() handler.

Property

Type

Description

accountId

Text

ID for the account. Broker-dependent, and not necessarily numeric.

caption

Text

User-defined caption for the account, created on the MyTrader login screen

depositCurrency

Text

Deposit currency of the account

currencySymbol

Text

A suggested display symbol for the depositCurrency. For example, $ for US dollar, £ for sterling, A$ for Australian dollar

accountReadOnly

Boolean

Boolean indicating whether access to the account is read-only, and all trading requests will fail (e.g. logged in to an MT4 or MT5 account using the read-only "investor" password)

balance

Number

Current account balance

equity

Number

Current account equity: cash balance plus/minus the profit on any open trades

floatingPL

Number

Current profit/loss on open trades

usedMargin

Number

Margin currently in use

freeMargin

Number

Margin currently free and available for use

isSpreadBet

Boolean

Boolean value indicating whether the account is spread-bet, and a UI will typically want to display a caption such as "£pp" for trade-volume fields. Note: this setting is not entirely reliable. It can have false-negatives. Some broker platforms do not report whether accounts are spread-betting or not, and isSpreadBet will always be false. See also the comments in relation to FXB.Instrument values on spread-bet accounts.

defaultInstrumentId

Text

Suggested instrumentId of the default instrument for widgets/scripts to use if they need to display a market and don't have an existing user selection. Usually "EUR/USD".

features

See below

A block of sub-properties describing the capabilities of the account