The Applications of Genetic Algorithms in Stock Market Data Mining Optimisation



Similar documents
The Fish-eye Visualization of Foreign Currency Exchange Data Streams

Stock Trading with Genetic Algorithm---Switching from One Stock to Another

Generating Intraday Trading Rules on Index Future Markets Using Genetic Programming

Data Mining in Financial Markets and an Open Enterprise Infrastructure

Stock price prediction using genetic algorithms and evolution strategies

A Genetic Algorithm Approach for Solving a Flexible Job Shop Scheduling Problem

Feature Selection for Stock Market Analysis

PROCESS OF LOAD BALANCING IN CLOUD COMPUTING USING GENETIC ALGORITHM

Numerical Research on Distributed Genetic Algorithm with Redundant

Introduction To Genetic Algorithms

A Robust Method for Solving Transcendental Equations

GA as a Data Optimization Tool for Predictive Analytics

Predictability of Non-Linear Trading Rules in the US Stock Market Chong & Lam 2010

Evolutionary Detection of Rules for Text Categorization. Application to Spam Filtering

A Stock Trading Algorithm Model Proposal, based on Technical Indicators Signals

Proposal and Analysis of Stock Trading System Using Genetic Algorithm and Stock Back Test System

Stock Market Index Prediction by Hybrid Neuro- Genetic Data Mining Technique

An Automated Guided Model For Integrating News Into Stock Trading Strategies Pallavi Parshuram Katke 1, Ass.Prof. B.R.Solunke 2

A hybrid Approach of Genetic Algorithm and Particle Swarm Technique to Software Test Case Generation

Keywords revenue management, yield management, genetic algorithm, airline reservation

Practical Applications of Evolutionary Computation to Financial Engineering

Outperforming Buy-and-Hold with Evolved Technical Trading Rules: Daily, Weekly and Monthly Trading

Evolutionary SAT Solver (ESS)

Original Article Efficient Genetic Algorithm on Linear Programming Problem for Fittest Chromosomes

Genetic algorithm evolved agent-based equity trading using Technical Analysis and the Capital Asset Pricing Model

A Binary Model on the Basis of Imperialist Competitive Algorithm in Order to Solve the Problem of Knapsack 1-0

An Efficient Implementation of the Backtesting of Trading Strategies

Evaluation of Crossover Operator Performance in Genetic Algorithms With Binary Representation

A Brief Study of the Nurse Scheduling Problem (NSP)

COMPUTATIONIMPROVEMENTOFSTOCKMARKETDECISIONMAKING MODELTHROUGHTHEAPPLICATIONOFGRID. Jovita Nenortaitė

Hybrid Evolution of Heterogeneous Neural Networks

An evolutionary learning spam filter system

Neural Network and Genetic Algorithm Based Trading Systems. Donn S. Fishbein, MD, PhD Neuroquant.com

Model-based Parameter Optimization of an Engine Control Unit using Genetic Algorithms

Solving Banana (Rosenbrock) Function Based on Fitness Function

Memory Allocation Technique for Segregated Free List Based on Genetic Algorithm

Lab 4: 26 th March Exercise 1: Evolutionary algorithms

SOFTWARE TESTING STRATEGY APPROACH ON SOURCE CODE APPLYING CONDITIONAL COVERAGE METHOD

STUDY ON APPLICATION OF GENETIC ALGORITHM IN CONSTRUCTION RESOURCE LEVELLING

Volume 3, Issue 2, February 2015 International Journal of Advance Research in Computer Science and Management Studies

A Fraud Detection Approach in Telecommunication using Cluster GA

EVIDENCE IN FAVOR OF MARKET EFFICIENCY

CLOUD DATABASE ROUTE SCHEDULING USING COMBANATION OF PARTICLE SWARM OPTIMIZATION AND GENETIC ALGORITHM

Genetic Algorithm: An Application to Technical Trading System Design

Stock Market Forecasting Using Machine Learning Algorithms

Prediction of Stock Performance Using Analytical Techniques

DECISION TREE INDUCTION FOR FINANCIAL FRAUD DETECTION USING ENSEMBLE LEARNING TECHNIQUES

