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