[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Increasing the MetaStock(R) Formula Language with MetaStock 7



PureBytes Links

Trading Reference Links

I've noticed several emails lately discussing MetaStock's Formula Language
capabilities.  I would like to take this time to introduce you to a new
feature added in MetaStock 7.  The new MetaStock External Function (MSX)
Application Programming Interface (API), available in the MetaStock
Developer's Kit, allows software developers to dynamically add externally
defined functions to the MetaStock Formula Language, in MetaStock version
7.0 and later.

When MetaStock initializes, it scans a pre-defined folder, looking for any
DLLs that correctly implement the MSX API.  When an MSX DLL is found, the
functions that it implements are automatically added to the MetaStock
Formula Language.
These new functions can be used to create Custom Indicators, Explorations,
System Tests and Expert Advisors using MetaStock's formula tools.
The MSX API supports any programming language that meets the following
criteria:
*	exports DLL functions by name 
*	supports the stdcall stack frame convention
*	creates 32-bit DLLs for Windows 95, Windows 98, or Windows NT
version 4.0 or greater
This type of DLL is commonly called a Win32 DLL.  

Note: Microsoft Visual Basic does not have the capability to produce a Win32
DLL.  Therefore, MSX DLLs cannot be written in Microsoft Visual Basic.   A
good alternative for VB programmers is PowerBASIC, an inexpensive compiled
Basic that is syntax-compatible with VB and can produce Win32 DLLs.
MSX DLL Capabilities
The functions that can be implemented in MSX DLLs are similar in behavior to
the Standard built-in MetaStock functions.  In other words, MSX Functions
can be written to perform calculations based on any available price data or
results of other functions.  All MSX DLL functions return a data array.
This exactly parallels the behavior of the MetaStock built-in functions.
The returned data array can be plotted by Custom Indicators or used in any
way that a standard built-in function can be used.  
MSX DLLs can perform calculations of virtually unlimited complexity.  You
have the full power of conventional programming languages like C or Pascal
with all of their logic, data manipulation and rich flow-control
capabilities.
Things that you can do with an MSX DLL include:
*	Implement functions not provided with MetaStock.
*	Perform complex calculations on price data.
*	Provide multiple functions in a single MSX DLL.
*	Access stored MetaStock price data using MSFL (included in the
MetaStock Developers Kit - see the MSFL documentation for details).
*	Create functions that can be used by Custom Indicators, System
Tests, Explorations, and Experts.
*	Distribute your compiled MSX DLL to other users.

Things that you cannot do with an MSX DLL include:
*	GUI functions including plotting and user dialogs.
*	Access the standard MetaStock built-in functions from within your
DLL.

This capability is already in MetaStock Professional 7.0 and will be in the
upcoming MetaStock End-Of-Day 7.0. The MetaStock Developer's Kit is expected
to be available in late November.  For the latest details periodically check
http://www.equis.com/partners/developers/

Cheryl Elton
Product Development
Equis International, Inc
http://www.equis.com