softwarespartan / IB4m

Interactive Brokers API for Matlab
GNU General Public License v2.0
62 stars 21 forks source link

Installation IB4m and TWS #25

Open cicchello0 opened 6 years ago

cicchello0 commented 6 years ago

I tried to install it, but running AccountSummaryExample, matlab gives me an error (TWS has been started and Api activated):

addpath(path,pwd); addpath(path,fullfile(pwd,'docs')) javaaddpath(fullfile(pwd,'Jar','TWS.jar')) AccountSummaryExample

Undefined variable "com" or class "com.tws.Handler". Error in TWS.Session (line 18) this.handler = com.tws.Handler(); Error in TWS.Session.getInstance (line 94) localInstance = TWS.Session(); Error in AccountSummaryExample (line 9) session = TWS.Session.getInstance();

Because ?

softwarespartan commented 6 years ago

Hi Cicc

Thanks for reaching out.

Can you please elaborate on what version of matlab you are using, what version of TWS you are using, and if you have Mathworks Trading toolbox installed?

The problem is that the jar file is not being found. Can you please try the “javaaddpath” call with the full path to where you have put the TWS.jar file.

Thanks -abel

On Apr 27, 2018, at 7:12 AM, cicchello0 notifications@github.com wrote:

I tried to install it, but running AccountSummaryExample, matlab gives me an error (TWS has been started and Api activated):

addpath(path,pwd); addpath(path,fullfile(pwd,'docs')) javaaddpath(fullfile(pwd,'Jar','TWS.jar')) AccountSummaryExample Undefined variable "com" or class "com.tws.Handler".

Error in TWS.Session (line 18) this.handler = com.tws.Handler();

Error in TWS.Session.getInstance (line 94) localInstance = TWS.Session();

Error in AccountSummaryExample (line 9) session = TWS.Session.getInstance();

Because ?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/softwarespartan/IB4m/issues/25, or mute the thread https://github.com/notifications/unsubscribe-auth/AEWq1FlkFMsK3ONZ7kDsxjkzrrgDroGqks5tsydmgaJpZM4Tqcb2.

cicchello0 commented 6 years ago

The Matlab version is R2012a and TWS 970.1e and I do not use the matlab trading toolbox. The current dynamic path is:

javaclasspath ( '-dynamic' ) DYNAMIC JAVA PATH C:\Program Files\MATLAB\R2012a\Work\IB4m\Jar\TWS.jar

Hello.

softwarespartan commented 6 years ago

Dose that path actually exist?

Meaning is the jar file actually there?

Version 2012a is pretty darn old. Like more than half a decade old (!!)

Likely the version of Java that ships with 2012 a is too old and can’t load the jar file.

Sent from my iPhone

On Apr 27, 2018, at 3:45 PM, cicchello0 notifications@github.com wrote:

The Matlab version is R2012a and TWS 970.1e and I do not use the matlab trading toolbox. The current dynamic path is:

javaclasspath ( '-dynamic' ) DYNAMIC JAVA PATH C:\Program Files\MATLAB\R2012a\Work\IB4m\Jar\TWS.jar

Hello.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.