You can listen for changes in prices, the order list, account metrics etc using an
Framework.OnMessage = function(Msg) {
if (Msg.is(FXB.MessageTypes.PRICE)) {
… update a quote board
}
};
Some types of message such as changes to account metrics are issued automatically. Other types of message, such as prices or account history, must be specifically requested by your widget/script/UDIX.
By the time that message handlersare called, the framework's objects and collections have already been updated. For example, if you receive an
As well as using the main
It's possible for your code to have multiple message handlers (each of which receives all messages). You can do the following as well as or instead of using
var handler1 = Framework.AddMessageHandler(function (Msg) { … a handler function});
var handler2 = Framework.AddMessageHandler(function (Msg) { … a second handler });
The return value from
Framework.RemoveMessageHandler(handler1);
Note: you may observe that everything passes through