Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
trying to interface matlab with interactive brokers

Subject: trying to interface matlab with interactive brokers

From: Nate Jensen

Date: 19 Mar, 2011 04:59:04

Message: 1 of 6

I am trying to interface interactive brokers with Matlab.

At the moment, I am trying to do this through some code found on this site:
http://matlab-ib-trading.blogspot.com/2010/08/matlab-ib-historical-data.html

Unfortunately I keep getting this error:

??? Error using ==> feval
Input PROGID does not represent an Activex control.
If this PROGID used to work before, please check vendor's
documentation for equivalent activex control progid.

Error in ==> C:\Program
Files\MATLAB\R2010b\toolbox\matlab\winfun\actxcontrol.p>actxcontrol/createControl at 208


Error in ==> C:\Program Files\MATLAB\R2010b\toolbox\matlab\winfun\actxcontrol.p>actxcontrol at 179


Error in ==> tws_Connect at 8
tws = actxcontrol('TWS.TwsCtrl.1',[0 0 0 0],f,'tws_Event');

Error in ==> tws_conn_hdata_demo at 5
[f tws] = tws_Connect();

I think this is because I have not added the activex api component of interactive broker's trading work station correctly to windows but I have no clue what I am doing right now.

Any ideas?

Subject: trying to interface matlab with interactive brokers

From: Steven_Lord

Date: 21 Mar, 2011 14:57:17

Message: 2 of 6



"Nate Jensen" <natejensen88@gmail.com> wrote in message
news:im1d6o$7pr$1@fred.mathworks.com...
> I am trying to interface interactive brokers with Matlab.

If I remember correctly I believe Yair Altman's done some work in that area.

http://www.mathworks.com/matlabcentral/newsreader/author/88835

--
Steve Lord
slord@mathworks.com
To contact Technical Support use the Contact Us link on
http://www.mathworks.com

Subject: trying to interface matlab with interactive brokers

From: Nate Jensen

Date: 21 Mar, 2011 16:54:07

Message: 3 of 6

"Steven_Lord" <slord@mathworks.com> wrote in message <im7ov8$8js$1@fred.mathworks.com>...
> If I remember correctly I believe Yair Altman's done some work in that area.
>
> http://www.mathworks.com/matlabcentral/newsreader/author/88835
>
> --
> Steve Lord
> slord@mathworks.com
> To contact Technical Support use the Contact Us link on
> http://www.mathworks.com

Thank you, and I have seen before that he has created an interface, and I am sure that his work is very high quality. The only problem that I have is that it is kind of expensive. He has also stated that he is not willing to distribute his work freely, so I think that is out of the question. Do you know of a link where he has posted some of his code? I could not find one.

Thank you though. I appreciate the help.

Subject: trying to interface matlab with interactive brokers

From: Yair Altman

Date: 21 Mar, 2011 19:38:07

Message: 4 of 6

"Nate Jensen" wrote in message <im7vrf$e6i$1@fred.mathworks.com>...
> "Steven_Lord" <slord@mathworks.com> wrote in message <im7ov8$8js$1@fred.mathworks.com>...
> > If I remember correctly I believe Yair Altman's done some work in that area.
> >
> > http://www.mathworks.com/matlabcentral/newsreader/author/88835
> >
> > --
> > Steve Lord
> > slord@mathworks.com
> > To contact Technical Support use the Contact Us link on
> > http://www.mathworks.com
>
> Thank you, and I have seen before that he has created an interface, and I am sure that his work is very high quality. The only problem that I have is that it is kind of expensive. He has also stated that he is not willing to distribute his work freely, so I think that is out of the question. Do you know of a link where he has posted some of his code? I could not find one.
>
> Thank you though. I appreciate the help.


My IB-Matlab application is described here: http://UndocumentedMatlab.com/IB-Matlab
Regarding the cost, I believe that it is the least expensive of all the commercial alternatives. It is certainly a small sum for an active trader or automated trading algorithm developer.

Moreover, are the dozens of hours it would take you to develop and test a comparable application not worth the monetary cost? Your work time cannot be that cheap.

I expect it will be difficult to find a free working application for active trading. Matlab is not free; IB is not free; trading is not free; people make huge investments and profits in algorithmic trading black-boxes - so why should the IB-Matlab trading platform be free???