Maastricht University. High Frequency Trading Rules in Forex Markets - A Model Confidence Set Approach

A Parallel Processor for Distributed Genetic Algorithm with Redundant Binary Number

Optimizing Testing Efficiency with Error-Prone Path Identification and Genetic Algorithms

A Game-Theoretical Approach for Designing Market Trading Strategies

Inventory Analysis Using Genetic Algorithm In Supply Chain Management

Genetic Algorithm. Based on Darwinian Paradigm. Intrinsically a robust search and optimization mechanism. Conceptual Algorithm

Identifying Market Price Levels using Differential Evolution

Management Science Letters

AN OPTIMAL STRATEGY FOR YARD TRUCKS MANAGEMENT IN HONG KONG CONTAINER TERMINALS

A Strategic Capacity Planning Model: A Genetic Algorithm Approach

Alpha Cut based Novel Selection for Genetic Algorithm

A HYBRID GENETIC ALGORITHM FOR THE MAXIMUM LIKELIHOOD ESTIMATION OF MODELS WITH MULTIPLE EQUILIBRIA: A FIRST REPORT

Agent Services-Based Infrastructure for Online Assessment of Trading Strategies

Generating Directional Change Based Trading Strategies with Genetic Programming

Highway Maintenance Scheduling Using Genetic Algorithm with Microscopic Traffic Simulation

Selection Procedures for Module Discovery: Exploring Evolutionary Algorithms for Cognitive Science

Evolutionary Algorithms using Evolutionary Algorithms

Using Genetic Algorithm for Network Intrusion Detection

ISSN: ISO 9001:2008 Certified International Journal of Engineering Science and Innovative Technology (IJESIT) Volume 2, Issue 3, May 2013

ENSEMBLE DECISION TREE CLASSIFIER FOR BREAST CANCER DATA

An Implementation of Genetic Algorithms as a Basis for a Trading System on the Foreign Exchange Market

Neural Networks, Financial Trading and the Efficient Markets Hypothesis

DISCOVERING FINANCIAL TECHNICAL TRADING RULES USING GENETIC PROGRAMMING WITH LAMBDA ABSTRACTION

D A T A M I N I N G C L A S S I F I C A T I O N

Recognizing Informed Option Trading

Can abnormal returns be earned on bandwidthbounded. Evidence from a genetic algorithm

Cartesian Genetic Programming for Trading: A Preliminary Investigation

Review of VantagePoint 8.6 Release

Applying Design Patterns in Distributing a Genetic Algorithm Application

Combined Pattern Recognition and Genetic Algorithms For Day Trading Strategy Daniel Albarran

Influence of the Crossover Operator in the Performance of the Hybrid Taguchi GA

Research on a Heuristic GA-Based Decision Support System for Rice in Heilongjiang Province

An Exploration of Simple Optimized Technical Trading Strategies

Genetic Algorithms commonly used selection, replacement, and variation operators Fernando Lobo University of Algarve

Genetic Algorithms. Rule Discovery. Data Mining

Estimation of the COCOMO Model Parameters Using Genetic Algorithms for NASA Software Projects

SAIF-2011 Report. Rami Reddy, SOA, UW_P

Data Mining for Manufacturing: Preventive Maintenance, Failure Prediction, Quality Control

Intraday FX Trading: An Evolutionary Reinforcement Learning Approach

Predictive Analytics using Genetic Algorithm for Efficient Supply Chain Inventory Optimization

Vol. 35, No. 3, Sept 30,2000 ملخص تعتبر الخوارزمات الجينية واحدة من أفضل طرق البحث من ناحية األداء. فبالرغم من أن استخدام هذه الطريقة ال يعطي الحل

DELTA Dashboards Visualise, Analyse and Monitor kdb+ Datasets with Delta Dashboards

OPTIMIZATION AND FORECASTING WITH FINANCIAL TIME SERIES

The Stability of Moving Average Technical Trading Rules on the. Dow Jones Index

Financial Text Mining

Technical trading rules in the spot foreign exchange markets of developing countries

