A real-time adaptive trading system using Genetic Programming QF5205 : Topics in Quantitative Finance Donny Lee Nadim Mouchonnet.

Slides:



Advertisements
Similar presentations
Bar Charts Point and Figure Charts Moving Averages
Advertisements

1 FX QUIZ PREPARED BY R N HIRVE CHIEF MANAGER CENTRAL BANK OF INDIA MUMBAI.
An Example of Quant’s Task in Croatian Banking Industry
Genetic Algorithms Genetic algorithms imitate natural optimization process, natural selection in evolution. Developed by John Holland at the University.
Population-based metaheuristics Nature-inspired Initialize a population A new population of solutions is generated Integrate the new population into the.
Genetic Algorithms.
Investment and finance Institute Arab Academy for Science and Technology & Maritime Transport.
Genetic Algorithm.
FX Scalping Trading Pitt 4/7/2010.
Analysis of Technical Trends Ryan Weikert. Asset Valuation Pricing, Buying, and Selling of Assets Methods of Appraisal What stocks, when? Fundamental.
Investment Club PowerPoint 3 Some important things we should all know …. Conceptual Understanding of … 4.Stochastics 5.Earnings per Share ratio 6.Beta.
1 Lecture 8: Genetic Algorithms Contents : Miming nature The steps of the algorithm –Coosing parents –Reproduction –Mutation Deeper in GA –Stochastic Universal.
Data Mining CS 341, Spring 2007 Genetic Algorithm.
A new crossover technique in Genetic Programming Janet Clegg Intelligent Systems Group Electronics Department.
1 Genetic Algorithms. CS The Traditional Approach Ask an expert Adapt existing designs Trial and error.
Genetic Algorithm for Variable Selection
Intro to AI Genetic Algorithm Ruth Bergman Fall 2002.
1 Genetic Algorithms. CS 561, Session 26 2 The Traditional Approach Ask an expert Adapt existing designs Trial and error.
Genetic Algorithms Nehaya Tayseer 1.Introduction What is a Genetic algorithm? A search technique used in computer science to find approximate solutions.
7/2/2015Intelligent Systems and Soft Computing1 Lecture 9 Evolutionary Computation: Genetic algorithms Introduction, or can evolution be intelligent? Introduction,
Intro to AI Genetic Algorithm Ruth Bergman Fall 2004.
Chapter 6: Transform and Conquer Genetic Algorithms The Design and Analysis of Algorithms.
High Risk Investment Disclaimer Trading foreign exchange on margin carries a high level of risk, and may not be suitable for all investors. The high degree.
Quantitative Trading Strategy based on Time Series Technical Analysis Group Member: Zhao Xia Jun Lorraine Wang Lu Xiao Zhang Le Yu.
An EOD strategy to gain from futures trading using only 3EMA & 5EMA
Saeed Ebrahimijam SPRING Faculty of Business and Economics Department of Banking and Finance Doğu Akdeniz Üniversitesi FINA417.
Genetic Algorithms Overview Genetic Algorithms: a gentle introduction –What are GAs –How do they work/ Why? –Critical issues Use in Data Mining –GAs.
Joel Wissing S&P 500 emini futures April 26-28Calgary
Genetic Algorithm.
Computer Implementation of Genetic Algorithm
Evolutionary Intelligence
October 15 th Common Cents Investment Group October, 2012 Agenda  FX on Investopedia  Today in the market  Technical Analysis – Part II  Pick.
Intro. ANN & Fuzzy Systems Lecture 36 GENETIC ALGORITHM (1)
Schemata Theory Chapter 11. A.E. Eiben and J.E. Smith, Introduction to Evolutionary Computing Theory Why Bother with Theory? Might provide performance.
CS 484 – Artificial Intelligence1 Announcements Lab 3 due Tuesday, November 6 Homework 6 due Tuesday, November 6 Lab 4 due Thursday, November 8 Current.
Lecture 8: 24/5/1435 Genetic Algorithms Lecturer/ Kawther Abas 363CS – Artificial Intelligence.
ART – Artificial Reasoning Toolkit Evolving a complex system Marco Lamieri Spss training day
19 October 2015All rights reserved, Edward Tsang & Serafin Martinez jaramillo CHASM Co-evolutionary Heterogeneous Artificial Stock Markets Serafín Martínez.
ART – Artificial Reasoning Toolkit Evolving a complex system Marco Lamieri
Genetic Algorithms Introduction Advanced. Simple Genetic Algorithms: Introduction What is it? In a Nutshell References The Pseudo Code Illustrations Applications.
1 A New Method for Composite System Annualized Reliability Indices Based on Genetic Algorithms Nader Samaan, Student,IEEE Dr. C. Singh, Fellow, IEEE Department.
2005MEE Software Engineering Lecture 11 – Optimisation Techniques.
Edge Assembly Crossover
Genetic Algorithms What is a GA Terms and definitions Basic algorithm.
Genetic Algorithms. 2 Overview Introduction To Genetic Algorithms (GAs) GA Operators and Parameters Genetic Algorithms To Solve The Traveling Salesman.
EE749 I ntroduction to Artificial I ntelligence Genetic Algorithms The Simple GA.
D Nagesh Kumar, IIScOptimization Methods: M8L5 1 Advanced Topics in Optimization Evolutionary Algorithms for Optimization and Search.
GAIA (Genetic Algorithm Interface Architecture) Requirements Analysis Document (RAD) Version 1.0 Created By: Charles Hall Héctor Aybar William Grim Simone.
Neural Networks And Its Applications By Dr. Surya Chitra.
1 5. Technical trading strategies 5.1 Introduction TA: various forecasting methods using past prices (volume, volatility). Note: look-ahead bias Edwards.
QUANTIFIED MOVING AVERAGE STRATEGY OF CRUDE OIL FUTURES MARKET BASED ON FUZZY LOGIC RULES Xiaojia Liu Haizhong An Lijun Wang School of Humanities and Economic.
Genetic Algorithm Dr. Md. Al-amin Bhuiyan Professor, Dept. of CSE Jahangirnagar University.
Artificial Intelligence By Mr. Ejaz CIIT Sahiwal Evolutionary Computation.
Overview Last two weeks we looked at evolutionary algorithms.
Genetic Algorithms. Solution Search in Problem Space.
By Mark Goetsch. The Pieces AnalyticsTrading OpportunityRouting & ExecutionConfirmation & MatchingClearing & Settlement Arbitrage Quotes Order Matching.
Genetic Algorithms And other approaches for similar applications Optimization Techniques.
Genetic Algorithm. Outline Motivation Genetic algorithms An illustrative example Hypothesis space search.
 Presented By: Abdul Aziz Ghazi  Roll No:  Presented to: Sir Harris.
