Home > Products > MetaLib

 
 

 

 

 

 

MetaLib V5.0 (for developers) - API for developers for reading/writing MetaStock data

The MetaLib SDK includes functions for reading, writing, editing, inserting, sorting and deleting MetaStock™ price data. It is perfect for software developers wanting to create powerful add-on modules for MetaStock™ users. You have no complexities of accessing MetaStock™ data files from your program. As a result, your development time will be shorter.
 
Features:
Converts MetaStock™ Data e. g. directly into Excel spreadsheets, it's just a matter of seconds. Stock Data (Date, Open, High, Low, Close, Volume, Open interest) of 2000 trading days (around 3000 calendar days,
e.g. more than 8 years) are converted and pasted into Excel within 6 seconds.

MetaLib helps you to search for security name/symbols on your hard disk. You need not know the exact directory name, you only have to enter the root directory (e.g. C:) and MetaLib scans through all subdirectories until the specified name/symbol is found.

Supports Visual Basic (.NET), C++ (.NET), C#, Pascal, Java and Delphi or any other programming language that supports Win32 COM DLLs.

65,500 price data records can be stored per security

Supports the latest MetaStock format version 10.0


Click image to enlarge

Take a look at the following code snippets to see how to use MetaLib in your project!

Reading MetaStock directories
Use the following code to display all securities (name and symbol) of a MetaStock
directory in a message box.
 
Dim Reader As New MLReader
Dim SecInfo As String

Reader.OpenDirectory "C:\MetaStock\Dow30"
Do While (Reader.iMaRecordsLeft > 0)
  Reader.ReadMaster
  SecInfo = SecInfo & Reader.sMaSecName & ", " & Reader.sMaSecSymbol & Chr(13)
Loop
Reader.CloseDirectory
MsgBox (SecInfo)
 
Searching for securities on your harddisk
Following code demonstrates the use of the MLSecurityFinder interface to find securities with specified criterias.
 
On Error GoTo Errorhandler
Dim Finder As New MLSecurityFinder

Finder.bDisplaySearchDialog = True
Finder.bScanSubDirectories = True
Finder.FindSecurity "Micros*", "c:" ' You can use wildchars: * or ?
'Finder.FindSecurity "MSFT", "c:" ' You can also use a symbol

MsgBox (Finder.SecFileName)
Do
  Finder.FindNextSecurity
  MsgBox (Finder.SecFileName)
Loop

Finder.DestroySearchDialog
Exit Sub

Errorhandler:
 If (Err.Number = 1603) Then
   Finder.DestroySearchDialog
  Exit Sub
  End If

How to add MetaLib to your Visual Basic Project

Steps to add MetaLib to your VB/VBA project:

1. Start the Visual Basic-Editor (ALT+F11)
2. Open the References dialog

3. Select the MetaLib 5.0 entry.
4. Close the dialog.
5. [Optional] Add the MetaLibUtil.Bas (C:\…\MetaLib\Include) file to your project.

How to add MetaLib to your VB.NET project 
1. Click on “Project->Add Reference”
2. The “Add Reference” dialog will appear:

3. Double click on the MetaLib 5.0 entry.
4. The MetaLib entry will appear in the “Selected Components” list box.
5. Click on “OK”.

VB.NET example code:


 
Dim Reader As New METALIBLib.MLReader
Reader.OpenDirectory(“C:\MetaStock”)

Reader.ReadMaster()
' Display all securities that are stored in the MS directory

While
(Reader.iMaRecordsLeft > 0)
  Debug.WriteLine(Reader.sMaSecName + "(" + Reader.sMaSecSymbol + ")")
  Reader.ReadMaster()

End
While
Reader.CloseDirectory()
 

Top

How to add MetaLib to your C# Project 
1. Click on “Project->Add Reference”
2. The “Add Reference” dialog will appear:

3. Double click on the MetaLib 5.0 entry.
4. The MetaLib entry will appear in the “Selected Components” list box.
5. Click on “OK”.

For easier use it is recommended that you write the statement “using METALIBLib;” at the top of each “.cs” file where you want to use the DLL.
Use the “new” statement to create a new instance of an interface:

MLReaderClass     lReader = new MLReaderClass ();
MLWriter          lWriter = new MLWriterClass ();

If you do not use the “using METALIBLib;” statement you have to declare the interfaces as shown below:

METALIBLib.MLReaderClass     lReader = new METALIBLib.MLReaderClass ();
METALIBLib.MLWriter          lWriter = new METALIBLib.MLWriterClass ();

Take a look at the C# example that is located in the “C:\Program Files\Metalib\Examples\C#” folder for more details.

How to add MetaLib to your Delphi Project 
1. Click on the Project->Import Type Library menu.
2. The “Import Type Library” dialog will appear.

3. Select the MetaLib 5.0 entry.
4. Make sure that the “Generate Component Wrapper” check box is unchecked.
5. Click on the “Create Unit” button.

How to add MetaLib to your JAVA Project
You need a COM bridge, like the JACOB project (http://danadler.com/jacob) if you want to use MetaLib with JAVA. Download the COM bridge from this site and follow the instructions.

   
 
 
 
 
Copyright 2008, Trading-Tools.com. All Rights Reserved.
All product names are trademarks of their respective owners.