Using Genetic and Evolutionary Algorithms to Build a Trading Model

Ugly posted a great article from the New Scientist magazine that discusses how scientists are using Genetic and Evolutionary algorithms to solve all kinds of problems. The article highlights a few uses for these algorithms such as finding the optimal hull shape for boats or determining the best design for cochlear implants.

Still though, why should you even bother using Genetic and Evolutionary algorithms in the first place? The reason why is because these algorithms use an evolutionary approach to selecting the best fit” input variables. They’ll forward project outcomes to see which evolutionary path provides the best result for your output variable by transforming the input variables. In some cases they’ll even mutate the œoffspring” to see what happens to your output!

What makes these algorithms so vastly different then just using a standard back propagation or regression algorithm is that they work by œpreprocessing” your input data and help build a highly correlated model by transforming your data in the most robust input data set it can.

Now I’ve only scratched the surface of using Genetic and Evolutionary algorithms in YALE and there’s tons more for me to learn, but I’ve used them before in my experiments have had good success. Here are some examples where I’ve used them before:

  • I’ve used them to automatically select the best inputs from a list of 100 stock symbols and data points that help best explain my single output variable
  • I’ve used them to build weights” for my fundamental data trading model (still in Beta), and
  • I’ve even crossbred ETFs to make hybrid ETFs (that’s a bit weird but I was experimenting).

All of these algorithms are found in YALEs preprocessing data section and all of them are used right after you load your data into the experiment. They then apply their algorithms and preprocess” your data before the experiment learns” a model.

To show you how easy it is to use these types of algorithms in YALE/Rapidminer, I’m posting a small example of how to build a trading model using fundamental data. I won’t go into detail about all the different settings for the EA and we’ll just use the default settings for this experiment. First download the following files:

The Excel data file: Fundamental Data

The YALE XML file (in zip format): EA Experiment

EA Experiment.

Open YALE and load in your XML file and then the Excel Data file. Your experiment should look something like the image to the left.

This experiment takes fundamental data on several stocks such as book value, dividends payout, and EBITA, and tries to explain the output variable œ1 Year Target Price” (or some other measure of your choosing).

EA Weights.

If you have 100 years of time to spare you can assign weights to each of your input variables and then vary them till they match your output variable. The other faster way of doing this is to let YALEs Evolutionary Weighting algorithm preprocess the data for you.

Then, the newly assigned weights are fed into the learner, in this case a SVM learner, and the model learns the relationships between the data. Once the model has finished learning, you should be left with a highly correlated model! Voila, you have now built a machine learned model using Evolutionary algorithms!

As always, if you have any questions, please email me or leave me a comment! Thanks!

Up next Search Engine Optimization (SEO) and Data Mining I posted about the power of Data Mining when analyzing your blog’s traffic and how to maximize your Google Adword advertising relative to your Rapidminer 5.0 Video Tutorial 1 - Introduction To Rapidminer After a very long hiatus I present to my readers my first Rapidminer 5.0 video tutorial. It’s just a quick 10 min introduction to the GUI and data
Latest posts Revisiting GOOG, GE, NE, IYR from 2007 The Ye Old Blog List Motorola: Then and Now EWM Redux Testing for mean reversion with Python & developing simple VIX system - Talaikis unsorted - Tadas Talaikis Blog Steps to calculate centroids in cluster using K-means clustering algorithm - Data Science Central Basics of Statistical Mean Reversion Testing - QuantStart Algorithmic trading in less than 100 lines of Python code - O’Reilly Media Interpreting Machine Learning Models Microsoft the AI Powerhouse Investing in the S&P500 still beats AI Trading Microsoft makes a push to simplify machine learning | TechCrunch 10 Great Articles On Python Development — Hacker Noon Introduction to Keras Democratising Machine learning with H2O — Towards Data Science Getting started with Python datatable | Kaggle Phone Addiction Machine Learning Making Pesto Tastier 5 Dangerous Things You Should Let Your Kids Do The Pyschology of Writing Investing in 2019 and beyond TensorFlow and High Level APIs Driving Marketing Performance with H2O Driverless AI Machine Learning and Data Munging in H2O Driverless AI with datatable Making AI Happen Without Getting Fired Latest Musings from a Traveling Sales Engineer The Night before H2O World 2019 Why Forex Trading is Frustrating Functional Programming in Python Automatic Feature Engineering with Driverless AI Ray Dalio's Pure Alpha Fund