Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Evolving Trading Rules with XCSF

3,752 views

Published on

Published in: Business, Economy & Finance
  • Be the first to comment

Evolving Trading Rules with XCSF

  1. 1. Evolving Trading Rules with XCSF Daniele Loiacono Artificial Intelligence and Robotics Laboratory, Politecnico di Milano, Italy GECCO'07, July 7-11, 2007, London, UK.
  2. 2. Outline <ul><li>Introduction to XCSF </li></ul><ul><li>The framework </li></ul><ul><li>Experimental results </li></ul><ul><li>Conclusions </li></ul>
  3. 3. What is a learning classifier system? <ul><li>M achine learning paradigm </li></ul><ul><li>Solves problems evolving a set of rules (the classifiers) </li></ul><ul><li>The knowledge is thus represented with a population of rules </li></ul><ul><li>“ In state S, doing action A will result in a payoff P , estimated with accuracy F ” </li></ul>
  4. 4. XCSF <ul><li>Introduced by Wilson in 2001 </li></ul><ul><li>The classifier payoff P is computed by a parameterized function p(S, w ) </li></ul><ul><li>Overall XCSF consists of </li></ul><ul><ul><li>Reinforcement Learning techniques to build the payoff target (prediction) P = p(S,w) </li></ul></ul><ul><ul><li>Gradient descent to learn the parameters w </li></ul></ul><ul><ul><li>A genetic algorithm, based on accuracy, as generalization mechanism </li></ul></ul>
  5. 5. Outline <ul><li>Introduction to XCSF </li></ul><ul><li>The framework </li></ul><ul><li>Experimental results </li></ul><ul><li>Conclusions </li></ul>
  6. 6. The Framework STOCK10 Volume Price STOCK1 Volume Price STOCK2 Volume Price ………………… INPUT ? SYSTEM Buy/Sell transactions… for earning a lot of $$$
  7. 7. Problem Decomposition STOCK10 Volume Price STOCK1 Volume Price STOCK2 Volume Price ………………… INPUT Buy/Sell transactions… for earning a lot of $$$ STOCK1 Expert STOCK2 Expert STOCK3 Expert Merge Expert …………………
  8. 8. The stock experts INPUT BUY HOLD SELL Action Suggested FEATURE EXTRACTION AND NORMALIZATION EXPERT KB EVOLVED WITH XCSF
  9. 9. Feature Extraction <ul><li>The known indicators are an obvious choice </li></ul><ul><li>We used three well know indicators: </li></ul><ul><ul><li>PPO (12,26,9) for the stock price </li></ul></ul><ul><ul><li>RSI with period 14 for the stock price </li></ul></ul><ul><ul><li>PPO (12,26,9) for the stock volume </li></ul></ul><ul><li>In addition we also used as feature the fraction of the overall portfolio value invested in the stock </li></ul><ul><li>Finally features are normalized between -1 and 1 </li></ul>
  10. 10. Evolving the KB <ul><li>The KB is a set of rules evolved with XCSF applied to a “single stock portfolio optimization” problem. </li></ul><ul><li>At each time step XCSF can: </li></ul><ul><ul><li>buy a fixed amount of shares of the stock </li></ul></ul><ul><ul><li>sell a fixed amount of shares of the stock </li></ul></ul><ul><ul><li>hold the current position </li></ul></ul><ul><li>Goal is maximizing the income over time </li></ul>
  11. 11. Merging Expert <ul><li>We merged all the stock expert suggestions with a simple heuristic algorithm </li></ul><ul><li>First an exponential moving average of each stock suggestions is computed (a numerical value is associated to buy, hold and sell) </li></ul><ul><li>For each stock with an average suggestion of selling higher than a threshold, a fixed amount of shares is sold </li></ul><ul><li>For each stock with an average suggestion of buying higher than a threshold, a fixed amount of shares is bought </li></ul>
  12. 12. Outline <ul><li>Introduction to XCSF </li></ul><ul><li>The framework </li></ul><ul><li>Experimental results </li></ul><ul><li>Conclusions </li></ul>
  13. 13. Experimental setup <ul><li>The data set provided for the competition was partitioned in two set: a training set (900 samples) and a validation set (246 samples) </li></ul><ul><li>XCSF was applied on the training set for evolving the KB of the 10 stock experts </li></ul><ul><li>A 10-fold crossvalidation was used for tuning XCSF parameters </li></ul><ul><li>Finally the overall system (the 10 stock experts and the merge one) was tested on the validation set </li></ul>
  14. 14. Validation results
  15. 15. Test Results <ul><li>The system was finally tested on a the official test set provided for the competition </li></ul>
  16. 16. Outline <ul><li>Introduction to XCSF </li></ul><ul><li>The framework </li></ul><ul><li>Experimental results </li></ul><ul><li>Conclusions </li></ul>
  17. 17. Discussion of results <ul><li>Why so a different performance on different dataset ? </li></ul><ul><li>Financial market are complex… </li></ul><ul><li>But have a look to the dataset: </li></ul>TRAINING SET
  18. 18. Discussion of results <ul><li>Why so a different performance on different dataset ? </li></ul><ul><li>Financial market are complex… </li></ul><ul><li>But have a look to the dataset: </li></ul>VALIDATION SET
  19. 19. Discussion of results <ul><li>Why so a different performance on different dataset ? </li></ul><ul><li>Financial market are complex… </li></ul><ul><li>But have a look to the dataset: </li></ul>TEST SET
  20. 20. Conclusions <ul><li>We introduced a very simple framework for evolving trading rules with XCSF </li></ul><ul><li>Results are mixed and further investigation is necessary for a better understanding and improvements of the system performance </li></ul><ul><li>There are a lot of possible extensions: </li></ul><ul><ul><li>Choice of technical indicators </li></ul></ul><ul><ul><li>Evolving the merge expert </li></ul></ul>

×