- When outputting the results of optimization, as is commonly done when custom objective functions are being calculated and included with the optimization data, the header information for the data needs to be generated only on the first iteration or pass. Subsequent passes need only output the optimization data.Knowing the iteration or pass number allows the user to generate the header information during the first pass.
- Some calculations in a strategy may be time consuming and yet are not involved with parameters that are being varied by the optimization process. These calculations can be done on the first pass and stored in arrays.On all subsequent passes, the stored array values can be used, bypassing the need for performing the calculations repeatedly with each pass. In many cases, this will speed up the optimization process considerably.
- EL Collections for EasyLanguage must be installed for this function to work. A link is provided below for obtaining the code and documentation.
- The TempFile location defined in the variable definition as TempFile(“E:/temp/temp.txt”) may be modified by the user.Keep in mind that some versions of Windows prohibit the creation of files in protected directories, such as some areas of Drive C under Windows Vista or Windows 7. If you receive a “file can not be created” error message, it may be for this reason.
- Although FastFileAppend is generally faster than FileAppend, I have found it does not consistently create new files on my system. Therefore I have reverted to using FileAppend in this function.
The following code placed within your strategy may be used to call this function, which will return the optimization pass number:
OptPassNr = _OptimizationPassNr;
Alternatively, the following variable definition will self-initialize at the start of each optimization run placing the optimization pass number in the variable OptPassNr:
Initially posted version: 03/31/10
Latest Update: 03/31/10
*.ELD files are compiled for TS 8.7
All ELD and code text files packaged here:
Users of earlier versions fo TradeStation may compile the code
from the text files included in the above *.zip file.
The code may be visualized here:
The code and documentation for EL Collections for EasyLanguage may be visualized here: