Save data from MultiCharts in a MySQL database?

Studies that have been contributed to the community by other users. If you’ve got something useful to share, that’s great!
Laurent
Posts: 159
Joined: 20 Nov 2010
Location: France
Has thanked: 76 times
Been thanked: 32 times

Save data from MultiCharts in a MySQL database?

Postby Laurent » 10 Mar 2012

Is there an easy way to save data from MultiCharts (indicator values, price, ...) in a MySQL database ?

Is there any kind of MySQL connector ?

User avatar
TJ
Posts: 6523
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 957 times
Been thanked: 1883 times

Re: Save data from MultiCharts in a MySQL database?

Postby TJ » 10 Mar 2012

Laurent wrote:Is there an easy way to save data from MultiCharts (indicator values, price, ...) in a MySQL database ?

Is there any kind of MySQL connector ?

How often do you want to save the data? Real time? Once a day? Once a week?


You can try

FILE > EXPORT DATA

Laurent
Posts: 159
Joined: 20 Nov 2010
Location: France
Has thanked: 76 times
Been thanked: 32 times

Re: Save data from MultiCharts in a MySQL database?

Postby Laurent » 10 Mar 2012

In fact TJ,

I would like to save data of indicators each hour of a trading day.
Each hour, I would like to plot my indicators/signals and to save their results in a MySQL database.

But I have 2 problems with what I want to do:

1. Is there a way to do some automations with MultiCharts?
I don't think so ;'(. So I'm using Autoit (crappy I know, but it's the only way isn't it?)

2. Is there a way to save data in a MySQL database without doing it manually. The best way to do it would be to access to the database via PowerLanguage ? When I attach my indicators, they are calculated and they save their value in a MySQL db?

Well, not so easy to achieve ;'(

NB: I dream of a scripting language in MultiCharts to automate some actions :) Just click on the batch to execute a serie of actions.... Sniff I'm dreaming ;'(

User avatar
TJ
Posts: 6523
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 957 times
Been thanked: 1883 times

Re: Save data from MultiCharts in a MySQL database?

Postby TJ » 10 Mar 2012

Laurent wrote:In fact TJ,

I would like to save data of indicators each hour of a trading day.
Each hour, I would like to plot my indicators/signals and to save their results in a MySQL database.

But I have 2 problems with what I want to do:

1. Is there a way to do some automations with MultiCharts?
I don't think so ;'(. So I'm using Autoit (crappy I know, but it's the only way isn't it?)

2. Is there a way to save data in a MySQL database without doing it manually. The best way to do it would be to access to the database via PowerLanguage ? When I attach my indicators, they are calculated and they save their value in a MySQL db?

Well, not so easy to achieve ;'(

NB: I dream of a scripting language in MultiCharts to automate some actions :) Just click on the batch to execute a serie of actions.... Sniff I'm dreaming ;'(


You can use the PRINT keyword to automatically export any data any time to a text file,
then have your SQL to retrieve whatever it needs from the text file.

Laurent
Posts: 159
Joined: 20 Nov 2010
Location: France
Has thanked: 76 times
Been thanked: 32 times

Re: Save data from MultiCharts in a MySQL database?

Postby Laurent » 10 Mar 2012

Thanks TJ,

That's the way I'm going to do it.
But that's really not easy :-(

User avatar
TJ
Posts: 6523
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 957 times
Been thanked: 1883 times

Re: Save data from MultiCharts in a MySQL database?

Postby TJ » 10 Mar 2012

or, write a SQL routine to read GV values from MultiCharts.

Laurent
Posts: 159
Joined: 20 Nov 2010
Location: France
Has thanked: 76 times
Been thanked: 32 times

Re: Save data from MultiCharts in a MySQL database?

Postby Laurent » 10 Mar 2012

Maybe that can be use:
http://www.interalia-bg.eu/EN/TSmySQL-en.html

I'm going to mail him!

User avatar
JoshM
Posts: 2075
Joined: 20 May 2011
Location: The Netherlands
Has thanked: 1523 times
Been thanked: 1480 times
Contact:

Re: Save data from MultiCharts in a MySQL database?

Postby JoshM » 14 Mar 2012

TJ wrote:or, write a SQL routine to read GV values from MultiCharts.

Meaning that another program can read the global variables as set by MultiCharts? That's quite interesting.

Do you perhaps know of any examples or references about this? Google searching didn't turn up anything.

RWDickinson
Posts: 43
Joined: 01 Dec 2008
Has thanked: 2 times
Been thanked: 2 times

Re: Save data from MultiCharts in a MySQL database?

Postby RWDickinson » 25 Jul 2012

JoshM wrote:
Meaning that another program can read the global variables as set by MultiCharts? That's quite interesting. Do you perhaps know of any examples or references about this? Google searching didn't turn up anything.


[edited version] Josh, I didn't think another program would be able to access the GV data unless it was run in the MC address space. But I was wrong. See the "Notes on Global Variables" topic in this forum. I guess the GV .dll is specially written to keep its data in a separate address space so it will be available system-wide. In that case any program can access it the same way it would call any other .dll.


Return to “User Contributed Studies and Indicator Library”