A Forecasting Decision Support System

Impact of Feature Selection on the Performance of Wireless Intrusion Detection Systems

Optimal PID Controller Design for AVR System

Comparative Study: ACO and EC for TSP

New binary representation in Genetic Algorithms for solving TSP by mapping permutations to a list of ordered numbers

Chapter 1 INTRODUCTION. 1.1 Background

Macquarie Prime Facility CFD Questionnaire

Transcription:

The Applications of Genetic Algorithms in Stock Market Data Mining Optimisation Li Lin, Longbing Cao, Jiaqi Wang, Chengqi Zhang Faculty of Information Technology, University of Technology, Sydney, NSW 2007, Australia Capital Market CRC, Sydney NSW 2000, Australia Abstract In stock market, a technical trading rule is a popular tool for analysts and users to do their research and decide to buy or sell their shares. The key issue for the success of a trading rule is the selection of values for all parameters and their combinations. However, the range of parameters can vary in a large domain, so it is difficult for users to find the best parameter combination. In this paper, we present the Genetic Algorithm (GA) to overcome the problem in two steps. First, setting a sub-domain of the parameters with GA. Second, finding a near optimal value in the sub domain with GA in a very reasonable time. Keywords: Technical trading rule; Genetic Algorithm; sub-domain; Parameter combination; 1 Introduction In stock market and other finance fields, Genetic Algorithm has been applied in many problems [1]. There have been a number of attempts to use GA for acquiring technical trading rules, both for Foreign Exchange Trading [2][3] and for S&P500 market. One application is how to find the best combination values of each parameter. We know that in a trading rule there are many parameters, when we try to find the most profit, we must test the parameter combination one by one, which is called greedy algorithm which costs a lot of running time and memory. Through analysing the stock market, we know there are some combinations of the parameters, which can produce a near-max profit and give some reasonable

buy/sell suggestions. So our objective in this paper is to find one of these nearmax profit combinations efficiently. In this paper, we decide the sub-domain of each parameter with GA firstly, after that, in each sub-domain, we can find a near optimal combination for each stock historical data. 2 Back grounds To conduct our research, we first need to specify an appropriate universe of trading rules from which the current GA may have been applied to. In stock market, when the brokers or dealers want to buy or sell a share, some of them will depend on a technical trading rule. Robert Edwards and John Magee[5] defined Technical trading rules as the science of recording the actual history of trading (price changes, volume of transactions, etc.) in a certain stock or in the Averages and then deducing from that pictured history the probable future trend. Since the last century, there have been a lot of rules, such as: Filter Rules, Moving Average, Support & Resistance, Abnormal Return, etc [5]. In this paper, we just used Filter rules with GA as an example. The other rules will be tested in the future. 2.1 Filter Rules Filter rules were used in Alexander (1961) and explained by Fama and Blume (1966). An x percent filter is defined as follows: Definition 1 (Filter rules): If the daily closing price of a particular security moves up at least x percent, buy and hold the security until its price moves down at least x percent from a subsequent high, at which time simultaneously sell and go short. The short position is maintained until the daily closing price raises at least x percent above a subsequent low at which time one covers and buys. Moves less than x percent in either direction are ignored. The domain of x is a real number between 0 and 1. At the same time, we also considered the follow integer parameters, whose domains are between 1 and 30 in our system except the previous day p is between 30 and 100. Hold Day h: After we get a buy/sell signal, in the next h hold days we do not produce any other signals even it meet some conditions. Delay Day d: It means when the price meets an occurring signal condition, we also test after d days whether it still meets, if yes, we produce a signal, else ignore this one. This idea can erase the noisy disturbance. Previous Day p: When computing the subsequent highs/lows, we just consider the previous p-day price. I.e. we discard the price over p days before the time point we may produce a signal. There are four parameters in this trading rule, many users concern how to find the best combination of these parameters in order to make the profit mostly for this rule.

