Closed Sortospino closed 1 year ago
So I replaced line 45 of AccountSummaryExample with
% establish connection with TWS status = session.eClientSocket.isConnected(); if status==0 session.eClientSocket.eConnect('127.0.0.1',portNum,0); end pause(1); %let it connect before more requests
@Sortospino
Take away the line javaaddpath(fullfile(pwd,'Jar','tws-101201.jar'))
.
You can't use both jar-files and so far I don't know if anyone has been able to connect to the TWS with the tws-101201.jar file (I at least haven't). Let us know if the problem persists afterwards.
addpath(path,pwd); addpath(path,fullfile(pwd,'docs')) javaaddpath(fullfile(pwd,'Jar','TWS973.jar')) javaaddpath(fullfile(pwd,'Jar','tws-101201.jar'))
(no problems here) %javaaddpath(fullfile(pwd,'Jar','TWS.jar')) --reference from document
but when I do AccountSummaryExample
seems working now! thank you!
I followed the instructions and I added the paths addpath(path,pwd); addpath(path,fullfile(pwd,'docs')) javaaddpath(fullfile(pwd,'Jar','TWS973.jar')) javaaddpath(fullfile(pwd,'Jar','tws-101201.jar'))
(no problems here) %javaaddpath(fullfile(pwd,'Jar','TWS.jar')) --reference from document
but when I do AccountSummaryExample
the prompt says:
added interface method: TWSNotification notification listener has been added -1 504 Not connected
-1 502 Couldn't connect to TWS. Confirm that "Enable ActiveX and Socket Clients" is enabled and connection port is the same as "Socket Port" on the TWS "Edit->Global Configuration...->API->Settings" menu. Live Trading ports: TWS: 7496; IB Gateway: 4001. Simulated Trading ports for new installations of version 954.1 or newer: TWS: 7497; IB Gateway: 4002
Error using AccountSummaryExample (line 56) Java exception occurred: org.apache.commons.collections.BufferUnderflowException: The buffer is already empty
same if i do session.eClientSocket.eConnect('127.0.0.1',7497,0)
what am I doing wrongly?
Windows 10, matlab R2020a