Develop 2 external functions using the MetaStock 11 Developers Kit (MSDK 9.1) to save the price data (Open/High/Low/Close/Volume) and the 9 custom arguments passed to the function into a csv file for trade entry and exit signals.
The developer must be familiar with both MetaStock 11 development and the development kit (MSX API to create MSX Win32 DLL’s ) and how to develop external functions using DLL's compatible with MetaStock. The developer must correctly develop the four initialization functions by name that MetaStock uses to query the DLL about the functions that are implemented in the DLL. Extreme care must be taken to ensure that the DLL functions are well behaved and do not cause any fatal exceptions.
The 2 functions that will be placed in an exploration are as follows and will get called for each bar of the exploration for each symbol in the exploration:
count :=ExtFml( [url removed, login to view]("c:\data\test1.csv",ENTRYLONG,1, 9.75,10.00,LIMIT,3,9.25,0.25));
Arguments as follows:
file name (string), trade action and side (string constant ENTRYSHORT, EXITSHORT, ENTRYLONG, EXITLONG) ,entry (numeric constant 0 = no and 1 = yes), entry price 1 (number), entry price 2 (number), order type (string constant OPEN,CLOSE,LIMIT), order duration (int number), day stop (number), ATR (number)
count := ExtFml([url removed, login to view]("c:\data\test1.csv",EXITLONG,1, 10.25,11.00,11.50,LIMIT,9.25,0.25));
Arguments as follows:
file name (string), type (entry or exit string const), trade side (string constant SHORT or LONG) ,exit (numeric constant 0 = no and 1 = yes), exit price 1 (number), exit price 2 (number), exit price 3 (number), order type (string constant OPEN,CLOSE,LIMIT), day stop (number)
On the start of an exploration in MetaStock on a basket of shares, the DLL must create a new file with the given name and then write the data passed in the custom arguments as well as the price and share data to the file for each call for each instrument for each date into the file until the exploration is completed. A separate log file of errors must be created called “file [url removed, login to view]” which should list all errors such as array out of bounds errors etc.
Example of file:
Symbol, name, date, type, side, enter, enter price1, enter price2, order type, order duration, stop, high, low, open, close, volume
X,US Steel,16052011, ENTRYLONG,0, 54.00,54.00,LIMIT,-1,54.00, 0.75,53.75,53.25,53.35,53.65,10000
X,US Steel,16052011, EXITLONG,0, 0.00,0.00,0.00, LIMIT,54.00, 0.75,53.75,53.25,53.35,53.65,10000
X,US Steel,17052011, ENTRYLONG,1, 54.00,54.25,LIMIT,1,52.00, 0.75,54.50,53.55,53.65,54.25,90000
X,US Steel,17052011, EXITLONG,1, 54.25,56.00, 0.00, LIMIT,52.00, 0.75,54.50,53.55,53.65,54.25,90000
X,US Steel,18052011, ENTRYLONG,0, 55.00,55.25,LIMIT,-1,52.00, 0.75,55.00,54.15,54.35,54.65,70000
X,US Steel,18052011, EXITLONG,0, 55.00,55.25, 0.00, LIMIT,52.00, 0.75,55.00,54.15,54.35,54.65,70000
X,US Steel,19052011, ENTRYLONG,0, 55.00,55.25,LIMIT,-1,52.00, 0.75,55.75,54.75,54.85,55.55,60000
X,US Steel,19052011, EXITLONG,1, 0.00,55.50, 0.00, CLOSE,0.00, 0.75,55.75,54.75,54.85,55.55,60000
The DLL must be able to load and unload in both debug and non-debug MetaStock environments. All code and Visual Studio 10 project files needed to compile both debug and runtime versions of the DLL must be provided. All copy write and ownership of the code and DLL’s must be transferred to the project owner from the contractor on final payment.