2.2 Genetic Algorithm Genetic Algorithm is a heuristic function for optimization, where the extreme of the function (i.e., minimal or maximal) cannot be established analytically. A population of potential solutions is refined iteratively by employing a strategy inspired by Darwinist evolution or natural selection. Genetic Algorithms promote survival of the fittest. This type of heuristic has been applied in many different fields, including construction of neural networks and finance. We represented the parameters of a trading rule with a one-dimension vector that is called chromosome, each element is called a gene, and all of the chromosomes are called population. Here, each gene stands for a parameter value; each chromosome is the set of parameters of one trading rule. Generally, genetic operations include: crossover, mutation and selection. Crossover operator. Suppose S 1 ={s 11, s 12,, s 1n }, S 2 ={s 21, s 22,, s 2n }, are two chromosomes, select a random integer number 0 r n, S 3, S 4 are offspring of crossover(s 1, S 2 ), S 3 ={s i if i r, s i S 1, else s i S 2 }, S 4 ={s i if i r, s i S 2, else s i S 1 }. Mutation operator. Suppose a chromosome S 1 ={s 11, s 12,, s 1n }, select a random integer number 0 r n, S 3 is a mutation of S 1, S 3 ={s i if i r, then s i =s 1i, else s i =random(s 1i )}. Selection operator. Suppose there are m individuals, we select [m/2] individuals but erase the others, the ones we selected are more fitness that means their profits are greater. Genetic Algorithm. 1. InitializePopulation: Producing a number of individuals randomly, each individual is a chromosome which is an n-length array, n is the number of parameters. 2. Test if one of the stopping criteria (running time, fitness, generations, etc) holds. If yes, stop the genetic procedure. 3. Selection: Select the better chromosomes. It means the profit under these parameters is greater. 4. Applying the genetic operators: such as crossover and mutation to the selected parents to generate an offspring. 5. Recombine the offspring and current population to form a new population with selection operator. 6. Repeat steps 2-5.

P InitializePopulation(); While (not stop (P)) do Parents[1..2] SelectParents(P); Offspring[1] Crossover(Parents[1]); Offspring[2] Mutation(Parents[2]); P Selection(P, Parents[1..2], Offspring [1..2]); Endwhile. Figure 1. The Genetic Algorithm. 3 Generation of signals 3.1 Find a sub-domain If we compute the combination of every parameter in its domain, it costs almost 10 hours for only one share, but most of the value combinations are useless. So, we can use GA to decide a sub-domain that is a sub set of the domain firstly. After we get the sub domain, we just compute in the sub domain in the next step. It can improve the efficiency both in running time and memory although it may lose a little precision. And, for an expert, he/she can select the value in the sub domain to improve the efficiency. Algorithm 1. Finding a sub domain. Step 1. Generate a population of parameters value; Step 2. Find the better ones and keep them; Step 3. Use GA operators to generate a new generation; and Step 4. Repeat the step 2 and 3 until it meets some stop criterions, such as running time, the number of generation or precision meet our definition, etc. Step 5. The minimum domain is regarded as the sub-domain. Algorithm stop. 3.2 Find a near optimal combination After we found the sub domain, sometimes we need to get only one value for our decision. Even from a sub domain, we may spend 30 minutes to compute the most profit value with greedy algorithm, and so we need to reduce the running time. One practical method is with GA. Algorithm 2. Finding a near-optimal value. Step 1. Generate a population; Step 2. Find the better half values and keep them; Step 3. Use GA operators to generate a new generation; and Step 4. Repeat the step 2 and 3 until it meets some stop criterion, such as running time, the number of generations or precision meets our definition, etc. Step 5. The last combination is the result. Algorithm stop.

4 Performance evaluations We have tested some stocks of Australia Stock Exchange (ASX). The results are shown in the figure 2 to 5. The Greedy algorithm will cost 10 hours to get the most profit combination, but, GA only costs less 10 seconds to get the nearly value. So it makes the real time analysis possible. Figure 2. The parameters of the Filter rule we got with GA. (The stock is selected from ASX, the trading date is from 2 January 1998 to 20 February 2001.)