For the record, IB-Matlab is Java (not ActiveX) based. As such, it works on all platforms where both Matlab and TWS run, including 64-bit Windows and Linux where ActiveX is problematic.

Best regards and good luck in your trading,

Yair Altman
http://UndocumentedMatlab.com

Subject: trying to interface matlab with interactive brokers

From: Timothy McGarvey

Date: 24 Mar, 2011 10:17:05

Message: 5 of 6

I have had similar issues with interfacing between Matlab and IB and received the same error messages that the person who wrote the first thread described. The cause in my case was that I was running a 64-bit version of Matlab and the ActiveX dlls are 32-bit only (as is the whole IB platform). So, the only way to use the IB ActiveX API to interface with Matlab is with a 32-bit version of Matlab.

"Yair Altman" wrote in message <im89ev$7su$1@fred.mathworks.com>...
> "Nate Jensen" wrote in message <im7vrf$e6i$1@fred.mathworks.com>...
> > "Steven_Lord" <slord@mathworks.com> wrote in message <im7ov8$8js$1@fred.mathworks.com>...
> > > If I remember correctly I believe Yair Altman's done some work in that area.
> > >
> > > http://www.mathworks.com/matlabcentral/newsreader/author/88835
> > >
> > > --
> > > Steve Lord
> > > slord@mathworks.com
> > > To contact Technical Support use the Contact Us link on
> > > http://www.mathworks.com
> >
> > Thank you, and I have seen before that he has created an interface, and I am sure that his work is very high quality. The only problem that I have is that it is kind of expensive. He has also stated that he is not willing to distribute his work freely, so I think that is out of the question. Do you know of a link where he has posted some of his code? I could not find one.
> >
> > Thank you though. I appreciate the help.
>
>
> My IB-Matlab application is described here: http://UndocumentedMatlab.com/IB-Matlab
> Regarding the cost, I believe that it is the least expensive of all the commercial alternatives. It is certainly a small sum for an active trader or automated trading algorithm developer.
>
> Moreover, are the dozens of hours it would take you to develop and test a comparable application not worth the monetary cost? Your work time cannot be that cheap.
>
> I expect it will be difficult to find a free working application for active trading. Matlab is not free; IB is not free; trading is not free; people make huge investments and profits in algorithmic trading black-boxes - so why should the IB-Matlab trading platform be free???
>
> For the record, IB-Matlab is Java (not ActiveX) based. As such, it works on all platforms where both Matlab and TWS run, including 64-bit Windows and Linux where ActiveX is problematic.
>
> Best regards and good luck in your trading,
>
> Yair Altman
> http://UndocumentedMatlab.com

Subject: trying to interface matlab with interactive brokers

From: Prashant bajpayee

Date: 8 Jun, 2011 12:56:06

Message: 6 of 6

HI
I am able to use those code and it connects with IB API. But I am getting error in requesting historical data. I have dropped a message to author and waiting for his reply.
Will keep you updated on this.

regards
Prashant

"Nate Jensen" wrote in message <im1d6o$7pr$1@fred.mathworks.com>...
> I am trying to interface interactive brokers with Matlab.
>
> At the moment, I am trying to do this through some code found on this site:
> http://matlab-ib-trading.blogspot.com/2010/08/matlab-ib-historical-data.html
>
> Unfortunately I keep getting this error:
>
> ??? Error using ==> feval
> Input PROGID does not represent an Activex control.
> If this PROGID used to work before, please check vendor's
> documentation for equivalent activex control progid.
>
> Error in ==> C:\Program
> Files\MATLAB\R2010b\toolbox\matlab\winfun\actxcontrol.p>actxcontrol/createControl at 208
>
>
> Error in ==> C:\Program Files\MATLAB\R2010b\toolbox\matlab\winfun\actxcontrol.p>actxcontrol at 179
>
>
> Error in ==> tws_Connect at 8
> tws = actxcontrol('TWS.TwsCtrl.1',[0 0 0 0],f,'tws_Event');
>
> Error in ==> tws_conn_hdata_demo at 5
> [f tws] = tws_Connect();
>
> I think this is because I have not added the activex api component of interactive broker's trading work station correctly to windows but I have no clue what I am doing right now.
>
> Any ideas?

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us