Saeed Ebrahimijam Fall 2013 -2014
description
Transcript of Saeed Ebrahimijam Fall 2013 -2014
Fundamentals of Technical Analysis and Algorithmic Trading
Algorithmic Trading (Automated Trading Systems) and
High Frequency Finance
Saeed EbrahimijamFall 2013 -2014
Faculty of Business and EconomicsDepartment of Banking and Finance
Doğu Akdeniz Üniversitesi
FINA417
2
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
Introduction to Algorithmic Finance
3
Automated News Analysis
Fundamental of Technical Analysis and Algorithmic Trading
4
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.
5
6th May 2010 Flash Crash
6
Option pricing model
Black-Scholes in Hardware
7
Portfolio Management with Technical Analysis indicator criteria
8
Automated Trading Systems
9
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.
Human’s need to rest!!!!
10
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.
Why do we need Trading Systems?
11
“…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.
Automated Trading System
12
Help you as expert consultant…
13
Trade instead of you…
14
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.
Benefits of automated trading
15
Emotion management system - 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
Advanced subsystem tools
16
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%
Automated trading systems in the world financial markets:
17
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
Where ATS works
18
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.
Algorithmic trading
19
20
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 ratio thousands 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
High-frequency trading (HFT)
* Aldridge, Irene (July 26, 2010). "How profitable is high frequency trading" Huffington Post.
21
Investopedia explains 'High-Frequency Trading - HFT'High-frequency trading became most popular when exchanges began to offer incentives for companies to add liquidity to the market. For instance, the New York Stock Exchange has a group of liquidity providers called supplemental liquidly providers (SLPs), which attempt to add competition and liquidity for existing quotes on the exchange. As an incentive to the firm, the NYSE pays a fee or rebate for providing said liquidity. As of 2009, the SLP rebate was $0.0015. Multiply that by millions of transactions per day and you can see where part of the profits for high frequency trading comes from.
The SLP was introduced following the collapse of Lehman Brothers in 2008, when liquidity was a major concern for investors.
Definition of 'High-Frequency Trading - HFT'A program trading platform that uses powerful computers to transact a large number of orders at very fast speeds. High-frequency trading uses complex algorithms to analyze multiple markets and execute orders based on market conditions. Typically, the traders with the fastest execution speeds will be more profitable than traders with slower execution speeds. As of 2009, it is estimated more than 50% of exchange volume comes from high-frequency trading orders.
22
There should be enough volatility in the market to make profit from.
The orders should be placed or filled very fast. (high liquidity)
In which markets can we develop HFT systems?
23
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.
TICK DATA
24
25
Implementing High-Frequency Trading Systems
26
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.
Key Steps in Implementation of High-Frequency Systems
27
28
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.
29
How to Design ATS
30
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 Versus Nondiscretionary Systems
31
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
Discretionary vs Nondiscretionary
32
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.
Requirements for Designing a System
33
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.)
Decisions
34
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.
Types of Technical Systems
35
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.
Trend Following System
36
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
Tushar Chande
What Is a Good Trading System?
37
Available software (platforms) IntelliChart ProCharts Tradestation Esignal Metastock Wealth-Lab Amibroker VT Trader
NeoTicker NinjaTrader MetaTrader
38
MACD Trading system flowchart
39
MACD Trading system code
40
Meta Trader software
41
Manually trading
42
Auto trading
43
MQL compiler
44
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.)
MQL tasks
45
Molanis strategy Builder
46
Expert Advisor Visual Wizard
Molanis strategy Builder
47
Molanis strategy Builder
48
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.
Strategy Tester
49
Strategy Tester