Rank: Newbie
Groups: Registered, Registered Users Joined: 12/9/2005(UTC) Posts: 7
|
hi
Is it possible to read MetaStock Files using C# (EMASTER, F1.DAT, F2.DAT .... )
I want to build an application that read the Intraday stock data from the DMetaStock Files
Thanks
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers, Unverified Users Joined: 10/28/2004(UTC) Posts: 3,111 Location: Perth, Western Australia
Was thanked: 16 time(s) in 16 post(s)
|
Yes it is possible, but you need to have the MetaStock Developers Kit to be able to read the stored data format.
The question that should be asked is, what application are you trying to build? As there is always more than one to skin a cat, there is always more than one way to get the information you need.
If you provide a little more information about what you are trying to achieve, I am sure someone will provide you more help.
wabbit :D
|
|
|
|
Rank: Newbie
Groups: Registered, Registered Users Joined: 12/9/2005(UTC) Posts: 7
|
Thanks to you wabbit
I want to develop a small application that read the MetaStock Data Dir and when ever there is a change in the data it will read the data and store it in SQL Database
Thanks
|
|
|
|
Rank: Member
Groups: Registered, Registered Users Joined: 5/25/2006(UTC) Posts: 13 Location: Brisbane, Australia
|
Hi daydreamsy2k,
Wabbit asked me to respond. I have built a solution that seems to match what you are trying to do. I have build an MSX DLL. You need the MDK for more legal reasons that technical I think. I have two versions of the DLL in fact. One version outputs signals (including last price) directly to a SQL Server 2005 database, the other version outputs the signals to a TCP Server application that does some pre-processing before it writes to the database.e The frist thing you need to decide I think is whether you are going to build your DLL in C++, Delphi or PowerBASIC as the .NET languages and Active DLL's will not work. The DLL needs to be a native win32 DLL with no runtime dependencies. Once you have decided that you can probably create the DLL you need relatively quickly. Seeing as you already know about SQL and C# I wont bother talking about that side of it... the critical part is getting the info you want out of Metastock. I would suggest you look at the TCP (winsock) side of it rather than going direct to the DB... its important to make the round-trip your DLL does as short as possible, and TCP is probably the fastest method.
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 8/13/2005(UTC) Posts: 90
|
jtrevatt,
Somewhere in this forum there was a mention that there seemed to be just one limitation in case of building Dlls in .Net that they could not be updated etc. while MS is running. otherwise . Net is also fine.
Secondly, I feel VC++ 6 may no more be available. Will it not be more advisable to go for .NET.
I will look forward to have your views.
Reaards
SMG
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 8/16/2005(UTC) Posts: 182
|
Hi all,
I am new to MDK and its relevant issues.....
Where can I get the MDK and other relevant resources / knowledge to build up my own DLL? I am eager to learn it...
Thanks!
sa
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers, Unverified Users Joined: 10/28/2004(UTC) Posts: 3,111 Location: Perth, Western Australia
Was thanked: 16 time(s) in 16 post(s)
|
spaceant,
You can purchase the MDK only directly from Equis. They will provide the MDK which has a users manual that contains some sample code. You have to have your own language compiler, C++, PowerBasic or Delphi to write MSX external functions, these or VisualBasic to access the MS File Library.
wabbit :D
|
|
|
|
Rank: Newbie
Groups: Registered, Registered Users Joined: 12/9/2005(UTC) Posts: 7
|
Thanks to you all
I do not think i will go with VC++ 6 >>> Because the future is .NET.
Also i do not want to use external dll like msfl80.dll because i have seen one guy succeeded in reading the data out of MetaStock Files using pure Visual Basic .NET (So why not doing it using C#)
So I have started doing some experimants with [ EMASTER , FX.DAT ...] using managed code C# & .NET 2.0
1. I succeseded to read the company names and other info from the EMASTER file
2. Now working with FX.DAT files to read the records for specific company (I have finished 70% of the job required to finish this function )
3. Storing the data in SQL database using C# is just a piece of cake
** I will finish this and show all of you the result that it is possible to do it in C#
|
|
|
|
Rank: Newbie
Groups: Registered, Registered Users Joined: 12/9/2005(UTC) Posts: 7
|
Hi every one
===== WoooooooW I did it 100% working =========
I have developed a DLL using C# .NET 2.0 to completely read the MetaStock data without any external help from another dll or MDK ([color=red:6352ca50a0]Pure Managed Code using C#[/color])
The name of my lovely DLL is [CSharpMetaStock]
=======================================
[ smg ] wrote
[ [color=green:6352ca50a0]Somewhere in this forum there was a mention that there seemed to be just one limitation in case of building Dlls in .Net that they could not be updated etc. while MS is running [/color]]
[color=red:6352ca50a0]Wrong >>> In C# you can use (FileShare.ReadWrite) when you read any file and still it can be accessed and updated by any other application in the same time. (I have tested it)[/color]
========================================
[jtrevatt] wrote
[[color=green:6352ca50a0]I would suggest you look at the TCP (winsock) side of it rather than going direct to the DB... its important to make the round-trip your DLL does as short as possible, and TCP is probably the fastest method.][/color]
[ [color=red:6352ca50a0]I will also do it using TCP[/color]]
========================================
[color=green:6352ca50a0]CSharpMetaStock.DLL[/color]
[color=green:6352ca50a0]Finished[/color] Founctions:
----------------------
1. It can read MetaStock data for both Intraday & History.
2. It can store the data directly in SQL server database if you provide the login info (I need to do more to improve the speed).
3. I can export the MetaStock data in XML format, CSV format, and Binary Format (These are usefull for the History data).
4. The data can be also given as an ArrayList if you want to play with it in C#.
5. (I did it specially for me )It can send you email with the latest reading for the Intraday by email (wooow i love this)
[color=red:6352ca50a0]I will[/color] implement these functions:
1. Send the data using [color=red:6352ca50a0]TCP/IP[/color]
2. Store the data in [color=red:6352ca50a0]Microsoft Access[/color] (piece of cake)
3. [color=red:6352ca50a0]Edit[/color] the MetaStock [color=red:6352ca50a0]History files[/color] (In case you want to correct some reading)
4. [color=red:6352ca50a0]Filter[/color] the data using specific periode of time or date (For Example read the data for the last 5 days or last hour or last minute)
5. >>>>>> [color=blue:6352ca50a0]Any idea you suggest i will try to implement[/color]
6. >>>>>> [color=blue:6352ca50a0]May be i will do Technical Analysis functions like the Moving Average[/color]
========================================
Once i finish, [color=red:6352ca50a0][size=18:6352ca50a0]it will be free for every body[/size:6352ca50a0][/color] .....
It was a small idea >>> but now i will make it [size=18:6352ca50a0]big[/size:6352ca50a0]
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users Joined: 8/13/2005(UTC) Posts: 170
Thanks: 7 times
|
Dear Sir,
Any development work is good for all of us ,moreover you until this hour desire to share it free.Bravo keep it up.
Though this will be of no use to me still i appreciate your spirit.
Regards
Asish
|
|
|
|
Rank: Member
Groups: Registered, Registered Users Joined: 5/25/2006(UTC) Posts: 13 Location: Brisbane, Australia
|
Hi, nice that you are enthusiastic. Just a slight correction though.. if you are replacing a true Metastock external library DLL then you need to exit Metastock before replacing it. Metastock puts a lock on it when it loads. I have experienced this personally. In your situation where your DLL seems not to be hosted by Metastock (is it a DLL still or an EXE?) then it obviously isnt constrained by this. I havent looked at reading metastock files but I guess there is no need for it to be running in-process if you are just polling the files for changes.
J
|
|
|
|
Rank: Newbie
Groups: Registered, Registered Users Joined: 12/9/2005(UTC) Posts: 7
|
jtrevatt wrote:Hi, nice that you are enthusiastic. Just a slight correction though.. if you are replacing a true Metastock external library DLL then you need to exit Metastock before replacing it. Metastock puts a lock on it when it loads. I have experienced this personally. In your situation where your DLL seems not to be hosted by Metastock (is it a DLL still or an EXE?) then it obviously isnt constrained by this. I havent looked at reading metastock files but I guess there is no need for it to be running in-process if you are just polling the files for changes.
J
[color=red:8abebb3337]I did not mention that[/color] i want to replace the true MetaStock library !!!! ( No way .....)
I want to build a library that can be used in C# (managed code) to use the power of .NET
you know that with C#.NET SQL Database, ASP.NET, WebServices, Windows Services are just sooooo easy to implement.
Since i have the source of this CSharpMetaStock, I can use any where like make it work as Windows Services with out a user interface or as and EXE application that do what so every i ask it to do.
[color=red:8abebb3337] After I finish[/color] i will post this (CSharpMetaStock) as DLL and [color=red:8abebb3337]I will post also the source code[/color] for any body want to do more imporvements for [color=red:8abebb3337]Free [/color]
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users Joined: 3/19/2005(UTC) Posts: 2,995
Was thanked: 14 time(s) in 10 post(s)
|
Maybe I'm not understanding the purpose of your dll, but the issue never was using .NET to interact with MSFL, but with MSX. There have been other posts containing examples on how to read and write data into an SQL database using .NET. The 'insurmountable' problem was with MSX. Is this what you have overcome?
|
|
|
|
Rank: Newbie
Groups: Registered, Registered Users Joined: 12/9/2005(UTC) Posts: 7
|
StorkBite wrote:Maybe I'm not understanding the purpose of your dll, but the issue never was using .NET to interact with MSFL, but with MSX. There have been other posts containing examples on how to read and write data into an SQL database using .NET. The 'insurmountable' problem was with MSX. Is this what you have overcome?
1. Read my first post again to understand the purpose [ @ the beginning the purpose was simple but now I have changed my maind to do more functions with this dll ]
2. Where is the post you are talking about for reading the and write data into an SQL database using .NET? (Please give me the link of the post may be it will help me)
3. What i the 'insurmountable problem with MSX? ( Please give more details )
===================================
2. [color=red:2a840e814f]Store the data in Microsoft Access[/color] [color=green:2a840e814f]( DONE )[/color]
( CSharpMetaStock ) can now store the data in Microsoft Access
===================================
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users Joined: 3/19/2005(UTC) Posts: 2,995
Was thanked: 14 time(s) in 10 post(s)
|
Hi DD2K-
I have a keen interest in your topic and I've read this thread more than a couple of times, but I became confused by your references to a .dll project. Certainly, .NET can interact with MSFL. With minor modifications, you can take the VS6 examples out of the MDK user's manual. You don't need to compile a dll to accomplish that task.
To the best of my recall, the aforementioned .NET project was removed from the forum d/l section so the author could pursue commercial development. There are other .NET applications commercially available, too, that interact with MSFL. You might try a Google search.
There are numerous posts on this forum in the Developers Forum about why .NET cannot be used to provide an MSX solution. The issue has been addressed by the Equis programming staff. I thought maybe you had come up with a unique way to accomplish that which wasn't supposed to be possible.
I wish you the best of luck in your current endeavor and look forward to seeing your charpmetastock project.
|
|
|
|
Rank: Member
Groups: Registered, Registered Users Joined: 5/25/2006(UTC) Posts: 13 Location: Brisbane, Australia
|
DD2K, I said that "if you are replacing a true Metastock external library DLL" with an emphasis on the "external". I was referring to a DLL that and user develops that is in compliance with the MSX specification laid out in the MDK. I was not referring to an Equis DLL shipped with Metastock.
In respect to the whole .NET/MSX DLL thing its probably and overdone subject now, but I pretty convinced that a .NET compiled DLL would not work as an MSX compliant DLL to be used in-process by Metastock. Equis have stated numerous times that only a native Win32 DLL would work. Please feel free to create an MSX compliant DLL in C# to prove them wrong. I have no objection to it at all... despite how easy it is to develop one in C++, PowerBASIC or Delphi I would love to use a .NET compiled DLL instead.
I can quite understand how easy it would be to use .NET to access the Metastock file format. All that would be involved would be in understanding the format and parsing out the data to SQL.
I have a question though - why bother? The real usefulness of Metastock is not in the price data you can suck out of it (because you can more easily get the data from another provider), but in how you use that data to make money. Why bother with getting the data out? Why not concentrate on getting your signals/alerts out instead? Im thinking as a trader here more than anything else. I am not in short-supply of data and in order to make money I have to concentrate on my signals/alerts... I just dont see any usefulness in getting the data repackaged.
J
|
|
|
|
Rank: Newbie
Groups: Registered, Registered Users Joined: 12/9/2005(UTC) Posts: 7
|
jtrevatt wrote:
Why bother with getting the data out? Why not concentrate on getting your signals/alerts out instead? Im thinking as a trader here more than anything else. I am not in short-supply of data and in order to make money I have to concentrate on my signals/alerts... I just dont see any usefulness in getting the data repackaged.
J
jtrevatt please do not bother your self with (CSharpMetaStock) because i did not do it for you.
Please Note:
1. I was thinking this forum is for developers who wnat to share ideas with each other.
2. I was developing this because i need it for my self.
3. When i have succeeded, i told my self why not put more functions on this and share it with other who need it or want do some thing in C# .NET ( Because i believe in that if you share your info with others, you gain more knowledge)
4. If you you think that only dll from Equis can do the analysis for you, you are wrong?
(Just look at this site http://www.ta4.net/ )
[Advertisement removed by Administration]
================================================================
[color=red:377e834d4f]End of the sotry:[/color] [ [color=green:377e834d4f]I was trying to help others not to bother any body who do not like the idea[/color] ]
[color=red:377e834d4f][size=18:377e834d4f]There will be no more about this (CSharpMetaStock) in this forum[/size:377e834d4f][/color]
Thanks to all who help me on this
Kind Regards
|
|
|
|
Rank: Member
Groups: Registered, Registered Users Joined: 5/25/2006(UTC) Posts: 13 Location: Brisbane, Australia
|
Hi dd2k,
First I apologize for obviously not phrasing myself properly. You obviously took what I said the wrong way. I believe there are plenty of people in this forum who would love to have access to your work. My question was quite sincere in its intent... that as a trader I would like to know what the value is in what your doing. Im sure you have a good reason to do it, I would just like to know what it is... it may give me ideas of my own. As far your point (4) goes.. I think you misinterpreted me again. The question again was not questioning IF you could do it but WHY you would do it. I can understand that if I put my technical hat on it would be a cool thing to do, but as a trader I have to justify WHY I would do it. How is it going to make me earn money?
Again, these are sincere questions, not confrontational ones.
J
|
|
|
|
Rank: Newbie
Groups: Registered, Registered Users, Subscribers Joined: 10/27/2009(UTC) Posts: 1
|
hi sir, nice work but i want to ask you how can i download this source code to use it.
thanks.
|
|
|
|
Rank: Newbie
Groups: Registered, Registered Users, Subscribers Joined: 7/6/2005(UTC) Posts: 8
|
|
|
|
|
Users browsing this topic |
Guest (Hidden)
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.