4.4.2OnPriceChange handler

Instead of using the main OnMessage handler, you may find it easier to watch price changes using an OnPriceChange handler. If defined, this is called by the framework with each individual price (not an array/list) which is changing:

Framework.OnPriceChange = function(quote) {

// The quote object contains the same time, bid, ask etc properties listed above.

// Instrument which is changing is in quote.instrumentId.

// Prices are in quote.ask and quote.bid etc.

};

The quote object which is passed to OnPriceChange() has the following properties:

Property

Description

instrumentId

ID of the instrument, such as EUR/USD

time

Time of the most recent quote

bid

Latest bid price

ask

Latest ask price

high

High of the current period. Availability depends on account features.

low

Low of the current period. Availability depends on account features.

change

Change amount during the current period. Availability depends on account features.

changePc

Change amount as a percentage. Availability depends on account features.