Matlab 2018 IB TWS Sending Market Order Failure : cannot find method 'placeOrderEx' for class 'COM.TWS_TwsCtrl'

1 次查看(过去 30 天)
Hi guys,
I am trying to send market order to purchase 1 ES contract, using Trading Tool box command, and encountered error message : cannot find method 'placeOrderEx' for class 'COM.TWS_TwsCtrl',
I'm using Matlab 2018a, the code can connect to TWS, any body has seen this before ?
ib = ibtws('',7496);
pause(0.2)
ibContract = ib.Handle.createContract;
ibContract.symbol = 'ES'; % 'SPXL';
ibContract.secType = 'FUT'; % 'STK';
ibContract.exchange = 'GLOBEX'; % 'SMART'; 'GLOBEX'; 'ECBOT' for YM contract
ibContract.currency = 'USD'; % 'USD';
ibContract.LastTradeDateOrContractMonth = '201903';
ibMktOrder = ib.Handle.createOrder;
ibMktOrder.action = 'BUY'; % 'BUY';
ibMktOrder.totalQuantity = 1; % 100;
ibMktOrder.orderType = 'MKT'; % 'MKT' or 'LMT'
%%% Send Order
id = orderid(ib);
result_send_order = createOrder(ib,ibContract,ibMktOrder,id);
Best regards
Terry

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Financial Toolbox 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by