Home     News     Software     Order     Download     Support     Publications     Research     Contacts  
   Home

   News

  •  

  • Latest News
      
  •  

  • World News
      
  •  

  • Our achievements
      
       Software

  •  

  • TradeStation Solutions
      
  •  

  • Portfolio Software
      
  •  

  • Genetic Optimization
      
  •  

  • eSignal Solutions
      
  •  

  • Matlab & TradeStation Solutions
      
  •  

  • Excel & TradeStation Solutions
      
       Order

       Download

  •  

  • Free Download
      
  •  

  • Update
      
       Support

  •  

  • Online Help
      
  •  

  • Upgrade Policy
      
       Publications

  •  

  • Fractal dimension – numerical characteristic of trend
      
  •  

  • Volatility Models
      
  •  

  • Genetic optimization. Application in TradeStation environment.
      
  •  

  • Genetic Algorithms
      
  •  

  • Building the trading systems
      
  •  

  • Practical realization for TradeStation.
      
  •  

  • Curve Fitting. Fighting with the “OVERFITTING” of the system
      
  •  

  • Building the system consisting of blocks.
      
  •  

  • Questions and Answer
      
  •  

  • Trading Systems Free
      
  •  

  • Money Management
      
       Research

  •  

  • TS Excel Link's using example
      
  •  

  • Strategy Optimization, Curve Fitting and Walk Forward Analysis.
      
  •  

  • Entropy Indicator in TradeStation using Matlab
      
  •  

  • TradeStaion Genetic Optimizer
      
       Contacts

    Genetic optimization. Application in TradeStation environment.: Practical realization for TradeStation.

    Practical realization for TradeStation.

    Let’s see how Genetic Optimization is practically realized for TradeStation. Genetic optimizer consists of program with graphical interface and dynamic library (Dll), which carries out genetic selection functions. Interface of a program has the following structure:

    Genetic Algorithm

    On the left side there is workspace of TradeStation platform, on the right side there is window for viewing the selected by genetic optimization specimen’s parameters.

    The building of a system by the genetic selection method goes like the following:

    1. First, we create the set of possible systems, which is encoded in EasyLanguage in TradeStation environment.
    2. Then, parameters being optimized with the use of genetic algorithms are encoded as a “genes” and organized in “chromosomes”. Further we define possible parameters range and step of parameter value change. If step is set to 0, parameters will change continuously.
    3. When “genes” are specified and combined into “chromosomes” we formulate our ideas of what is “good system” by setting the fitness – optimization criterion.
    4. On final stage we apply the strategy to the graph and start the search of parameters with genetic algorithm. Then we start optimization mechanism by specifying the number of iterations in “Inputs” bookmark, in “Gen” parameter (in TradeStation format strategy window). I.e. internal TradeStation optimizer is used only as a counter of “runs” and as an initializer of genetic algorithm. For example we specify “Gen” parameter to optimize from 1 to 1000 with step equal to 1 as it shown below:

    Genetic Algorithm

    It means that we run our system for 1000 times on given asset and genetic algorithm will change parameters of our system for 1000 times.

    The results of testing can be seen in the viewer window, which opens automatically after testing is complete.

    Genetic Algorithm

    One can view parameters of every specimen. It is possible to sort specimens by any criterion used in TradeStation, save or export all data to Excel for the further analysis.

    Let’s consider simple example of building the system.

    Let’s assume that we have classic reverse trading system based on AverageTrueRange function. The principle of such system is quite simple. According to average true range (AvgTrueRange) we build some channel (multiply value of AvgTrueRange by a factor). If current price “breaks up” this channel, then we buy, if “break down” then we sell.

    Source Easy Language code for calculation of the AvgTrueRange value looks like the following:

    Genetic Algorithm

    New signal is a bit more complex than old one, but there is no much sense in the case of two parameters. In the given example there are 5000 possible variants. In order to find good-enough solution by usual way we would have to make 5000 runs, and this could take a lot of time on long history. By the means of GO it is sufficient to make 100-200 iterations and we will get corresponding population with sufficient number of good-enough specimens. In more complex real-life estimates the number of parameters combinations could greatly exceed 5000. For instance estimation of linear digital filter parameters of 100th order with accuracy of estimation of coefficients equal to 0.01 might lead to 10300 combinations of parameters. It is not possible for the most powerful supercomputer as far as to all existing computers working simultaneously. By means of Genetic Optimizer it is possible to find satisfying solution using home PC within ten minutes.
        

        For the convenience one can use implemented EasyLanguage functions:

    • TS.GO.Start(FileName) - Launch of optimizer and definition of file name for the storing of current population. This function always must be executed on the first bar.
    • TS.GO.Mode(ModeGO) - Setting of optimizer functioning mode.
    • TS.GO.Popul(NPop) - Definition of population size, from 10 to 1000.
    • TS.GO.Chrom(Name) - Definition of new chromosome or search by name of already existing one.
    • TS.GO.Gen(Name,Chrom,Min,Max,Incr) – Definition of new gene of search by name of already existing one.
    • TS.GO.Next(Generation) - Addition new candidate to population or selection of best specimen of population after optimization is complete.
    • TS.GO.Finish – Returns the indication of last run of a system when optimization is complete and TradeStation is forming the report.
    • TS.GO.Error - Returns error code of last function.
    • TS.GO.Var(Name) - Definition of user variable. Variable is associated with current specimen of population and gives possibility of saving user-defined data.
    • TS.GO.Get(Name,Individ) - Gets the value of gene or user-defined variable Name from specimen of population number Individ.
    • TS.GO.Set(Name,Val) - Sets new value of user-defined variable Name for current specimen of population.
    • TS.GO.Fitness(Fitness) - Inform the optimizer that run of the system is complete.
    • TS.GO.FreshBlood(FB_factor) – Setting of the “fresh blood” factor of the system. This function increases the effective size of population and does not allow leaders to dominate, which gives a chance to other candidates. This speeds up optimization due to richer variety of gene pool and decreases system’s tendencies to overfitting.
    • TS.GO.Stat – Computation of standard characteristics of trading system. 
    • TS.GO.ShowViewer - Show Viewer immediately.


    More detailed information with the description of functions and principles of building of trading systems can be found on the support forum: http://support.tsresearchgroup.com/ 

    Let’s point on advances of genetic optimization once more:

    • Arbitrary optimization criteria;
    • Computiation of criterion on the part of the history (In Sample/Out Of Sample);
    • Great extent of parameter space;
    • Quick results;
    • If system has variable number of parameters it is possible to optimize that number.


    <<< Building the trading systems
    Curve Fitting. Fighting with the “OVERFITTING” of the system >>>


    Developed by: webdesign.tria.lv  

      About | Privacy Statement | Terms of use | TradeStation Disclaimer

    Copyright © 2004 TS Smart Research

    time: 0.0257 | queries: 2