4.7.1ACCOUNT_METRICS message in OnMessage

The ACCOUNT_METRICS message is issued about changes to the metrics in Framework.Account - change in floating P/L, margin usage etc.

The FXB.Message object will contain an accountMetrics object. The properties of Msg.accountMetrics correspond to the properties in the Framework.Account, but it only contains values which are changing. For example, for a change of floating P/L without a new closed trade which affects the balance, the accountMetrics will include a floatingPL property but not a balance property.

You can also inspect what has changed using an updateMarker in the accountMetrics. This is a bit-mask describing which metrics have changed. The possible flags are members of the FXB.UpdateFlags enumeration:

FXB.UpdateFlags.

Description

FLAG_ACCOUNT_FLOATINGPL

Change to floating P/L

FLAG_ACCOUNT_EQUITY

Change to equity (should always also imply FLAG_ACCOUNT_FLOATINGPL)

FLAG_ACCOUNT_BALANCE

Change to balance

FLAG_ACCOUNT_USEDMARGIN

Change to margin in use

FLAG_ACCOUNT_FREEMARGIN

Change to free margin

FLAG_ACCOUNT_CREDIT

Change to account credit