Developing External DLL's
TradingSolutions can use External DLL’s to provide the processing logic for functions or entry/exit systems. This logic is used instead of the TradingSolutions formula language.
Developing External TradingSolutions DLL’s requires the TradingSolutions SDK Add-on, as well as one of the following development environments:
· Visual Studio 6.0 (VC6.0)
· Visual Studio .NET 2002 (VC7.0)
· Visual Studio .NET 2003 (VC7.1)
TradingSolutions supports development only in Visual C++ at this time.
Creating New Definitions
Functions and Entry/Exit Systems using External DLL’s are created the same as definitions using the TradingSolutions formula language. The primary differences are that the Type on the Basic Information page is set to External TradingSolutions DLL and an external DLL is used instead of a formula or set of rules.
& For general help creating functions, see Writing Your Own Functions.
& For general help creating entry/exit systems, see Writing Your Own Entry/Exit Systems.
Specifying Inputs
The first step to creating a definition using an external DLL is to specify the inputs that will be used by the logic on a bar-by-bar basis. Here are some examples of typical values:
· High, Low, Open, Close, Volume
Any specific raw data column can be used.
Ä Note: TradingSolutions defaults these values to the named field. However, users can technically specify any field.
· Data, Value
A general name, such as "Data" or "Value", can be used to create general functions.
Ä Note: TradingSolutions defaults these values to the Close field.
· Period, Bars, Length
A constant value used for every bar being calculated.
Each input has a Type of Values associated with it. Values like High, Low, Open, Close, and Volume are typically listed as Data Series. Value likes Period are typically listed as Constant (integer only).
Constants can also be specified to be available for optimization of prediction inputs or entry/exit system values.
In addition to named inputs, the date and time of each bar can be included with the inputs. The date information is always included as the last input.
Specifying DLL Information
Each TradingSolutions function or entry/exit system which uses an External DLL actually uses several functions within DLL to provide the required functionality. Each of these functions is named with a common Function Prefix. Therefore, when you specify a function or entry/exit system in an External DLL, you are actually referring to a collection of functions with a common Function Prefix.
External TradingSolutions DLL’s can contain support multiple function prefixes. Typically, if a DLL contains only one function prefix, it will have the same name as the function prefix. However, this is not necessary.
External TradingSolutions DLL’s are typically developed and stored in the Function DLLs subdirectory in a TradingSolutions installation. Development projects are typically created in directories within that subdirectory.
Creating a New DLL Project
Most new External TradingSolutions DLL project and code files are generated using the Generate Template Dialog. This dialog produces code specific to the specified inputs and can be made to include various sample logic.
Once created TradingSolutions can open the selected development environment to edit and compile the project. In most cases, only the actual logic of the function will need to be added to the generated template.
TradingSolutions can also be set to debug the project.
& For help with debugging an external DLL, see the help for the Select External DLL page.
After the definition and the underlying DLL have been created, the function or entry/exit system can be used like any other function or entry/exit system.
Distributing the DLL
Functions and entry/exit systems using External TradingSolutions DLL’s automatically include the DLL when the function or entry/exit system is exported. They are also included when the function or entry/exit system is included as part of a trading solution.
Ä Note: Only the DLL file is included in the exported files. The project and code files are never included.
TradingSolutions users are not required to have the TradingSolutions SDK Add-on to use external DLL’s. The add-on is only required to develop them.
Note that since the external DLL’s are included in the exported function files and trading solutions, there are no built-in protection mechanisms. Third party developers who want to prevent unauthorized distribution of their DLL’s can consider the following methods:
· Create an external installation or activation program to set a value in the registry. Then, check for the presence of this value in the initialization logic of the external DLL.
· Place the core functionality associated with your functions in another DLL which you control the distribution of. Then have the TradingSolutions external DLL call this core DLL as part of its processing.