Trading Global Markets using Technical Analysis Andy Bower www.alchemetrics.org
Format Technical Analysis Data Chart Patterns Computers/Backtesting Neural Nets/Genetic Algorithms Essentials of Trading Markets Money Brokers Risks, Reward and Practicality Risk/Reward Practical system building
Lecture One Technical Analysis Andy Bower www.alchemetrics.org
Technical Analysis The examination of historical market price movements in order to predict future price movements Tenets: Current prices reflect all available information Prices trend ; they are not entirely random (Some) historical patterns tend to reoccur
Fundamental Analysis
Fundamentals vs Technicals Apple Computer AAPL 2003/4 X
Technical Analysis Methods Chart Patterns Indicators Computer analysis Backtesting pattern isolation Automated pattern matching
Data: Bars Bars Open-High-Low-Close-Volume Weekly, Daily, Minute Petsmart PETM Daily OHLC Bars Petsmart PETM Volume Spikes
Data: Candlesticks Gaps
Data: Timescales Weekly Daily 15 minute
Patterns: Support/Resistance Resistance Nasdaq 100 ETF Daily Resistance B Support A Support Support Resistance
Patterns: Trends and Channels Nasdaq 100 ETF Daily
Patterns: Reversal Double/Treble Tops 1st Peak on high volume Trough 2nd Peak usually on lower volume Break support on high volume Completion (often) height of peaks below support Ford Daily
Patterns: Reversal Head and Shoulders Prior uptrend Left shoulder Pullback to neck Head Peak Pullback to neckline Right shoulder Break of neckline on high volume signals trend reversal Citrix Daily
Markov Game
Computer Pattern Matching Strategy Isolate tradable patterns.. Then test Backtesting Evaluation of a trading strategy using historical price data to measure performance. Metrics Equity Curve Profit Factor, Sharpe Ratio Drawdown Avg Trade %
Backtesting Equity Curve
Backtesting Period Returns
Backtesting Performance Report
Backtesting Optimization Strategies may have parameters Optimize to maximize profitability Need to be wary of curve fitting Split data into segments Backtest & Optimize on some segments Then forward test on remaining segments Minimize number of variables
Neural Networks Used to isolate unknown patterns Backpropagation Neural Net Real Neurons
Neural Networks Used to isolate unknown patterns Inputs Indicators/Other Networks Outputs Profit/Sharpe Ratio/etc Network configuration Optimize using Genetic Algorithms Backtesting Curve Fitting issues are very important
Genetic Algorithms Parameter Optimization Searching a large multi-dimensional space Typically better at avoid local optima Use for Optimizing Indicator based systems Neural Network topology Backtesting Curve fitting issues are very important
Reading Technical Analysis of the Financial Markets Murphy: New York Institute of Finance StockCharts.com http://stockcharts.com/education/chartanalysis/ Further Reading Dow Theory in Murphy
Lecture Two Essentials of Trading Andy Bower www.alchemetrics.org
Essentials of Trading Why People Trade Money What People Trade Market Where People Trade Exchanges How People Trade Brokers Orders Margin Shorting Strategies
Money: Why People Trade Investments Pension Funds Insurance Funds Trusts Individuals Exchange wealth now for (more) wealth in the future Borrowers House Buyers Companies Students Exchange wealth in the future for wealth (facilities) now Hedgers Producers Unknown future risk reduction
Market: What People Trade Securities Stocks Shares issued to raise capital now Regular dividend (interest) payment Redeemable by selling to other investors at market price. Exchange Traded Funds (ETFs) Funds hold portfolios matching common indices QQQQ, DIA, SPY (US funds) Bonds Bonds, Notes issued to raise capital now Bought (usually) for face value Regular coupon (interest) payment At term redeemed (usually) at face value
Market: What People Trade Derivatives Options Call Option A right to purchase an asset at a strike price on or before the expiration date. Cost of option is the premium. Put Option A right to sell an asset at a strike price on or before the expiration date. Cost of option is the premium. Futures Futures Contract - agreement to purchase a commodity (item) for delivery in the future. Leverage Derivatives yield an amplification of gain or loss.
Market: What People Trade Currencies Exchange Rates Profit from single exchange rate changes Arbitrage Exploit discrepancies in 3 way markets E.g. yen-euro, euro-dollar, dollar-yen
Market: Where People Trade Exchanges UK: LIFFE, LSE US: Amex, NYSE, CME OTC Over-the-Counter Brokers and dealers negotiate trades NASDAQ is a price quotation system for OTC trades L1:Market Makers/L2:Brokers/L3:Investors ECNs Electronic Communication Networks US ECNs Island, Instinet, Archipelago etc.
Brokers: How People Trade Traders Investors Borrowers Hedgers Trading Services Market Makers/Specialists Cross outstanding trades Otherwise deal from own inventory (25%) Set bid & ask prices and profit from spread Brokers Interface between traders and market makers Profit from commission charges for orders filled Traders effectively buy liquidity from Trading Services
Brokers: How People Trade Web-based Discount Broker Full Service Broker $100$100-$200 per trade Additional research services Direct Access Broker $0.005 $0.01 per share Route direct to dealer $10$10-$20 per trade Automatically Automatically routed to dealer
Brokers: How People Trade Spread Betting Web-based Spread Betting Larger Bid/Ask Spread Not actually trading securities TAX FREE
Bid/Ask Prices Bid Price Price offered to buy your asset i.e. Price at which you can sell Ask Price Price offered to sell you an asset i.e. Price at which you can buy Bid <= Ask
Orders Market Orders Buy (initially) at inside ask Sell (initially) at inside bid Usually immediate fill during market hours Limit Orders Buy or Sell at specified limit price Stop Orders Sell triggered when price falls below stop price Converted to market order when triggered Used to manage risk. Stop Limit Orders Sell at a limit price when price falls below stop price May not fill in fast moving market
3 Orders: Examples High=32.95 Close=32.71 Open=31.48 Low=30.15 1. Buy 100 @ Market Sell 100 @ 32 Limit Sell 100 @ 29 Stop Entry @ 31.48 Exit @ 32 2. Buy 100 @ 30.81 Limit Sell 100 @ 33 Limit Sell 100 @ 30.15 Stop Entry @ 31.48 Exit @ 30.15 3. Buy 150 @ 32.6 Stop Sell 150 @ 32.85 Limit Sell 150 @ 30.02 Stop Entry @ 32.6 Exit @ 32.85
Margin Standard Margin (US equity) Margin accounts can borrow 100% of the account size (2:1) Use of margin provides leverage: extra risk extra gain Day Trader Margin (US equity) Accounts marked as pattern day trading must have a minimum $25,000 balance Day Trader Margin accounts can borrow 400% of the account size (4:1) Margin Calls Accounts that exceed margin receive a margin call Some brokers liquidate positions directly
Short Selling Margin accounts can sell short Borrow security from dealer with the aim to buy it back at a lower price. Shorting Advantages An obvious way to profit in a falling market Shorting an ETF index fund profits when general market is bearish Shorting Disadvantages Unlimited potential for loss Dividends must be paid out Up-tick rule
Shorting Orders Market Orders Sell Short (initially) at inside bid Cover (initially) at inside ask Limit Orders Sell or Cover at specified limit price Stop Orders Cover triggered when price rise above stop price Converted to market order when triggered Stop Limit Orders Cover at a limit price when price rise above stop price May not fill in fast moving market
Trading Styles Buy & Hold or Position Trading Buy and hold for long periods (years) Portfolios accrue profits from general market direction (on avg. 11%APR since 1920) Often used by investment managers Swing Trading Buy or sell short and hold for up to several weeks Attempt to capture profits from the price swings Main vehicle of Hedge Funds Day Trading Buy or sell short and close positions by end of day Scalpers attempt to scalp profits from small price movements using large position sizes.
Trading Styles: Hedging Buy or Sell a correlated instrument to manage downside risk. Industrial/Agricultural Hedging Sell future contract against commodity. Insure against price falls after upfront investment. Limits upside and downside. Stock hedging with futures contracts Sell futures contract against correlated index Insure again overall market fall/crash Limits upside and downside. Stock hedging with options Buy put option to sell at a minimum future price Limits downside, preserves upside (for premium).
Options Leverage/Hedging Examples Feb 2005: Invest $10,400 in Apple Computer Current price $44.86 per share 1. Purchase entirely as shares in AAPL 2. Purchase 2000 July 16th (QAAGW) call options Strike price $47.50, premium $3.70 3. Purchase entirely as AAPL shares and write July 16th QAAGW call options to cover (COVERED CALLS) 4. Purchase 1000 call options and invest the remainder in half yearly Treasury Bonds paying 2% per six months Plot returns for August share price of $35, 40, 45, 50, 60 70 in each strategy
Reading Essentials of Investments PART ONE: Investments Background and Issues McGraw Hill: Bodie, Kane, Marcus
Lecture Three Returns, Risk and Practicality Andy Bower www.alchemetrics.org
Essentials of Investments Measuring Return Arithmetic/Geometric/APR Measuring Risk Risk premium/gambling/speculating Drawdown Diversification Efficient Frontier The Efficient Market Hypothesis Buy & Hold/Medium/Short terms
Measuring Return Holding Period Return (HPR) (Priceend Pricestart + Dividend) / Pricestart No account for Deposits/Withdrawals Arithmetic Average Return (Sum HPR over n periods)/n Ignores compounding Good estimate for future HPR returns Geometric Average (Sum HPR over n periods) root n Equivalent single period return with same compounded performance
Measuring Return IRR Takes into account net cash flows CF0 + CF1/(1+IRR)1 + CF2/(1+IRR)2+CFn/(1+IRR)n=0 Solve for IRR
Measuring Return APR / EAR Annual Percentage Rate (APR) Used for regular nperiod cash flows Ignores compounding APR = HPRperiod x nperiod Effective Annual Rate (EAR) Includes compounding Discrete Compounding: 1+EAR=(1+HPR)n Continuous Compounding: EAR=eAPR - 1
Measuring Risk Expected Rate of Return E(r) Consider probability of various scenarios and the HPRs for each. E(r) = s p(s) HPR(s) Risk can be measured as: expected variance of HPR from E(r) Var(r) = s p(s) (HPR(s)-E(r))2
Measuring Risk Risk Premium A measure of the benefit of investing in a risky asset compared to a risk free asset. Typically E(r)-rf Speculators Require a risk premium Trade off risk against expected return Gamblers Don t require a risk premium
Effects of Risk Drawdown The % amount by which an investment fund falls below its previous high. Confidence factor Example Trading System Hypothetical Returns APR=466% BUT. >40% drawdown three times in 2 years Drawdown periods each > 3months
Diversification Risk standard deviation vs Portfolio size Market risk n
2 Asset Portfolios Portfolio rate of return rp = wa ra + wb rb Portfolio Expected Rate of Return E(rp) = wa E(ra) + wb E(rb) Portfolio Variance (Risk) σp = (waσa)2 + (wbσb)2 + 2(waσa)(wbσb)ρab
Efficient Frontier E(rp2) Minimum Minimum variance variance portfolio combination Portfolio Two AssetExpected ExpectedReturn ReturnvsvsVariance Variance frontier as asset weights vary Plot as asset weights vary frontier Expected Return/Variance Of Individual Assets p2
Efficient Market Hypothesis If prices include all available information Markets must be efficient Price action must be unpredictable (random walk) Called the Efficient Market Hypothesis (EMH) Three forms Weak Form EMH Semi-Strong Form EMH Strong Form EMH All predict that Technical Analysis is without merit In which case the following shouldn t work
Automated Trading Systems Advantages No Emotions Timing Disadvantages Curve Fitting Buy/Sell Signal Generation Indicators Neural Networks/Genetic Algorithms System Analysis Backtesting/Forward Testing/Montecarlo Analysis Single/Multiple securities Money Management Risk-Reward/Position Sizing
Practical System Analysis Examples Simple System Moving average crossover Effect of Diversification Multiple stocks Effect of Money Management Returns vs. Drawdown Slippage Market orders/effective market orders
Personal Experience 7th year of trading on US markets 4th year of automated trading Proprietary software for strategy building Analysis tools Automated order submission You can read about this at www.alchemetrics.org
Automated Trading
My Rules of Engagement Don't trade "manually"; always use computer-based automated systems. Go Long wherever possible. Look for systems that exploit distortions in the market. Trade portfolios rather than individual issues. Keep systems simple. Don't believe your analysis tools.
Reading Essentials of Investments Bodie, Kane, Marcus: McGraw-Hill Risk and Return Efficient Diversification Further Reading Trade Your Way to Financial Freedom Tharp: McGraw-Hill