4.4FXB.MessageTypes.PRICE and OnPriceChange

You need to request messages for the prices you are interested in. You don't automatically receive notifications about all price changes.

Once you have requested price updates, there are two ways of receiving and processing them:

By using the main OnMessage handler, and listening for the PRICE message

By defining an OnPriceChange handler

There is a subtle difference between these two routes:

PRICE messages may contain other instruments, in addition to those you have requested, in their quotes[] array.

The OnPriceChange handler is guaranteed only to be called in relation to the market(s) you have requested.

There are also differences in the parameters:

A PRICE message contains a quotes[] array, listing multiple changes

Each call to OnPriceChange specifies a single quote, with properties such as instrumentId, ask, and bid directly in the body of the object which is passed to OnPriceChange.