Presented By: Farid, Alidoust Vahid, Akbari 18 th May IAUT University – Faculty.
Introduction to genetic algorithm
Introduction to Genetic Algorithms
Chapter 14 Genetic Algorithms.
Selected Topics in CI I Genetic Programming Dr. Widodo Budiharto 2014.
An Evolutionary Approach

Disjoint Subsets Investing Efficiency Analysis
EE368 Soft Computing Genetic Algorithms.
Genetic algorithms: case study
Population Methods.
Presentation transcript:

A real-time adaptive trading system using Genetic Programming QF5205 : Topics in Quantitative Finance Donny Lee Nadim Mouchonnet

Summary 1.Introduction 2.Genetic Algorithm and Genetic Programming 3.Trading System 4.Genetic Program 5.Results

Introduction Many traders use indicator based trading rules … but they may be loss making (see chart) Double Objective  Create a system than trades and make profit  Emulate the behavior of a technical trader Motivation: “Can a technical trader consistently make a profit?” and “should a technical trader or trading system adapt to market conditions or is it better to use a static system?”

Introduction(2) Results using only a single strategy, backtested on historical data. Stochastic strategy: Buy when indicator crosses the 20% mark from below and sell when it crosses the 70% mark from above. Simple moving average strategy: Buy when the slow lag (50 day look back) crosses the fast lag (20 day look back) from below and sell when vice versa.

Introduction(3) Using the stochastic strategy on SIA stock from 02/11/10 to 08/26/10. Loss is $0.30.

Introduction(4) Using the SMA strategy on KEP stock from 02/11/10 to 08/26/10. Loss is $0.27.

Introduction(5) Using the GBPUSD for a period of 3 months Bloomberg can summarize a whole bunch of strategies

Introduction(6) Using the GBPUSD for a period of 3 months Parabolic SAR

Genetic Algorithm and Genetic Programming (1) GA is an iterative system … aiming to find near-optimal solutions … to multi-extremal problems … by imitating the process of evolution Rule is : SURVIVAL OF THE FITTEST

Genetic Algorithm and Genetic Programming (2) GA representation consists of binary strings of fixed length. Search space is finite GA needs to be initialized … … by random sampling Difference between GA and GP is that GP allows string length to vary within the solution space.

