SlideShare a Scribd company logo
Machine learning aided prediction
of financial markets
Nikola Milošević
Email: nikola.milosevic@manchester.ac.uk
Blog: http://inspiratron.org
Twitter: @dreadknight011
Who am I?
• BSc and MSc in EE and CS, University of Belgrade, Serbia
• PhD student University of Manchester
• OWASP (Open Web Application Security Project) local and project leader
• Mentor at Google Summer of Code
• Open Source contributor
• About 4 years experience in industry
(Software testing and development – Banking, Telco, SaaS, Mobile)
• Head of Technology at MUTIS Finance Society
Agenda
• Machine learning introduction
• Finance and its resistance to machine learning
• Approaches to investing
• Fundamental
• Behavioral
• Research examples
• Predicting long term stock prices using machine learning
• Predicting FOREX using social media
• Conclusion
What is Machine learning
How does it work?
• Machine learning is the subfield of computer science that
"gives computers the ability to learn without being explicitly
programmed" (Arthur Samuel, 1959)
Types of Machine learning
Achievements of ML
What about handling money?
• Not that much
• Fund manager often can’t understand the model
• Who is accountable for losses?
• Data scientist/Quant/Software engineer?
• Fund manager?
• Data?
• Algorithm?
• Computer?
Machine learning as a black box or black magic
Understanding models
• Machine learning ≠ black box
• Machine learning ≠ black magic
• Complexity matches the problem
• Rules are not simple!
• Complex problems – complex solutions (models)
• Shortcut understanding does not work
• Right cross validation, right dataset
• Machines make as many mistakes as human do
(in many cases even less)
Approaches in finance
• H: Machine can learn same things human can
Behavioural finance
Long-term investing Short-term investing
Technical analysis - traditionally
• Graham criteria (1949)
• Stock Selection for the Defensive Investor:
• 1. Not less than $100 million of annual sales.
• [Note: This works out to $500 million today based on the difference in CPI/Inflation from 1971]
• 2-A. Current assets should be at least twice current liabilities.
• 2-B. Long-term debt should not exceed the net current assets.
• 3. Some earnings for the common stock in each of the past 10 years.
• 4. Uninterrupted [dividend] payments for at least the past 20 years.
• 5. A minimum increase of at least one-third in per-share earnings in the past 10 years.
• 6. Current price should not be more than 15 times average earnings.
• 7. Current price should not be more than 1-1⁄2 times the book value.
• Graham number = 22.5 ∗ 𝐸𝑃𝑆 ∗ 𝐵𝑉
Technical analysis
• Analyse technical indicators and ratios
• Over time
• Dependencies
• Graham model too strict
• It is hard to develop new models
• Mathematically demanding
• People are not good with numbers
• Time consuming
• Can machines help?
Predicting long term movement of stock price
• Use machine learning on past 2-3 year data
• Data obtained using Bloomberg terminal
• Data include 28 indicators
• Book value, Market capitalization, Change of stock Net price over the one month period,
Percentage change of Net price over the one month period, Dividend yield, Earnings per share,
Earnings per share growth, Sales revenue turnover, Net revenue, Net revenue growth, Sales
growth, Price to earnings ratio, Price to earnings ratio -five years average, Price to book ratio,
Price to sales ratio, Dividend per share, Current ratio, Quick ratio, Total debt to equity, margins,
asset turnover…
Predicting long term movement of stock price (2)
• Selected 1739 stocks from different indexes (S&P 1000, FTSE 100
and S&P Europe 350…)
• Calculated which ones price grew more than 10%
• Used different Machine learning algorithms and 10 fold cross
validation for evaluation
• Used Python for scripting and Weka toolkit for machine learning
Results
• Trial with all financial indicators as a features
Results (2)
• We performed feature selection
• Experiment with only 11 indicators
11 indicators
• The performance turned out not to be significantly different, but it
showed that only 11 indicators are enough
FinAnalyzer
• Tool that uses a model and Yahoo hidden API
• https://github.com/nikolamilosevic86/FinAnalyzer
• Open source (GPLv3)
• Decision support
• Not liable of any loses
• Join development
(contact me)
Behavioural finance
• Psychology and emotion influence decision
• People follow their peers
• Sentiment of the information is shaping the decision
Social media and news
Sentiment and FOREX
Major forex pairs
System overview
Sentiment classification
Twitter sentiment - challenges
• Short text – dense information
• Ungrammatical language
• Abbreviations
• Typos
• Emoticons
• Links, hashtags, mentions
Evaluation - sentiment
Correlations – sentiment vs pair
Correlations with sentiment (What we found?)
• There is correlation between sentiment and market movement
• In time it is variable (some times 5 minutes, some times 5 hours)
• Some times ambiguous
• More research necessary
• When to enter/exit?
Conclusion
• Finance is all about information
• Information flooded world
• Machine learning, data science, text mining
• Here to HELP! Try them
• Predicting without emotional influence
• Accountability
• Consider all information for better prediction
• More than human can digest
Reference
• Milosevic, Nikola. “Equity forecast: Predicting long term stock price
movement using machine learning. ” arXiv preprint arXiv:1603.00751 (2016).
• https://arxiv.org/ftp/arxiv/papers/1603/1603.00751.pdf
• Martic, Miljan. “Twitter sentiment analysis for foreign exchange market
movement orediction.” (2014).
Email: Nikola.milosevic@manchester.ac.uk
Blog: http://inspiratron.org
Twitter: @dreadknight011

