Storing critical values in database

Questions about MultiCharts and user contributed studies.
vking
Posts: 235
Joined: 21 May 2009
Has thanked: 51 times
Been thanked: 41 times

Storing critical values in database

Postby vking » 23 May 2012

Hello - I am in the process of trying to determine if it is possible to store(and potentially retrieve) certain values in SQL server database(or any other database) for further statistical analysis. Has any one done it using Power Language by using any external dll's or other means? I can think of c++ external dll based solution for this but not good at making these external dll's. Wondering if anyone has done this kind of work in the past.

Thanks

Fabrice
Posts: 182
Joined: 14 Jun 2011
Has thanked: 44 times
Been thanked: 30 times

Re: Storing critical values in database

Postby Fabrice » 23 May 2012

Not done but have thought about it 1 year ago. Then gave-up because MC is not fit to do that "easily" (but MC is not alone in this case).

For what I know, this would probably requires at least:
1) an API for accessing data stored in MC databases
2) another language than EL

For 1), I do not know if TS Support allows it.
For 2), we can hope that it may be easier with MultiCharts.NET

I also remember another third-party "link" between TS & an SQL DB : DBTrader, but never tried it, and probably not working with MultiCharts.

An OO language is really missing...

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

Re: Storing critical values in database

Postby furytrader » 23 May 2012

I would imagine this would be fairly easy to implement in MC.net.

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

Re: Storing critical values in database

Postby arjfca » 24 May 2012

Hello - I am in the process of trying to determine if it is possible to store(and potentially retrieve) certain values in SQL server database(or any other database) for further statistical analysis. Has any one done it using Power Language by using any external dll's or other means? I can think of c++ external dll based solution for this but not good at making these external dll's. Wondering if anyone has done this kind of work in the past.

Thanks
Not an expert, but if I had this project, I would look to use a CSV text file. Look in ELCollection on how to manage file with MC.

Good luck

Martin

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: Storing critical values in database

Postby TJ » 24 May 2012

Hello - I am in the process of trying to determine if it is possible to store(and potentially retrieve) certain values in SQL server database(or any other database) for further statistical analysis. Has any one done it using Power Language by using any external dll's or other means? I can think of c++ external dll based solution for this but not good at making these external dll's. Wondering if anyone has done this kind of work in the past.

Thanks
It can be done.

The database architecture and its complexity depends on a few variables:

1. how much data? 20 data fields per second? 5 per hour?
2. how do you want to retrieve the saved data? during RTH for real time analysis? or offline EOD?
3. how often do you need to retrieve the data? in real time once per second? or excel crunching over the weekend?


if you simply want a set of data (indicator value included) for offline excel analysis, you can export the data anytime at the end of the day. No special tools or programming is needed.
Files > Export data

if you want read and write capabilities, then it will require a bit more work.

vking
Posts: 235
Joined: 21 May 2009
Has thanked: 51 times
Been thanked: 41 times

Re: Storing critical values in database

Postby vking » 24 May 2012

TJ - Thanks for the reply. Here are the details.

1. how much data? 20 data fields per second? 5 per hour?
- the number of records expected are around 50 per day per instrument and total of less than 10 instruments. Each row would have only date/time/price values/short string values. The idea here is to collect this data from various sources and store them in database(central place) - where there would be external program that would be crunching the numbers and would generate the summary data realtime based on the data that is being stored by various sources.

2. how do you want to retrieve the saved data? during RTH for real time analysis? or offline EOD?
- whatever the data being "processed" externally and stored in the database would be fetched back into the MC and represented either through text file on the chart or S/R lines or some other means ( data presentation).

3. how often do you need to retrieve the data? in real time once per second? or excel crunching over the weekend?
- This would be done real time - but data would be fetched at the end of each bar ( theoritically every 5 minutes or so data fetch would happen). The number crunching would happen by external means operating on the collective data that is being populated by various sources.

Please note that I currently use ELC/ADE based solutions but finding it difficult to use MC platform from all aspects ( can't replay the entire market/ no level 2 replay / no trade simulation during replay etc along with many limitations with automated trading ). As I am comfortable with easy language and have spent significant time in building something for myself - wanted to continue use MC/TS for easy language but order execution etc wanted to use something else.

Thanks

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: Storing critical values in database

Postby TJ » 25 May 2012

Looks like this is a job for the professional programmers.

vking
Posts: 235
Joined: 21 May 2009
Has thanked: 51 times
Been thanked: 41 times

Re: Storing critical values in database

Postby vking » 25 May 2012

Thanks TJ.

Well at this point of time - I am only looking for a way to store the indicator output to database from MC :)

Thanks.

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: Storing critical values in database

Postby TJ » 25 May 2012

Thanks TJ.

Well at this point of time - I am only looking for a way to store the indicator output to database from MC :)

Thanks.
You can use PRINT keyword to output variable values to a text file,
your database software can then read from the text file.

vking
Posts: 235
Joined: 21 May 2009
Has thanked: 51 times
Been thanked: 41 times

Re: Storing critical values in database

Postby vking » 25 May 2012

Thanks TJ. In a way I am doing something similar at present. Would explore further on this and see if I can find any other optimal way to handle this.

thanks


Return to “MultiCharts”