This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Listen for X_TRADER Price Updates

This example shows how to connect to X_TRADER® and listen for price update event data.

Connect to X_TRADER

X = xtrdr;

Create an Event Notifier

The event notifier is the X_TRADER mechanism that lets you define MATLAB® functions to use as callbacks for specific events.


Create an Instrument

Create an instrument and attach it to the notifier.


Define Events

Assign callbacks for validating or invalidating an instrument, and for handling data updates for a previously validated instrument.


Monitor Events

Set the update filter to monitor the desired fields. In this example, events are monitored for updates to last price, last quantity, previous last quantity, and a change in prices. Listen for this event data.

X.InstrNotify(1).UpdateFilter = 'Last$,LastQty$,~LastQty$,Change$';

The last command tells X_TRADER to start monitoring the attached instruments using the specified event settings.

Close the Connection


See Also

| | |

Related Examples

More About