More Related Content

PDF
Stock Price Trend Forecasting using Supervised Learning
PDF
Stock Market Analysis
PPTX
stock market prediction
PDF
IRJET- Future Stock Price Prediction using LSTM Machine Learning Algorithm
PDF
Stock Market Price Prediction Using Technical Analysis
PPT
STOCK MARKET PRREDICTION WITH FEATURE EXTRACTION USING NEURAL NETWORK TEHNIQUE
DOCX
Stock Market Analysis and Prediction
PPTX
Stock market analysis using supervised machine learning
Stock Price Trend Forecasting using Supervised Learning
Stock Market Analysis
stock market prediction
IRJET- Future Stock Price Prediction using LSTM Machine Learning Algorithm
Stock Market Price Prediction Using Technical Analysis
STOCK MARKET PRREDICTION WITH FEATURE EXTRACTION USING NEURAL NETWORK TEHNIQUE
Stock Market Analysis and Prediction
Stock market analysis using supervised machine learning

What's hot (20)

PPTX
Stock Market Prediction
PPTX
Presentation1
PPTX
Machine learning: Stock Price Prediction
PPTX
Stock Price Prediction
PPTX
Stock market prediction technique:
PPTX
Stock Market Prediction using Machine Learning
PDF
Stock price prediction using Neural Net
PPTX
PDF
Stock Market Prediction.pptx
PPTX
Bitcoin Price Prediction
PPTX
Deep Reinforcement Learning
PDF
Machine Learning: Advanced Topics Overview
PPTX
Introduction to Machine Learning
PDF
An introduction to Deep Learning
PDF
Deep learning - A Visual Introduction
PDF
LSTM Basics
ODP
Machine Learning With Logistic Regression
PPTX
Machine learning seminar presentation
PPTX
Supervised and Unsupervised Learning In Machine Learning | Machine Learning T...
Stock Market Prediction
Presentation1
Machine learning: Stock Price Prediction
Stock Price Prediction
Stock market prediction technique:
Stock Market Prediction using Machine Learning
Stock price prediction using Neural Net
Stock Market Prediction.pptx
Bitcoin Price Prediction
Deep Reinforcement Learning
Machine Learning: Advanced Topics Overview
Introduction to Machine Learning
An introduction to Deep Learning
Deep learning - A Visual Introduction
LSTM Basics
Machine Learning With Logistic Regression
Machine learning seminar presentation
Supervised and Unsupervised Learning In Machine Learning | Machine Learning T...
Ad

Similar to Machine learning prediction of stock markets (20)

