DDE: Is it possible to send data info to Excel using DDE

Questions about MultiCharts and user contributed studies.
arjfca
Posts: 1292
Joined: 23 Nov 2010
Has thanked: 725 times
Been thanked: 223 times

DDE: Is it possible to send data info to Excel using DDE

Postby arjfca » 14 Jul 2011

I'm looking to send High Low and other info to excel. Is it possible to do it using DDE.

I understand that I could received data using DDE, but can I send?

Martin

User avatar
furytrader
Posts: 354
Joined: 30 Jul 2010
Location: Chicago, IL
Has thanked: 155 times
Been thanked: 217 times

Re: DDE: Is it possible to send data info to Excel using DDE

Postby furytrader » 14 Jul 2011

Not sure if you can do that through MultiCharts (I'm not aware of a way), but most real-time data providers (eSignal, CQG, IQFeed.net) allow you to do that directly from the feed.

User avatar
Dave Masalov
Posts: 1712
Joined: 16 Apr 2010
Has thanked: 51 times
Been thanked: 489 times

Re: DDE: Is it possible to send data info to Excel using DDE

Postby Dave Masalov » 15 Jul 2011

Martin,

This can be done using EleXcel library. It is free and can be found on the web.

2haerim
Posts: 502
Joined: 01 Sep 2006
Been thanked: 2 times

Re: DDE: Is it possible to send data info to Excel using DDE

Postby 2haerim » 16 Jul 2011

This can be done using EleXcel library. It is free and can be found on the web.
Dave,

Unfortunately, ELExcel is created for TS which is single-threaded. However, MultiCharts is multi-threaded and it won't work and soon you will get crash or mal-functioning.
ELExcel should be modified to work with multi-threaded program like MultiCharts.

See the comments from engineers below.
Unlike TS, in MC indicators are calculated in separate threads. One thread per chart. ELExcel.dll uses a global object _ApplicationPtr pApplication;, called from the chart thread on the first call of ELXL_Init function. When another chart is created and the same indicator is applied, ELExcel.dll function calls the object _Application created in another thread (of the first chart). So, as a consequence, when calling for any method of this object from the thread, different from that in which it was created, an error is generated ("attempt to call an interface method from another thread"). One of the possible solutions of the issue is to marshal the pointer to the object _Application to every thread where it's called.

arjfca
Posts: 1292
Joined: 23 Nov 2010
Has thanked: 725 times
Been thanked: 223 times

Re: DDE: Is it possible to send data info to Excel using DDE

Postby arjfca » 16 Jul 2011

Hello 2haerim
Unfortunately, ELExcel is created for TS which is single-threaded. However, MultiCharts is multi-threaded and it won't work and soon you will get crash or mal-functioning.
Could you explain in other word what is the problem. I just don't catch this part.

Does it mean that using the same process to work with Excel on two or more charts at the same time it is not possible because info are going to be mixed-up.


I plan to use XLInput from !QCL. It is as been adapted for Multicharts. Don't know it will have the same problem as you mentionned.

Martin

2haerim
Posts: 502
Joined: 01 Sep 2006
Been thanked: 2 times

Re: DDE: Is it possible to send data info to Excel using DDE

Postby 2haerim » 16 Jul 2011

ELExcel package comes with demo workspace and demo Excel files.
With TS, you can open as many Excel workbooks, but with MultiCharts you can't because opening another workbook once after one workbook is opened, it will easily crash because ELExcel is not designed to work in multi-threaded environment.

BTW, can you give me the link XLInput from !QCL. Until someone (maybe me, in the future, but not sure if I will have time) fix it, I would use XLInput if it works with MultiCharts.

thx

arjfca
Posts: 1292
Joined: 23 Nov 2010
Has thanked: 725 times
Been thanked: 223 times

Re: DDE: Is it possible to send data info to Excel using DDE

Postby arjfca » 16 Jul 2011

BTW, can you give me the link XLInput from !QCL. Until someone (maybe me, in the future, but not sure if I will have time) fix it, I would use XLInput if it works with MultiCharts.

thx
http://qclsolutions.com/home/?cat=6

It is not free, 175$. But the software is supported by the creator. It is very good to wrote directly to cells. You could even addressing named cells directly. The only problem, but not caused by Xlinput is reading from Excel. It could be done, but not in a loop. Meaning it could not be use in a direct communication where MC will read on every tick or even 500ms cells in Excel. No problem to read if you do it on an initialization process or an irregular basis.

The other limitation is it will talk with the first instance of Excel. Meaning your Excel file need to be the first one open. You may open other file after, but MC won't be able to talk with them

To get info from Excel, I plan to use Global variable. I will use XLInput to wrote from MC to Excel.

You could send a mail to David Odell, the owner and programmer. He will be better to talk about the capacity and or limitation of XLInput


Return to “MultiCharts”