Effacer les filtres
Effacer les filtres

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

1 vue (au cours des 30 derniers jours)
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

Réponses (0)

Catégories

En savoir plus sur Financial Toolbox dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by