PPT
Predicting Stock Market Returns and the Efficiency Market Hypothesis
PDF
The International Journal of Engineering and Science (IJES)
PPTX
Applications of Machine Learning in High Frequency Trading
PPTX
Equity forecast: Predicting long term stock market prices using machine learning
PPTX
Equity forecast using Machine Learning - MUTIS
PDF
4317mlaij02
PDF
Stock Price Prediction Using Sentiment Analysis and Historic Data of Stock
PDF
Ai Advanced Machine Learning For Finance A Comprehensive Guide With Python Pu...
PPT
Balancing quantitative models with common sense 2008
PPTX
Presentation Machine Learning
PPTX
Stock Market Prediction
PPTX
updated stock market ppt.pptx stock market presentation
PDF
How Machine Learning is Flipping Finance on Its Head_ From Fraud Busters to M...
PDF
solomonaddai
PDF
Stock market prediction employing ensemble methods: the Nifty50 index
PPTX
finalppt-150606051347-lva1-app6892.pptx
PDF
PPTX
"A Framework for Developing Trading Models Based on Machine Learning" by Kris...
PPTX
Algorithmic Trading Latest Trends & Developments Lecture By Dr. Lipa Roitman
Predicting Stock Market Returns and the Efficiency Market Hypothesis
The International Journal of Engineering and Science (IJES)
Applications of Machine Learning in High Frequency Trading
Equity forecast: Predicting long term stock market prices using machine learning
Equity forecast using Machine Learning - MUTIS
4317mlaij02
Stock Price Prediction Using Sentiment Analysis and Historic Data of Stock
Ai Advanced Machine Learning For Finance A Comprehensive Guide With Python Pu...
Balancing quantitative models with common sense 2008
Presentation Machine Learning
Stock Market Prediction
updated stock market ppt.pptx stock market presentation
How Machine Learning is Flipping Finance on Its Head_ From Fraud Busters to M...
solomonaddai
Stock market prediction employing ensemble methods: the Nifty50 index
finalppt-150606051347-lva1-app6892.pptx
"A Framework for Developing Trading Models Based on Machine Learning" by Kris...
Algorithmic Trading Latest Trends & Developments Lecture By Dr. Lipa Roitman
Ad

More from Nikola Milosevic (20)

PPTX
Classifying intangible social innovation concepts using machine learning and ...
PPTX
Machine learning (ML) and natural language processing (NLP)
PPTX
Veštačka inteligencija
PPTX
AI an the future of society
PPTX
BelBi2016 presentation: Hybrid methodology for information extraction from ta...
PPTX
Extracting patient data from tables in clinical literature
PPTX
Supporting clinical trial data curation and integration with table mining
PPTX
Mobile security, OWASP Mobile Top 10, OWASP Seraphimdroid
PPTX
PPTX
Table mining and data curation from biomedical literature
PDF
PDF
Sentiment analysis for Serbian language
PDF
Http and security
PDF
Android business models
ODP
Android(1)
PPT
Sigurnosne prijetnje i mjere zaštite IT infrastrukture
PPTX
Mašinska analiza sentimenta rečenica na srpskom jeziku
PPT
PDF
Software Freedom day Serbia - Owasp - informaciona bezbednost u Srbiji open s...
PPT
Software Freedom day Serbia - Owasp open source resenja
Classifying intangible social innovation concepts using machine learning and ...
Machine learning (ML) and natural language processing (NLP)
Veštačka inteligencija
AI an the future of society
BelBi2016 presentation: Hybrid methodology for information extraction from ta...
Extracting patient data from tables in clinical literature
Supporting clinical trial data curation and integration with table mining
Mobile security, OWASP Mobile Top 10, OWASP Seraphimdroid
Table mining and data curation from biomedical literature
Sentiment analysis for Serbian language
Http and security
Android business models
Android(1)
Sigurnosne prijetnje i mjere zaštite IT infrastrukture
Mašinska analiza sentimenta rečenica na srpskom jeziku
Software Freedom day Serbia - Owasp - informaciona bezbednost u Srbiji open s...
Software Freedom day Serbia - Owasp open source resenja

Recently uploaded (20)

