DoğuAkdenizÜniversitesi Faculty of Business and Economics Department of Banking and Finance Fundamentals of Technical Analysis and Algorithmic TradingAlgorithmic Trading (Automated Trading Systems) and High Frequency Finance Saeed Ebrahimijam Fall 2013 -2014 FINA417
Introduction to Algorithmic Finance According to the new advances in the field of computer and IT which lead to high promotions in the other fields like finance, that generates many extensions in the research and business opportunities. • Algorithmic finance seeks to bridge computer science and finance. It covers such applications as: • High frequency and algorithmic trading • Automated trading systems • Statistical arbitrage strategies • Momentum and other algorithmic portfolio management • Machine learning and computational financial intelligence • Agent-based finance • Complexity and market efficiency • Algorithmic analysis of derivatives valuation • Behavioral finance and investor heuristics and algorithms • Applications of quantum computation to finance • News analytics and automated textual analysis
23 April 2013 'break news' “that explosions at White House have injured Obama“ Hackers' break into Associated Press' Twitter account-Sending DOW Jones plunging 100 points-The S&P 500 Index also fell about 1percent -Wiping out $136.5 billion (according to Reuters data.) The hack also briefly sent gold (-GC) as much as $5 higher. Crude oil (-CL) in New York fell in response. Both reverted to earlier price levels once the AP clarification came out. Fundamental of Technical Analysis and Algorithmic Trading
Black-Scholes in Hardware • Option pricing model
Human’s need to rest!!!! • Analyzing quotes is a hard and tedious work that every trader is familiar with. • Over time human concentration inevitably weakens, which leads to errors in calculations and in the trading platform management. • Human traders are capable of processing the information they observe • Mistakes in trading. • Missing opportunities on financial markets.
Why do we need Trading Systems? • No stock market goes up forever. - Indeed, most world stock markets have declined to zero at one time or another. • The buy-and-hold strategy so popular in the U.S. today is based on a statistical anomaly. - The money made is based on the use of well-controlled entries and exits, especially those that limit the amount of loss that can occur and that will react to changing conditions in the market. • A system will aid the investor or trader in timing these market entries and exits.
Automated Trading System • “…Managing a trade account using a computer program is called Automated Trading or Algorithmic Trading. • Is a computer trading program that automatically submits trades to an exchange. • Robot trading can work 24 hours a day without affecting their effectiveness. • Emotionless and strict adherence to a programmed algorithm.
Benefits of automated trading • When a manual person can trade 1 lot and Algo can do 1000 times more than in a specific time, to that generate volume and volume generate revenue. • Hoffman(2010), shows that in most cases human traders are strictly worse off when algorithmic trading is widespread.
Advanced subsystem tools • Emotion managementsystem - fear, greed, confidence • Money management system controls how much you risk when you get an entry signal from your trading system, i.e. overtrade, overleveraged in FOREX market
Automated trading systems in the world financial markets: • As of the year 2010 more than 70% of the stock shares traded on the NYSE and NASDAQ are generated from • A third of all European Union stock trades in 2006 were driven by automatic programs, or algorithms. • In 2006 at the London Stock Exchange, over 40%
Where ATS works • designed to trade stocks, futures and forex based on a predefined set of rules which determine when to enter a trade, when to exit it and how much to invest in it. • Algorithmic trading • High-frequency trading • Electronic trading platform • Day trading software • Technical analysis software
Algorithmic trading • Algorithmic trading, also called automated trading, black-box trading, or algo-trading, • Is the use of electronic platforms for entering trading orders with an algorithm deciding on aspects of the order such as the timing, price, or quantity of the order, or in many cases initiating the order without human intervention. • may be used in any investment strategy including market making, inter-market spreading, arbitrage, or pure speculation (including trend following). The investment decision and implementation may be augmented at any stage with algorithmic support or may operate completely automatically.
High-frequency trading (HFT) • A special class of algorithmic trading • Computers make elaborate decisions to initiate orders based on information that is received electronically, before human traders are capable of processing the information they observe. • Aiming to capture just a fraction of a cent per share or currency unit on every trade, • HFT move in and out of short-term positions several times each day. • HFT shown to have a potential Sharpe ratiothousands of times higher than the traditional buy-and-hold strategies. * • As of 2009, 60-73% of all US equity trading volume. • High-frequency trading strategies * Aldridge, Irene (July 26, 2010). "How profitable is high frequency trading" Huffington Post.
In which markets can we develop HFT systems? • There should be enough volatility in the market to make profit from. • The orders should be placed or filled very fast. (high liquidity)
TICK DATA • A timestamp • A financial security identification code • An indicator of what information it carries: • Bid price • Ask price • Available bid volume • Available ask volume • Last trade price • Last trade size • Option-specific data, such as implied volatility • The market value information, such as the actual numerical value of the price, available volume, or size -A timestamp records the date and time at which the quote originated. - the number of observations in a single day of tick-by-tick data is equivalent to 30 years of daily observations.
Key Steps in Implementation of High-Frequency Systems • Receive, evaluate, and archive incoming quotes • Perform run-time econometric analysis • Implement run-time portfolio management • Initiate and transmit buy and sell trading signals • Listen for and receive confirmation of execution • Calculate run-time P&L • Dynamically manage risk based on current portfolio allocations and market conditions - A successful high-frequency trading system adapts itself easily to contemporary market conditions.
Real-time data for the first 10 seconds of trading in Apple (AAPL) starting at 930 a.m. Eastern on Wednesday, July 25, the first chance the full NASDAQ had to react to Apple's disappointing Q3 earnings report.
Discretionary Versus Nondiscretionary Systems • Systems are the next step in the development of an investment plan after understanding the methods of either technical or fundamental investing. • Systems can be discretionary, nondiscretionary, or a combination of both. • In discretionary systems, entries and exits are determined by intuition; • in other words, the trader or investor exercises some discretion in making trades. • Nondiscretionary systems are those in which entries and exits are determined mechanically by a computer.
Discretionary vs Nondiscretionary • Using a nondiscretionary system avoids emotion. • This is an advantage because traders often lose money due to emotional decisions. • The nondiscretionary system also reduces other trading pitfalls—overtrading, premature action, no action, and constant decision making. - provides certainty, develops confidence, and produces less stress. Anxiety comes from uncertainty
Requirements for Designing a System • Understand what a discretionary or nondiscretionary system will do. • Do not have an opinion of the market. • Realize that losses will occur—keep them small and infrequent. • Realize that profits will not necessarily occur constantly or consistently. • Realize that your emotions will tug at your mind and encourage changing or fiddling with the system. Such emotions must be controlled. • Be organized—winging it will not work. • Develop a plan consistent with one's time available and investment horizon—daily, weekly, monthly, and yearly. • Test, test, and test again, without curve-fitting. Most systems fail because they have not been tested or have been over-fitted. • Follow the final tested plan without exception—discipline, discipline, discipline.
Decisions • trading philosophy and premises (fundamental, technical,… method) • which markets to focus. • establish the time horizon for the system. • a risk control plan; otherwise, you will not know what to do when markets change. • establish a time routine, (when to update the system and necessary charts, plan new trades, and update exit points for existing trades.)
Types of Technical Systems • Trend Following • Moving Average Systems • Breakout Systems • Pattern Recognition Systems • Counter-Trend System - based on the buy-low-sell-high philosophy within a trading range. This type of system requires a certain amount of volatility between the peaks and valleys of ranges; • Exogenous Signal Systems - Some systems generate signals from outside the market being traded. Intermarket systems, such as gold prices for the bond market, Which type of system is the best? John R. Hill and George Pruitt, whose business is to test all manner of trading systems (www.futurestruth.com), maintain that the best and most reliable systems are trend-following systems.
Trend Following System • It is an investment strategy that tries to take advantage of long-term, medium-term, and short-term moves that sometimes occur in various markets. • The strategy aims to take advantage of a market trend on both sides, going long (buying) or short (selling) in a market in an attempt to profit from the ups and downs of the stock or futures markets. • Traders who use this approach can use current market price calculation, moving averages and channel breakouts to determine the general direction of the market and to generate trade signals. • Traders who subscribe to a trend following strategy do not aim to forecast or predict specific price levels; • they initiate a trade when a trend appears to have started, and exit the trade once the trend appears to have ended.
What Is a Good Trading System? • Positive expectation—Greater than 13% annually • Small number of robust trading rules—Less than ten each is best for entry and exit rules • Able to trade multiple markets—Can use baskets for determining parameters, but rules should work across similar markets, different stocks, different commodities futures, and so on • Incorporates good risk control—Minimum risk as defined by drawdown should not be more than 20% and should not last more than nine months • Fully mechanical—No second-guessing during operation of the system TusharChande
Available software (platforms) • IntelliChart • ProCharts • Tradestation • Esignal • Metastock • Wealth-Lab • Amibroker • VT TraderNeoTicker • NinjaTrader • MetaTrader
MQL tasks • Create your own technical analysis indicators of any complexity • Use Auto-trading : expert advisor (EA) to work on various financial markets • Develop your own analytical tools based on mathematical achievements and traditional methods • Write information trading systems for solving a wide range of tasks (trading, monitoring, alerting, etc.)
Molanis strategy Builder • Expert Advisor Visual Wizard
Strategy Tester • Programmers can test their automated trading systems on historical or current market data in order to determine whether the underlying algorithm guiding the system is profitable or not. • Back-testing software are special trading platforms which enable trading system designer to develop and test their trading systems on historical market data while aiming to produce optimal historical results.