Automating the Precision Trading System

Total Page:16

File Type:pdf, Size:1020Kb

Automating the Precision Trading System Automating the Precision Trading System An Interactive Qualifying Project submitted to the Faculty of WORCESTER POLYTECHNIC INSTITUTE in partial fulfillment of the requirements for the Degree of Bachelor of Science By Mihnea Andrei Yar Zar Moe Htet Myo Han Latt With help from: Michael Radzicki Hossein Hakim Date: 5/26/13 Report submitted to: Professor Michael Radzicki Worcester Polytechnic Institute This report represents work of WPI undergraduate students submitted to the faculty as evidence of a degree requirement. WPI routinely publishes these reports on its web site without editorial or peer review. For more information about the projects program at WPI, see http://www.wpi.edu/Academics/Projects. ABSTRACT The purpose of this project is to scientifically create an automated trading system that would perform well in different market conditions and that would offer investors the confidence of trading it. The team used a $400,000 simulated account on the TradeStation platform to develop and optimize the strategy. 2 Table of Contents ABSTRACT .................................................................................................................................... 2 Table of Contents ............................................................................................................................ 3 Table of Figures .............................................................................................................................. 8 Table of Tables ............................................................................................................................... 9 CHAPTER 1: SYSTEM OBJECTIVES ....................................................................................... 10 High Winning Percentage ......................................................................................................... 10 High Annual Return .................................................................................................................. 11 Low Draw-Down....................................................................................................................... 12 Robust Across Different Markets .............................................................................................. 12 Low Time Commitment for Trading ......................................................................................... 13 Spends a Big Amount of Time in the Market ........................................................................... 13 Holding Trades over Night ........................................................................................................ 13 CHAPTER 2: FINANCIAL INSTRUMENT TRADED (STOCKS) ........................................... 14 Personal Interest ........................................................................................................................ 14 Liquidity .................................................................................................................................... 15 Tax Implications and Margin Rules set by FINRA................................................................... 16 CHAPTER 3: LITERATURE REVIEW ...................................................................................... 18 Asset Classes: Bonds .................................................................................................................... 18 Options................................................................................................................................... 19 Stocks..................................................................................................................................... 20 Major Stock Exchanges ............................................................................................................. 22 Trading Platforms ...................................................................................................................... 22 TradeStation........................................................................................................................... 23 MetaTrader 5 ......................................................................................................................... 25 Different Types of Trading and Active Investing Systems ....................................................... 26 3 Efficient Market Hypothesis (EMH) ..................................................................................... 26 Dow Theory ........................................................................................................................... 27 CAN SLIM ............................................................................................................................ 29 Capital Asset Pricing Model (CAPM) ................................................................................... 31 Manual Trading vs. Automated Trading ................................................................................... 33 Fundamental Analysis in Stock Trading ................................................................................... 34 Profitability ............................................................................................................................ 35 Management Effectiveness .................................................................................................... 35 Income Statement .................................................................................................................. 36 Balance Sheet ........................................................................................................................ 36 Cash Flow Statement ............................................................................................................. 37 GDP ....................................................................................................................................... 37 Unemployment ...................................................................................................................... 38 Interest Rate ........................................................................................................................... 41 Inflation ................................................................................................................................. 44 Technical Analysis in Stock Trading ........................................................................................ 45 Strategies ................................................................................................................................... 46 Trend Following Strategies ................................................................................................... 46 Support & Resistance Strategies............................................................................................ 47 Volatility Expansion Strategy ................................................................................................ 47 Basic Tools ................................................................................................................................ 48 Trend Lines ............................................................................................................................ 48 Channels ................................................................................................................................ 50 Japanese Candlesticks ............................................................................................................ 52 Fibonacci ............................................................................................................................... 53 Commodity Channel Index (CCI) ......................................................................................... 53 Relative Strength Index (RSI) ............................................................................................... 54 Moving Averages (MA): Simple Moving Average (SMA)&Exponential Moving Average (EMA) .................................................................................................................................... 55 Random Walk Index (RWI) .................................................................................................. 56 Average True Range (ATR) .................................................................................................. 57 4 Pivot Points ............................................................................................................................ 58 Bollinger Bands ..................................................................................................................... 59 Average Directional Index (ADX) ........................................................................................ 60 Volume .................................................................................................................................. 60 Order Types ............................................................................................................................... 61 Market Orders ........................................................................................................................ 61 Limit Orders .......................................................................................................................... 61 Stop Orders ............................................................................................................................ 62 CHAPTER 4: THE SYSTEM
Recommended publications
  • The Future of Computer Trading in Financial Markets an International Perspective
    The Future of Computer Trading in Financial Markets An International Perspective FINAL PROJECT REPORT This Report should be cited as: Foresight: The Future of Computer Trading in Financial Markets (2012) Final Project Report The Government Office for Science, London The Future of Computer Trading in Financial Markets An International Perspective This Report is intended for: Policy makers, legislators, regulators and a wide range of professionals and researchers whose interest relate to computer trading within financial markets. This Report focuses on computer trading from an international perspective, and is not limited to one particular market. Foreword Well functioning financial markets are vital for everyone. They support businesses and growth across the world. They provide important services for investors, from large pension funds to the smallest investors. And they can even affect the long-term security of entire countries. Financial markets are evolving ever faster through interacting forces such as globalisation, changes in geopolitics, competition, evolving regulation and demographic shifts. However, the development of new technology is arguably driving the fastest changes. Technological developments are undoubtedly fuelling many new products and services, and are contributing to the dynamism of financial markets. In particular, high frequency computer-based trading (HFT) has grown in recent years to represent about 30% of equity trading in the UK and possible over 60% in the USA. HFT has many proponents. Its roll-out is contributing to fundamental shifts in market structures being seen across the world and, in turn, these are significantly affecting the fortunes of many market participants. But the relentless rise of HFT and algorithmic trading (AT) has also attracted considerable controversy and opposition.
    [Show full text]
  • Forecasting Direction of Exchange Rate Fluctuations with Two Dimensional Patterns and Currency Strength
    FORECASTING DIRECTION OF EXCHANGE RATE FLUCTUATIONS WITH TWO DIMENSIONAL PATTERNS AND CURRENCY STRENGTH A THESIS SUBMITTED TO THE GRADUATE SCHOOL OF NATURAL AND APPLIED SCIENCES OF MIDDLE EAST TECHNICAL UNIVERSITY BY MUSTAFA ONUR ÖZORHAN IN PARTIAL FULFILLMENT OF THE REQUIREMENTS FOR THE DEGREE OF DOCTOR OF PILOSOPHY IN COMPUTER ENGINEERING MAY 2017 Approval of the thesis: FORECASTING DIRECTION OF EXCHANGE RATE FLUCTUATIONS WITH TWO DIMENSIONAL PATTERNS AND CURRENCY STRENGTH submitted by MUSTAFA ONUR ÖZORHAN in partial fulfillment of the requirements for the degree of Doctor of Philosophy in Computer Engineering Department, Middle East Technical University by, Prof. Dr. Gülbin Dural Ünver _______________ Dean, Graduate School of Natural and Applied Sciences Prof. Dr. Adnan Yazıcı _______________ Head of Department, Computer Engineering Prof. Dr. İsmail Hakkı Toroslu _______________ Supervisor, Computer Engineering Department, METU Examining Committee Members: Prof. Dr. Tolga Can _______________ Computer Engineering Department, METU Prof. Dr. İsmail Hakkı Toroslu _______________ Computer Engineering Department, METU Assoc. Prof. Dr. Cem İyigün _______________ Industrial Engineering Department, METU Assoc. Prof. Dr. Tansel Özyer _______________ Computer Engineering Department, TOBB University of Economics and Technology Assist. Prof. Dr. Murat Özbayoğlu _______________ Computer Engineering Department, TOBB University of Economics and Technology Date: ___24.05.2017___ I hereby declare that all information in this document has been obtained and presented in accordance with academic rules and ethical conduct. I also declare that, as required by these rules and conduct, I have fully cited and referenced all material and results that are not original to this work. Name, Last name: MUSTAFA ONUR ÖZORHAN Signature: iv ABSTRACT FORECASTING DIRECTION OF EXCHANGE RATE FLUCTUATIONS WITH TWO DIMENSIONAL PATTERNS AND CURRENCY STRENGTH Özorhan, Mustafa Onur Ph.D., Department of Computer Engineering Supervisor: Prof.
    [Show full text]
  • Stock Market Explained
    Stock Market Explained A Beginner's Guide to Investing and Trading in the Modern Stock Market © Ardi Aaziznia www.PeakCapitalTrading.com Copyrighted Material © Peak Capital Trading CHAPTER 1 Copyrighted Material © Peak Capital Trading Figure 1.1: “covid-19” and “stock market” keyword Google search trends between April 2019 and April 2020. As you can see, there is a clear correlation. As the stock market drop hit the news cycles, people started searching more and more about the stock market in Google! Copyrighted Material © Peak Capital Trading COVID-19 Bear Market 2019 Bull Market 2020 recession due to pandemic v Figure 1.2: Comparison between the bull market of 2019 and the bear market of 2020, as shown by the change in share value of 500 of the largest American companies. These companies are tracked by the S&P 500 and are traded in an exchange-traded fund known as the SPDR S&P 500 ETF Trust (ticker: SPY). For your information, S&P refers to Standard & Poor’s, one of the indices which used to track this information. Copyrighted Material © Peak Capital Trading Figure 1.3: How this book is organized. Chapters 1-4 and 7-11 are written by me. Chapters 5 and 6 on day trading are written by Andrew Aziz. Copyrighted Material © Peak Capital Trading CHAPTER 2 Copyrighted Material © Peak Capital Trading Figure 2.1: The return on investing $100 in an exchange-traded fund known as the SPDR S&P 500 ETF Trust (ticker: SPY) (which tracks the share value of 500 of the largest American companies (as rated by the S&P 500)) vs.
    [Show full text]
  • Theoretical and Practical Aspects of Algorithmic Trading Dissertation Dipl
    Theoretical and Practical Aspects of Algorithmic Trading Zur Erlangung des akademischen Grades eines Doktors der Wirtschaftswissenschaften (Dr. rer. pol.) von der Fakult¨at fuer Wirtschaftwissenschaften des Karlsruher Instituts fuer Technologie genehmigte Dissertation von Dipl.-Phys. Jan Frankle¨ Tag der m¨undlichen Pr¨ufung: ..........................07.12.2010 Referent: .......................................Prof. Dr. S.T. Rachev Korreferent: ......................................Prof. Dr. M. Feindt Erkl¨arung Ich versichere wahrheitsgem¨aß, die Dissertation bis auf die in der Abhandlung angegebene Hilfe selbst¨andig angefertigt, alle benutzten Hilfsmittel vollst¨andig und genau angegeben und genau kenntlich gemacht zu haben, was aus Arbeiten anderer und aus eigenen Ver¨offentlichungen unver¨andert oder mit Ab¨anderungen entnommen wurde. 2 Contents 1 Introduction 7 1.1 Objective ................................. 7 1.2 Approach ................................. 8 1.3 Outline................................... 9 I Theoretical Background 11 2 Mathematical Methods 12 2.1 MaximumLikelihood ........................... 12 2.1.1 PrincipleoftheMLMethod . 12 2.1.2 ErrorEstimation ......................... 13 2.2 Singular-ValueDecomposition . 14 2.2.1 Theorem.............................. 14 2.2.2 Low-rankApproximation. 15 II Algorthmic Trading 17 3 Algorithmic Trading 18 3 3.1 ChancesandChallenges . 18 3.2 ComponentsofanAutomatedTradingSystem . 19 4 Market Microstructure 22 4.1 NatureoftheMarket........................... 23 4.2 Continuous Trading
    [Show full text]
  • Dark Pools and High Frequency Trading for Dummies
    Dark Pools & High Frequency Trading by Jay Vaananen Dark Pools & High Frequency Trading For Dummies® Published by: John Wiley & Sons, Ltd., The Atrium, Southern Gate, Chichester, www.wiley.com This edition first published 2015 © 2015 John Wiley & Sons, Ltd, Chichester, West Sussex. Registered office John Wiley & Sons Ltd, The Atrium, Southern Gate, Chichester, West Sussex, PO19 8SQ, United Kingdom For details of our global editorial offices, for customer services and for information about how to apply for permission to reuse the copyright material in this book please see our website at www.wiley.com. All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or trans- mitted, in any form or by any means, electronic, mechanical, photocopying, recording or otherwise, except as permitted by the UK Copyright, Designs and Patents Act 1988, without the prior permission of the publisher. Wiley publishes in a variety of print and electronic formats and by print-on-demand. Some material included with standard print versions of this book may not be included in e-books or in print-on-demand. If this book refers to media such as a CD or DVD that is not included in the version you purchased, you may download this material at http://booksupport.wiley.com. For more information about Wiley products, visit www.wiley.com. Designations used by companies to distinguish their products are often claimed as trademarks. All brand names and product names used in this book are trade names, service marks, trademarks or registered trademarks of their respective owners. The publisher is not associated with any product or vendor men- tioned in this book.
    [Show full text]
  • The Best Candlestick Patterns
    Candlestick Patterns to Profit in FX-Markets Seite 1 RISK DISCLAIMER This document has been prepared by Bernstein Bank GmbH, exclusively for the purposes of an informational presentation by Bernstein Bank GmbH. The presentation must not be modified or disclosed to third parties without the explicit permission of Bernstein Bank GmbH. Any persons who may come into possession of this information and these documents must inform themselves of the relevant legal provisions applicable to the receipt and disclosure of such information, and must comply with such provisions. This presentation may not be distributed in or into any jurisdiction where such distribution would be restricted by law. This presentation is provided for general information purposes only. It does not constitute an offer to enter into a contract on the provision of advisory services or an offer to buy or sell financial instruments. As far as this presentation contains information not provided by Bernstein Bank GmbH nor established on its behalf, this information has merely been compiled from reliable sources without specific verification. Therefore, Bernstein Bank GmbH does not give any warranty, and makes no representation as to the completeness or correctness of any information or opinion contained herein. Bernstein Bank GmbH accepts no responsibility or liability whatsoever for any expense, loss or damages arising out of, or in any way connected with, the use of all or any part of this presentation. This presentation may contain forward- looking statements of future expectations and other forward-looking statements or trend information that are based on current plans, views and/or assumptions and subject to known and unknown risks and uncertainties, most of them being difficult to predict and generally beyond Bernstein Bank GmbH´s control.
    [Show full text]
  • Trading System Development
    Trading System Development An Interactive Qualifying Project Submitted to the Faculty of WORCESTER POLYTECHNIC INSTITUTE In partial fulfillment of the requirements for the Degree of Bachelor of Science By Brian O’Day Dylan Stimson Branden Diniz Submitted to: Prof. Michael Radzicki (advisor) Prof. Hossein Hakim (co-advisor) May 9, 2015 Abstract The purpose of this project was to construct a system of trading systems that would demonstrate a successful long term return on investment across different market conditions. The team was given $300,000 to distribute amongst three scientifically developed systems on the TradeStation platform provided by our advisors. The strategies were designed to incorporate both technical and fundamental data as well as trade diverse markets. The resulting cultivation of systems involved the use of two automated trading strategies and one manual trading strategy that showed substantial profits in the long term. 1 Acknowledgments We would like to thank Professor Radzicki and Professor Hakim for their guidance and support throughout the course of the project. We would also like to thank TradeStation for providing us with a platform for trading that made this project possible. 2 Authorship Page Introduction - Brian Problem Statement - Brian Overview of Systems - All Foundations of Trading and Investing Trading vs Investing - Branden Types of Exchanges - Branden, Dylan Investment Funds - Dylan Types of Orders - Dylan Market Conditions - Dylan Trading different Time Frames - Brian, Branden Costs of Trading/Investing
    [Show full text]
  • Informational Inequality: How High Frequency Traders Use Premier Access to Information to Prey on Institutional Investors
    INFORMATIONAL INEQUALITY: HOW HIGH FREQUENCY TRADERS USE PREMIER ACCESS TO INFORMATION TO PREY ON INSTITUTIONAL INVESTORS † JACOB ADRIAN ABSTRACT In recent months, Wall Street has been whipped into a frenzy following the March 31st release of Michael Lewis’ book “Flash Boys.” In the book, Lewis characterizes the stock market as being rigged, which has institutional investors and outside observers alike demanding some sort of SEC action. The vast majority of this criticism is aimed at high-frequency traders, who use complex computer algorithms to execute trades several times faster than the blink of an eye. One of the many complaints against high-frequency traders is over parasitic trading practices, such as front-running. Front-running, in the era of high-frequency trading, is best defined as using the knowledge of a large impending trade to take a favorable position in the market before that trade is executed. Put simply, these traders are able to jump in front of a trade before it can be completed. This Note explains how high-frequency traders are able to front- run trades using superior access to information, and examines several proposed SEC responses. INTRODUCTION If asked to envision what trading looks like on the New York Stock Exchange, most people who do not follow the U.S. securities market would likely picture a bunch of brokers standing around on the trading floor, yelling and waving pieces of paper in the air. Ten years ago they would have been absolutely right, but the stock market has undergone radical changes in the last decade. It has shifted from one dominated by manual trading at a physical location to a vast network of interconnected and automated trading systems.1 Technological advances that simplified how orders are generated, routed, and executed have fostered the changes in market † J.D.
    [Show full text]
  • My Favorite Trading Strategy Indicators
    Trade Ideas My Favorite Trading Strategy Indicators by Dave Mabe | Dir. of Software Development My Favorite Trading Stratey Indicators | 2020 1 About Dave Mabe Director of Software Development Dave Mabe has been an active trader for over 15 years. Prior to joining Trade Ideas in 2011, Dave started StockTickr, an online trading journal. Dave created Holly, Trade Ideas Artificial Intelligence implementation, drawing from machine learning and data analysis techniques that he’s used in trading strategies for many years. Dave also was the architect behind Brokerage Plus and the Trade Ideas stock charts. @davemabe www.davemabe.com www.trade-ideas.com My Favorite Trading Stratey Indicators | 2020 2 Chapter 1 Clean Charts Too many trading indicators on a chart is a sign of mediocrity. Your charts should be nice and clean showing you exactly what you need to see to make your pre- planned decisions and no more. Many traders take this to heart and have simple charts that aren’t littered with indicators, but too many draw the wrong conclusion at this point: that all indicators are worthless. A trader’s clean chart is not recognition that all indicators are garbage – it should represent that the trader has gone through the thorough and painstaking work of determining which indicators are most important to their trading and why. It should represent countless ideas of what indicators make their trading tick and lots of decisions about the trade offs of including or excluding certain ones. A simple chart should represent the quantifiable tests that have gone into determining which indicators contribute to profit.
    [Show full text]
  • Candlestick Patterns
    INTRODUCTION TO CANDLESTICK PATTERNS Learning to Read Basic Candlestick Patterns www.thinkmarkets.com CANDLESTICKS TECHNICAL ANALYSIS Contents Risk Warning ..................................................................................................................................... 2 What are Candlesticks? ...................................................................................................................... 3 Why do Candlesticks Work? ............................................................................................................. 5 What are Candlesticks? ...................................................................................................................... 6 Doji .................................................................................................................................................... 6 Hammer.............................................................................................................................................. 7 Hanging Man ..................................................................................................................................... 8 Shooting Star ...................................................................................................................................... 8 Checkmate.......................................................................................................................................... 9 Evening Star ....................................................................................................................................
    [Show full text]
  • Research Article AVERAGE TRUE RANGE: HIGH VOLATILITY AS A
    Available Online at http://www.recentscientific.com International Journal of CODEN: IJRSFP (USA) Recent Scientific International Journal of Recent Scientific Research Research Vol. 11, Issue, 01(B), pp. 36805-36812, January, 2020 ISSN: 0976-3031 DOI: 10.24327/IJRSR Research Article AVERAGE TRUE RANGE: HIGH VOLATILITY AS A SUCCESS FACTOR FOR TRADING Dr.Ulrich R. Deinwallner PhD Management and Finance, Walden University, USA DOI: http://dx.doi.org/10.24327/ijrsr.2020.1101.4999 ARTICLE INFO ABSTRACT Article History: High volatility can be an indication to achieve excess returns with an investment strategy, according to the Efficient Market Hypothesis (EMH), since the underlying markets might exhibit less Received 6th October, 2019 th efficiency. In connection to this it was relevant to understand, if trading with low or high Average Received in revised form 15 True Range (ATR) values can improve the return results of a Moving Average (MA) trading November, 2019 strategy. The purpose of this quantitative research was to compare different MA strategies in Accepted 12th December, 2019 th different U.S. stock markets and to find an optimal ATR setting, to determine if excess returns can Published online 28 January, 2020 be achieved. The research question (RQ) was: what ATR setting can improve the return results of a MA trading strategy for U.S stock market indices? The following computations occurred: (a) simple Key Words: moving average; (b) ATR; and (c) t-Tests. I find in this study that a ATR(5) with high values Average True Range, Volatility Trading, (threshold = 25.92) is the most profitable setting to improve a Simple MA (SMA) trading strategy Moving Average, Efficient Market for the S&P500 index with (i.e., rSMA (20)_High_ATR (5)_S&P500 = 21.84 % per month), hypothesis, Portfolio Management.
    [Show full text]
  • Technical-Analysis-Bloomberg.Pdf
    TECHNICAL ANALYSIS Handbook 2003 Bloomberg L.P. All rights reserved. 1 There are two principles of analysis used to forecast price movements in the financial markets -- fundamental analysis and technical analysis. Fundamental analysis, depending on the market being analyzed, can deal with economic factors that focus mainly on supply and demand (commodities) or valuing a company based upon its financial strength (equities). Fundamental analysis helps to determine what to buy or sell. Technical analysis is solely the study of market, or price action through the use of graphs and charts. Technical analysis helps to determine when to buy and sell. Technical analysis has been used for thousands of years and can be applied to any market, an advantage over fundamental analysis. Most advocates of technical analysis, also called technicians, believe it is very likely for an investor to overlook some piece of fundamental information that could substantially affect the market. This fact, the technician believes, discourages the sole use of fundamental analysis. Technicians believe that the study of market action will tell all; that each and every fundamental aspect will be revealed through market action. Market action includes three principal sources of information available to the technician -- price, volume, and open interest. Technical analysis is based upon three main premises; 1) Market action discounts everything; 2) Prices move in trends; and 3) History repeats itself. This manual was designed to help introduce the technical indicators that are available on The Bloomberg Professional Service. Each technical indicator is presented using the suggested settings developed by the creator, but can be altered to reflect the users’ preference.
    [Show full text]