PDF
Dr Tran Quoc Bao the first Vietnamese speaker at GITEX DigiHealth Conference ...
PDF
illuminati Uganda brotherhood agent in Kampala call 0756664682,0782561496
PDF
ADVANCE TAX Reduction using traditional insurance
PPTX
Who’s winning the race to be the world’s first trillionaire.pptx
PDF
Bladex Earnings Call Presentation 2Q2025
PPTX
fastest_growing_sectors_in_india_2025.pptx
PDF
Copia de Minimal 3D Technology Consulting Presentation.pdf
PPTX
social-studies-subject-for-high-school-globalization.pptx
PDF
Topic Globalisation and Lifelines of National Economy.pdf
PPTX
kyc aml guideline a detailed pt onthat.pptx
PDF
Why Ignoring Passive Income for Retirees Could Cost You Big.pdf
PPTX
Introduction to Customs (June 2025) v1.pptx
PDF
financing insitute rbi nabard adb imf world bank insurance and credit gurantee
PDF
Dialnet-DynamicHedgingOfPricesOfNaturalGasInMexico-8788871.pdf
PDF
Spending, Allocation Choices, and Aging THROUGH Retirement. Are all of these ...
PDF
final_dropping_the_baton_-_how_america_is_failing_to_use_russia_sanctions_and...
PDF
how_to_earn_50k_monthly_investment_guide.pdf
PPTX
How best to drive Metrics, Ratios, and Key Performance Indicators
PPTX
Understanding-Economic-Growth in macro..
PDF
discourse-2025-02-building-a-trillion-dollar-dream.pdf
Dr Tran Quoc Bao the first Vietnamese speaker at GITEX DigiHealth Conference ...
illuminati Uganda brotherhood agent in Kampala call 0756664682,0782561496
ADVANCE TAX Reduction using traditional insurance
Who’s winning the race to be the world’s first trillionaire.pptx
Bladex Earnings Call Presentation 2Q2025
fastest_growing_sectors_in_india_2025.pptx
Copia de Minimal 3D Technology Consulting Presentation.pdf
social-studies-subject-for-high-school-globalization.pptx
Topic Globalisation and Lifelines of National Economy.pdf
kyc aml guideline a detailed pt onthat.pptx
Why Ignoring Passive Income for Retirees Could Cost You Big.pdf
Introduction to Customs (June 2025) v1.pptx
financing insitute rbi nabard adb imf world bank insurance and credit gurantee
Dialnet-DynamicHedgingOfPricesOfNaturalGasInMexico-8788871.pdf
Spending, Allocation Choices, and Aging THROUGH Retirement. Are all of these ...
final_dropping_the_baton_-_how_america_is_failing_to_use_russia_sanctions_and...
how_to_earn_50k_monthly_investment_guide.pdf
How best to drive Metrics, Ratios, and Key Performance Indicators
Understanding-Economic-Growth in macro..
discourse-2025-02-building-a-trillion-dollar-dream.pdf