Trading System : Data Analysis carried out on spot FX ticks for GBP/USD from CQG Data Factory and Future Source from 1994 to 1997 CQG : gathered from various FX brokers Future Source : live feed from the Omega TradeStation utility (major banks FX quotes) Got bid and ask and transforms them into mid Data aggregated into OHLC

Trading System : Software Imitating the technical trader i.e. chooses technical strategies from a range of popular trading rules GP based rule selection engine choosing combinations of such strategies Cash management filter exits strategies when losses > user-defined threshold Each backtested strategy returns : Profit, max drawdown, Modified Stirling ratio, number of trades Transaction costs are taken into account with various slippage depending on trading time

Trading System : Software

Trading System : Strategies 6 Rules used : simple moving averages crossover, adaptive moving averages, price channel breakout, stochastic, relative strength index, commodity channel index 3 Connectors : AND / OR / XOR (00/01/10) System rules allowed to use different frequencies/lags Strategies ranked by stirling ratio (when return is positive) or by absolute return when negative.

Genetic Program Representation of a strategy. A strategy of ours can be represented graphically.

Genetic Program(2) From a graphical understanding of a strategy, we can translate to a strategy structure. or a binary string representation.

Genetic Program(3) Or a binary string representation.

Genetic Program(4) This is essential as we ultimately need to convert our strategy into a binary string for our GP to work. Each strategy can be written in the form RULE | CONDITION | CONNECTOR | RULE | CONDITION | CONNECTOR | ……… | ACTION

Genetic Program(5) From there, we can form our binary string representation for our GP. I.e., consider the rule “BUY if AMA TRUE AND CCI FALSE OR RSI TRUE” It would be represented in binary as,

Genetic Program(6) Now with each strategy represented as a binary string, we perform the following in each iteration. 1.Initialize population 2.Calculate Fitness 3.Crossover 4.Mutate

Genetic Program(7) We initial the population with a certain number of strings which will represents the strategies we will use. 1.Assume there are a maximum of k included indicators and a minimum of j. We may construct rules from a total of I indicators. 2.Generate U uniform pseudo-random integer variables V where 1 <= V <= I. For indicators to be used, we write a ‘1’ in the structure part, otherwise a ‘0’. 3.Generate U uniform pseudo-random binary variables corresponding to the indictor bit for each indicator. 4.Assume there are C connectors allowed. For each indicator, we generate a fixed width binary of D(1,C) and write it next to the corresponding indicator bit.

Genetic Program(8) At each trial over a user-defined period, each of these strategies is tested by simulating their trading performance over historical data. There are many ways to assess performance. The Stirling ratio – profit divided by maximum drawdown – is often used by traders to assess performance. For Crossover and Mutation, we would pick a strategies with a certain top % in their Stirling ratio.

Genetic Program(9) Crossover is the process of cutting strategy string pairs at points and exchanging tails and heads to make a new a pair. Only the best s% are considered for crossover. For those strings rank i, the probability of selecting this string is A cut point is selected uniformly pseudo-randomly and ‘head’ and ‘tail’ parts are exchange.

Genetic Program(10) An example of a Crossover, suppose the following two pairs of strings are selected along with a uniformly distributed random number: and and and and 8 Crossover: 101| and 110| becomes and |11 and |10 becomes and

Genetic Program(11) Mutation is the process of randomly changing appropriate bits in a strategy string and is executed in a bitwise manner. Elitist model: top-ranked 5% of strings are not mutated. Number of strings mutated = Mutation Rate x No. of Strings. M uniform pseudo-random integer are generated between 1 and B, length of each string, without replacement. Each corresponding numbered bit is then mutated (‘0’ becomes ‘1’ and ‘1’ becomes ‘0’)

Genetic Program(12) Example of a mutation. Strings are of length 10 and four pseudo-random integers are generated and arranged in ascending order – 3, 5, 7, 8. The following strings are mutated as follows: becomes becomes becomes becomes

Genetic Program : Summary Step 1 Initialize : Generate 100 strategies randomly Step 2 Crossover strategies using 50% of the best strategies Step 3 Mutate the strategies outside the best 5% Step 4 Repeat Steps 2 & 3 until convergence of the solutions

Results : Test Step 1 : In Sample backtesting using 15- minute data used to determine the 20 best strategies during Q Step 2 : Out Sample trading using the best 20 strategies over the next quarters and assess the performance in live trading conditions

Results : Improvement of solutions (1)

Results : Improvement of solutions (2)

Results : Profit

Results : Further work Periodic reoptimization as performance decreases as time out of sample increases Parallel optimization

Our experience Unsuccessful Programming in the Java framework 1 solution : using the Technical Analysis tool of Bloomberg’s Excel Add-in