logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
Webbiz  
#1 Posted : Tuesday, November 23, 2010 8:47:35 PM(UTC)
Webbiz

Rank: Newbie

Groups: Registered, Registered Users
Joined: 11/22/2010(UTC)
Posts: 5

Hello.

I've got the MSFL and have done programming with it successfully using Visual Basic 6 (VB6).

Now, I would like to write an app using Visual Studio 2010 C# language.

I've been hunting all over the Internet trying to find a solution as to how to get Metastock data into an app created by C#. No success.

I've read some have limited success, but then the thread dies.

Since the folks at Metalib sell code controls that allow this, no doubt there is a way.

Any pointers?

Thanks!
Webbiz

haddison  
#2 Posted : Wednesday, November 24, 2010 8:35:07 AM(UTC)
haddison

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 3/6/2010(UTC)
Posts: 113
Location: London

The best I could find is a program called Meta-All, but unfortunately it is written in VB.net and not C#, but at least its better than VB6.
vienna  
#3 Posted : Wednesday, November 24, 2010 9:52:34 AM(UTC)
vienna

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 12/14/2009(UTC)
Posts: 140
Location: Austria

Hello,
search for msfl on koders.com, I never tried this code, but it seems to be a good start...
Webbiz  
#4 Posted : Thursday, November 25, 2010 5:05:04 PM(UTC)
Webbiz

Rank: Newbie

Groups: Registered, Registered Users
Joined: 11/22/2010(UTC)
Posts: 5

Thanks.

I will check it out Vienna.

Really want to stick with C$ and not VB, whether 6 or .net.

:-)


Webbiz  
#5 Posted : Sunday, November 28, 2010 8:16:46 PM(UTC)
Webbiz

Rank: Newbie

Groups: Registered, Registered Users
Joined: 11/22/2010(UTC)
Posts: 5

Okay.

I'm getting closer and closer to a solution.

Using the MSFL.cs file found at Koders, I was able to create the PopulateSecurities routine that lists all the stocks (or whatever the securities happens to be) and list them out in a ListBox.

It also provides all the key code handles, etc.

I had to open one of my VB6 apps to get the logical flow for calling the DLLs and modify my C# code to somewhat duplicate what my VB6 app does.

But I have run into another snag.

Trying to create the PopulatePriceRecs method.

Within this method, I need to LOCK THE SECURITY using MSFL1_LockSecurity.

Unfortunately, it keeps coming back with an error (-247) that is:

"Files are not recognized ver."

I'm confused by this. The files I have are Metastock data files that I download each day from PinnacleData. My VB6 applications all can read this Metastock data just fine. The only difference I can see is that my VB6 is using MSFL651d.dll and my C# code is using MSFL91.dll.

Could this be the reason? And if so, how is the version of data different? Is the Metastock data I am downloading outdated or vice-versa?

Thanks.

vienna  
#6 Posted : Monday, November 29, 2010 3:44:54 AM(UTC)
vienna

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 12/14/2009(UTC)
Posts: 140
Location: Austria

I'm not sure, but maybe you are only allowed to lock security's with the read/write version of the development kit...
or the different dll versions are really the problem. Try to include the MSFL651d.dll into c# instead of the MSFL91.dll

Branden Russell  
#7 Posted : Monday, November 29, 2010 8:54:11 AM(UTC)
Branden Russell

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 11/28/2005(UTC)
Posts: 276
Location: Salt Lake City, UT

vienna wrote:
I'm not sure, but maybe you are only allowed to lock security's with the read/write version of the development kit...

You can only read lock with the read-only version of the MDK. You cannot write, create, update, or delete securities (or lock them to do so) with the read-only copy

vienna wrote:

or the different dll versions are really the problem.

You can use any version of MSFL on any version of file, as long as a different version doesn't already have it locked (read or write). So if you have MetaStock 10 accessing a folder while using MDK 9, they can't read lock the same files. The other restriction is that older versions of the MSFL couldn't write as many securities per folder. So if you're accessing a folder that has more securities than than version is capable of, you'll get errors.

Webbiz  
#8 Posted : Monday, November 29, 2010 10:16:32 AM(UTC)
Webbiz

Rank: Newbie

Groups: Registered, Registered Users
Joined: 11/22/2010(UTC)
Posts: 5

For my VB6 development (of old), I acquired the kit that contained MSFL651d.dll that is still used by my VB6 applications. However, none of these were running on my machine at the time and not accessing any MS files.

I also have Metastock v10 software on my system. However, that charting application was not running either. In fact, I haven't loaded it up in months.

When I went to koders.com and looked at the MSFL files there, I noted that MSFL91.dll was being referenced. So I added that also to my system. I tried changing it to MSFL651d.dll and MSFL10.dll in the dll declarations, but it would bring up incompatibility errors. For MSFL651d, it was due to incompatible parameters, etc.

Anyway, I was following the logic sequence of my VB6 code to write my C# code to load securities and populate the records. Now I'm trying to see if I can follow the approach used by the HappyQ guy with the koder.com code. Hopefully the solution is there somewhere.

Thanks.


haddison  
#9 Posted : Tuesday, March 1, 2011 9:06:31 PM(UTC)
haddison

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 3/6/2010(UTC)
Posts: 113
Location: London

Hi Webbiz I just got MFLib to write a Metastock data file using C#:
Quote:
MFLib.Portfolio PF = new MFLib.Portfolio(@"C:\Metastock Data est",false,true); MFLib.Metafile MySec = PF.NewSecurity("YHOO", "Yahoo Security", new DateTime(1900,1,1)); PF.get_Security("YHOO").AddQuote("12/25/2007", 900, 1200, 300, 100, 0, 1000000); PF.get_Security("YHOO").Save();
I haven't got it to work on Intraday data though. EDIT: I just read your other thread where you said you don't need to write to Metastock files, only read. However the PDF documentation says you can use the MFLib.dll to both read and write.
Users browsing this topic
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.