Figure 3. We use GA to get the trading signal of Filter rule. ({-stands for buy signal, -stands for sell signal.) The stock is selected from ASX, the red line is the actual trading price. The trading date is from 2 January 1998 to 20 February 1999. The parameters are shown in Figure 2. This graph is shown in Fish-eye technology, the rectangle window is a fish eye, which can be moved by the slice bar under the window. We also divided the data into two parts: training data and test data. Here, the training data is one year, and the test data is one month after the training data. The result is shown in figure 4.

Comparsion of Profit Dollar 15 13 11 9 7 5 3 1-1 -3-5 1 2 3 4 5 6 7 8 9 10 11 12 Month GA profit Manually profit Figure 4. The comparison of profit, the share is selected from ASX, training data is from 19980101 to 19991231, test data is one month length from January to December of 1999. running time(s) 1800 1600 1400 1200 1000 800 600 400 200 0 Figure 5. Greedy stock GA GA and Greedy algorithms running time comparison.

profit($) 5 4 3 2 1 0-1 -2-3 -4-5 Manually GA Greedy Figure 6. GA, Greedy algorithms and manually selected profit comparison. 5 Results and Conclusions The comparison is shown in Figure 4 and 5. (The stock is selected from ASX 1992-2002, Capital Market CRC, Laptop DELL D600 computer, 128M main memory, Windows 2000 system, Borland C++ Builder 6.0) From the figures, we can see that GA loses very little precision but save a lot of running time. So, it can be used in a real analysis system, and the result is similar to the best one. It can also be used as a basic tool for other application, such as: ranking trading rules. Our future work is to design the crossover and mutation probabilities, so that we can make the algorithm more efficiently and effectively. Genetic Algorithm is also used in the other finance fields [4], for example, to find a new technical trading rule. In this paper, we used GA to find the better parameter value combination in an existed trading rule. Acknowledgments The authors would like to thank Capital Market Cooperated Research Centre [11], AC3 [12], and SIRCA [13] for funding this project and providing large realistic data of ASX for this research. All supports and feedbacks from financial

Prof. Mike Aitken in UNSW, Prof. Alex Frino in Sydney Uni. Australia and others are much appreciated. References [1] Chen, S. H. Genetic Algorithms and Genetic Programming in Computational Finance. Boston, MA: Kluwer. 2002 [2] Neely, C., Weller, P. & Dittmar, R. Is Technical Analysis in the Foreign Exchange Market Profitable? A Genetic Programming Approach. Journal of Financial and Quantitative Analysis. 32:405-26. 1997 [3] Thomas, J. & Sycara, K. The Importance of Simplicity and Validation in Genetic Programming for Data Mining in Financial Data. Proceedings of the Joint AAAI-1999 and GECCO-1999 Workshop on Data Mining with Evolutionary Algorithms. 1999. [4] Allen, F. & Karjalainen, R. Using Genetic Algorithms to Find Technical Trading Rules. Journal of Financial Economics. 51:245-271. Studies 27:221-334. 1999 [5] Robert Edwards, John Magee. Technical analysis of stock trends. seventh edition, page 4. 1997. [6] Ryan Sullivan, Allan Timmermann, Halbert White. Data-snooping, Technical Trading Rule Performance, and the Bootstrap. The Journal of Financial, 54, (5):1647-1692. 1999 [7] M. Mitchell. An Introduction to Genetic Algorithms. MIT press, Cambridge, USA. 1996 [8] D. Whitley. An Overview of Evolutionary Algorithm: Practical Issues and Common Pitfalls. Information and Software Technology. 43: 817~831. 2001 [9] M.K.P. So, K. Lam and W.K. Li. Forecasting exchange rate volatility using autoregressive random variance model. Applied Financial Economics, 9, pp. 583-591. 1999 [10] K. Lam and K.C. Lam. Forecasting for the generation of trading signals in financial markets. Journal of Forecasting, 19, pp. 39-52. 2000 [11] http: // www.cmcrc.com [12] http: // www.ac3.com.au [13] http: // www.sirca.org.au [14] http://www-staff.it.uts.edu.au/~linli/download/ [15] http://datamining.it.uts.edu.au:8080/tsap