www.gusucode.com > trading工具箱matlab源码程序 > trading/tradingdemos/TTPriceListUpdateExample.m

    %%X_TRADER Price List Update example

%   Copyright 2011-2012 The MathWorks, Inc.

%Start or connect to X_TRADER
x = xtrdr;

%Create event notifier
x.createNotifier;

%Create an instrument
x.createInstrument('Exchange','CME','Product','2F','ProdType','Future','Contract','Oct14','Alias','PriceListInstrument1');

%Attach instruments to a notifier
x.InstrNotify(1).AttachInstrument(x.Instrument(1));

%Define events
x.InstrNotify(1).registerevent({'OnPriceListUpdate',@(varargin)ttpricelistupdate(varargin{:},x)})

%Listen for event data
x.Instrument(1).Open(0);