Machine learning prediction of stock markets

  • 1. Machine learning aided prediction of financial markets Nikola Milošević Email: nikola.milosevic@manchester.ac.uk Blog: http://inspiratron.org Twitter: @dreadknight011
  • 2. Who am I? • BSc and MSc in EE and CS, University of Belgrade, Serbia • PhD student University of Manchester • OWASP (Open Web Application Security Project) local and project leader • Mentor at Google Summer of Code • Open Source contributor • About 4 years experience in industry (Software testing and development – Banking, Telco, SaaS, Mobile) • Head of Technology at MUTIS Finance Society
  • 3. Agenda • Machine learning introduction • Finance and its resistance to machine learning • Approaches to investing • Fundamental • Behavioral • Research examples • Predicting long term stock prices using machine learning • Predicting FOREX using social media • Conclusion
  • 4. What is Machine learning
  • 5. How does it work? • Machine learning is the subfield of computer science that "gives computers the ability to learn without being explicitly programmed" (Arthur Samuel, 1959)
  • 6. Types of Machine learning
  • 8. What about handling money? • Not that much • Fund manager often can’t understand the model • Who is accountable for losses? • Data scientist/Quant/Software engineer? • Fund manager? • Data? • Algorithm? • Computer?
  • 9. Machine learning as a black box or black magic
  • 10. Understanding models • Machine learning ≠ black box • Machine learning ≠ black magic • Complexity matches the problem • Rules are not simple! • Complex problems – complex solutions (models) • Shortcut understanding does not work • Right cross validation, right dataset • Machines make as many mistakes as human do (in many cases even less)
  • 11. Approaches in finance • H: Machine can learn same things human can Behavioural finance Long-term investing Short-term investing
  • 12. Technical analysis - traditionally • Graham criteria (1949) • Stock Selection for the Defensive Investor: • 1. Not less than $100 million of annual sales. • [Note: This works out to $500 million today based on the difference in CPI/Inflation from 1971] • 2-A. Current assets should be at least twice current liabilities. • 2-B. Long-term debt should not exceed the net current assets. • 3. Some earnings for the common stock in each of the past 10 years. • 4. Uninterrupted [dividend] payments for at least the past 20 years. • 5. A minimum increase of at least one-third in per-share earnings in the past 10 years. • 6. Current price should not be more than 15 times average earnings. • 7. Current price should not be more than 1-1⁄2 times the book value. • Graham number = 22.5 ∗ 𝐸𝑃𝑆 ∗ 𝐵𝑉
  • 13. Technical analysis • Analyse technical indicators and ratios • Over time • Dependencies • Graham model too strict • It is hard to develop new models • Mathematically demanding • People are not good with numbers • Time consuming • Can machines help?
  • 14. Predicting long term movement of stock price • Use machine learning on past 2-3 year data • Data obtained using Bloomberg terminal • Data include 28 indicators • Book value, Market capitalization, Change of stock Net price over the one month period, Percentage change of Net price over the one month period, Dividend yield, Earnings per share, Earnings per share growth, Sales revenue turnover, Net revenue, Net revenue growth, Sales growth, Price to earnings ratio, Price to earnings ratio -five years average, Price to book ratio, Price to sales ratio, Dividend per share, Current ratio, Quick ratio, Total debt to equity, margins, asset turnover…
  • 15. Predicting long term movement of stock price (2) • Selected 1739 stocks from different indexes (S&P 1000, FTSE 100 and S&P Europe 350…) • Calculated which ones price grew more than 10% • Used different Machine learning algorithms and 10 fold cross validation for evaluation • Used Python for scripting and Weka toolkit for machine learning
  • 16. Results • Trial with all financial indicators as a features
  • 17. Results (2) • We performed feature selection • Experiment with only 11 indicators
  • 18. 11 indicators • The performance turned out not to be significantly different, but it showed that only 11 indicators are enough
  • 19. FinAnalyzer • Tool that uses a model and Yahoo hidden API • https://github.com/nikolamilosevic86/FinAnalyzer • Open source (GPLv3) • Decision support • Not liable of any loses • Join development (contact me)
  • 20. Behavioural finance • Psychology and emotion influence decision • People follow their peers • Sentiment of the information is shaping the decision
  • 26. Twitter sentiment - challenges • Short text – dense information • Ungrammatical language • Abbreviations • Typos • Emoticons • Links, hashtags, mentions
  • 29. Correlations with sentiment (What we found?) • There is correlation between sentiment and market movement • In time it is variable (some times 5 minutes, some times 5 hours) • Some times ambiguous • More research necessary • When to enter/exit?
  • 30. Conclusion • Finance is all about information • Information flooded world • Machine learning, data science, text mining • Here to HELP! Try them • Predicting without emotional influence • Accountability • Consider all information for better prediction • More than human can digest
  • 31. Reference • Milosevic, Nikola. “Equity forecast: Predicting long term stock price movement using machine learning. ” arXiv preprint arXiv:1603.00751 (2016). • https://arxiv.org/ftp/arxiv/papers/1603/1603.00751.pdf • Martic, Miljan. “Twitter sentiment analysis for foreign exchange market movement orediction.” (2014).