Home
   
 
 
Demo
   
 
 
User's Manual
   
 
 
Technical Support
   
 
 
 
EDS Monkey
   
 
 

 

 

 
Saturday July 5 2008
     
 

EDS Monkey

EDS Monkey
     
 

Check out the alpha version of PM Monkey

    An optimization engine for the AIQ Systems' Portfolio Manager

EDS Monkey (BETA)

    An Optimization Engine for AIQ Systems' Expert Design Studio


     EDS Monkey (EDSM) is an automated optimization application designed specifically for AIQ's Expert Design Studio (EDS). As it stands now, finding the optimal values for a given system within EDS means hours of manual intervention.

     If given a system with two variables, each representing a series of 20 unique possible optimal factors, and given each backtest takes 5 minutes, it will take you 33+ hours in front of the computer running combinations of X & Y to find the optimal values.
(X(20) * Y(20) = 400 combinations * 5 minutes = 2000 minutes = 33.3 hours)

     EDSM automates this optimization task. EDSM takes control of Expert Design Studio. You define a variable within EDSM, its lower and upper range, and incremental value. Once these values are defined, EDSM inserts the values into your EDS source, and runs a backtest for the specified backtest rule. When the backtest is completed, the results are recorded, the new optimization values are computed, the new values are inserted into the code, and the backtest process is repeat. This process continues until all combinations of optimization factors have been covered. The results of the series of backtests are recorded in the specified output files, and are comma-delimited for easy viewing in Excel. There is file containing an optimization results summary, displaying the optimized parameters utilized in the scan and their given results (avg profit %, drawdown, etc). The second file contains all of the trades made for each backtest, and their associated optimization parameters.


How do you use EDS Monkey?

  • Prerequisites

    1. EDSM has only been tested with Trading Expert Pro, SP1. I welcome others to test with previous versions of TEP.
    2. It's best not to use the computer while the optimization is taking place. EDSM emulates human interaction with EDS through a series of keystroke and windows manipulation routines. In order for EDSM to work, and exact sequence of interactions has to take place. Any action such as minimizing an application or typing a key, could interfere with this process. I am working to make the process less temperamental in the future.
    3. Make sure Expert Design Studio is up and running, your desired script is selected, and the Rule Library tab (aka, code editor) is displayed.
    4. You must define a report for the rule you wish to optimize
      • If you have a rule called "LongSetup", make sure there is a tab called "LongSetup" in the report view.
    5. You must define a backtest for the rule you wish to optimize.
      • If you have a rule called "LongSetup", select View from the menu and see if the option "Test View" is highlighted. If "Test View" isn't highlighted, select the Report option from the menu, and choose "New Backtest". Define your desired parameters for the backtest you wish to perform. These are the default backtest parameters that EDS Monkey will utilize to optimize your system.

  • Installation

    1. Download EDS Monkey here.
    2. Start the install executable and follow the instructions.
    3. After installation, start EDS Monkey.

  • Setting Up EDS Monkey

    1. Click on the "Add" button.
    2. Define the variable's name, its lower range, upper range, and its incremental value.
      • So if you define the variable 'X' with a lower range of one, and upper range of ten, with an increment of one, EDS Monkey will run backtests for 10 different values of 'X'.
    3. Remember, the more parameters you define, or the larger the range of the parameters, the more combinations EDS Monkey has to optimize for, thus increasing the time needed to complete the optimization session.
    4. Enter the rule in your EDS code that you wish to test against. For this rule, within EDS you should have everything setup, including the report and backtest.

  • Adjusting EDS Code

    1. Adjust your EDS code to utilize the optimization parameters.
      • Assume that we have defined the variable 'X' within EDS Monkey. If you utilize a simple moving average within your code, and would like to optimize it using the range of 'X', change your code from 'simpleavg([close],19)' to 'simpleavg([close],X)'.

  • Starting the Optimizer

    1. Once the optimization parameters have been defined and your EDS code has been adjusted, press the "Optimize" button on the EDS Monkey application.

  • What is EDS Monkey Doing to My Code?

    1. EDS Monkey first inserts the optimization variable definitions and values at the top of your code.
    2. The appropriate rule tab (as specified in the EDSM app) is selected.
    3. EDS is then switched to backtest mode.
    4. The EDS Backtest is launched.
    5. Once the backtest is completed, EDS Monkey records the results to the corresponding data files.
    6. EDS is then switched back to report mode, with the Rule Library tab selected.
    7. The old optimization definitions (visible at the top of your EDS code), are deleted.
    8. The process is repeated until all combinations of all optimized parameters have been covered.

  • Reviewing the Results

    1. The optimization summary and the trade report are both comma delimited text files, and will automatically be opened once the entire optimization process has completed.
    2. The data file are simple comma-delimited text files, so they can be viewed in Notepad or Excel at any time.

      1. Here is a summary of each data column

      2. Max Prof Win - Maximum Profit Win
        The maximum profit won on a single trade during the backtest.
      3. Max Prof Loss - Maximum Lost The maximum amount lost on a single trade during the backtest.
      4. Avg DD - Average Drawdown
        A measurement of the average magnitude of % loss for the backtest.
      5. Avg DD Win - Average Drawdown for all winning trades
      6. Avg DD Lose - Average Drawdown for all losing trades
      7. Std Error = Standard Error :
        The accuracy of the backtest results measured relative to the sample size (number of trades) http://www.utexas.edu/cc/faqs/stat/general/gen9.html
      8. S Ratio = Sharpe Ratio :
        The Sharpe Ratio is a widely used metric on judging the consistency of an investment (or series of investments/trades) vs. the optimum return. http://www.moneychimp.com/articles/risk/sharpe_ratio.htm
      9. SMR = Proprietary Indicator from the book "Smart Momentum"
        This is an enhanced version of the Sharpe Ratio in that it judges consistency of performance vs. the "perfect" return, yet it also factors in time. If 15% were the optimal return, if it takes you 5 years to match that (even if the returns are consistent), it's not worth it in terms of opportunity costs. http://www.wileyeurope.com/WileyCDA/WileyTitle/productCd-0471486442.html