COVER 封面面
PREFACE 前言言
THE MOVE TOWARD MORE ALGORITHMIC APPROACH 向更加算法化的方法迈进进
COMPETITION 竞争竞争
ACCEPTING RISK 接受风险风险
THE LONG BULL MARKET 长牛市市
WHAT'S NEW IN THE SIXTH EDITION 第六版中的新内容内容
COMPANION WEBSITE 伴随网站网站
WITH APPRECIATION 感恩恩
CHAPTER 1: Introduction 第一章:引言言
THE EXPANDING ROLE OF TECHNICAL ANALYSIS 技术分析日益重要的作用作用
CONVERGENCE OF TRADING STYLES IN STOCKS AND FUTURES 股票和期货交易风格的趋同同
PROFESSIONAL AND AMATEUR 专业和业余余
RANDOM WALK 随机漫步步
DECIDING ON A TRADING STYLE 决定交易风格格
MEASURING NOISE 测量噪声声
MATURING MARKETS AND 成熟市场与与
GLOBALIZATION 全球化化
BACKGROUND MATERIAL 背景材料材料
SYSTEM DEVELOPMENT GUIDELINES``` 系统开发指南指南
OBJECTIVES OF THIS BOOK 本书目标目标
PROFILE OF A TRADING SYSTEM 交易系统概要概要
A WORD ABOUT THE NOTATION USED IN 关于所使用的符号的说明说明
THIS BOOK 这本书书
A FINAL COMMENT 最后的评论评论
CHAPTER 2: Basic Concepts and Calculations 第 2 章:基本概念和计算计算
A BRIEF WORD ABOUT DATA 关于数据的简短说明说明
SIMPLE MEASURES OF ERROR 简单误差测量法法
ON AVERAGE 平均来说来说
PRICE DISTRIBUTION 价格分布布
MOMENTS OF THE DISTRIBUTION: MEAN, 分布的矩:均值,,
VARIANCE, SKEWNESS, AND KURTOSIS 方差、偏斜度和峰度度
CHOOSING BETWEEN FREQUENCY 选择频率之间之间
DISTRIBUTION AND STANDARD 分配与标准标准
DEVIATION 偏差差
MEASURING SIMILARITY 测量相似性性
STANDARDIZING RISK AND RETURN 标准化风险和回报报
THE INDEX 索引引
AN OVERVIEW OF PROBABILITY 概率概述述
SUPPLY AND DEMAND 供求求
NOTES 笔记记
CHAPTER 3: Charting 第 3 章:制图图
FINDING CONSISTENT PATTERNS 寻找一致的模式模式
WHAT CAUSES THE MAJOR PRICE MOVES 是什么导致了主要价格波动动
AND TRENDS? 和趋势??
THE BAR CHART AND ITS 柱状图及其其
INTERPRETATION BY CHARLES DOW
CHART FORMATIONS
TRENDLINES
ONE-DAY PATTERNS
CONTINUATION PATTERNS
BASIC CONCEPTS IN CHART TRADING
ACCUMULATION AND DISTRIBUTION:
BOTTOMS AND TOPS
EPISODIC PATTERNS
PRICE OBJECTIVES FOR BAR CHARTING
IMPLIED STRATEGIES IN CANDLESTICK
CHARTS
PRACTICAL USE OF THE BAR CHART
EVOLUTION IN PRICE PATTERNS
NOTES
CHAPTER 4: Charting Systems
DUNNIGAN AND THE THRUST METHOD
NOFRI'S CONGESTION-PHASE SYSTEM
OUTSIDE DAYS AND INSIDE DAYS
PIVOT POINTS
ACTION AND REACTION
PROGRAMMING THE CHANNEL BREAKOUT
MOVING CHANNELS
COMMODITY CHANNEL INDEX
WYCKOFF'S COMBINED TECHNIQUES
COMPLEX PATTERNS
COMPUTER RECOGNITION OF CHART
PATTERNS
NOTES
CHAPTER 5: Event-Driven Trends
SWING TRADING
POINT-AND-FIGURE CHARTING
THE \(N\)-DAY BREAKOUT
NOTES
CHAPTER 6: Regression Analysis
COMPONENTS OF A TIME SERIES
CHARACTERISTICS OF THE PRICE DATA
LINEAR REGRESSION
LINEAR CORRELATION
NONLINEAR APPROXIMATIONS FOR TWO
VARIABLES
TRANSFORMING NONLINEAR TO LINEAR
MULTIVARIATE APPROXIMATIONS
ARIMA
BASIC TRADING SIGNALS USING A LINEAR
REGRESSION MODEL
MEASURING MARKET STRENGTH
NOTES
CHAPTER 7: Time-Based Trend Calculations
FORECASTING AND FOLLOWING
PRICE CHANGE OVER TIME```
THE MOVING AVERAGE
THE MOVING MEDIAN
GEOMETRIC MOVING AVERAGE
ACCUMULATIVE AVERAGE
DROP-OFF EFFECT
EXPONENTIAL SMOOTHING
PLOTTING LAGS AND LEADS
NOTES
CHAPTER 8: Trend Systems
WHY TREND SYSTEMS WORK
BASIC BUY AND SELL SIGNALS
BANDS AND CHANNELS
CHOOSING THE CALCULATION PERIOD
FOR THE TREND
A FEW CLASSIC SINGLE-TREND SYSTEMS
COMPARISON OF SINGLE-TREND SYSTEMS
TECHNIQUES USING TWO TRENDLINES
THREE TRENDS
COMPREHENSIVE STUDIES
SELECTING THE TREND SPEED TO FIT THE
PROBLEM
MOVING AVERAGE SEQUENCES: SIGNAL
PROGRESSION
EARLY EXITS FROM A TREND
PROJECTING MOVING AVERAGE
CROSSOVERS
EARLY IDENTIFICATION OF A TREND 趋势的早期识别别
CHANGE 改变改变
NOTES 笔记记
CHAPTER 9: Momentum and Oscillators 第九章:动量与振荡器器
MOMENTUM 动量量
ADDING VOLUME TO MOMENTUM 添加动量到势头头
DIVERGENCE INDEX 发散指数指数
VISUALIZING MOMENTUM 可视化动量量
OSCILLATORS 振荡器器
DOUBLE-SMOOTHED MOMENTUM 双重平滑动量量
VELOCITY AND ACCELERATION 速度和加速度速度
HYBRID MOMENTUM TECHNIQUES 混合动量技术技术
MOMENTUM DIVERGENCE 动量背离离
SOME FINAL COMMENTS ON MOMENTUM 关于动量的一些最后评论评论
NOTES 笔记记
CHAPTER 10: Seasonality and Calendar Patterns 第 10 章:季节性和日历模式模式
SEASONALITY NEVER DISAPPEARS 季节性从未消失失
THE SEASONAL PATTERN 季节模式模式
POPULAR METHODS FOR CALCULATING 计算的流行方法方法
SEASONALITY 季节性性
CLASSIC METHODS FOR FINDING 经典查找方法方法
SEASONALITY 季节性性
WEATHER SENSITIVITY 天气敏感性性
IDENTIFYING SEASONAL TRADES 识别季节性交易交易
SEASONALITY AND THE STOCK MARKET 季节性与股市市
COMMON SENSE AND SEASONALITY 常识与季节性性
NOTES 笔记记
CHAPTER 11: Cycle Analysis 第 11 章:循环分析分析
CYCLE BASICS 循环基础知识知识
UNCOVERING THE CYCLE 揭开循环循环
MAXIMUM ENTROPY 最大熵熵
SHORT CYCLE INDICATOR 短周期指示器器
PHASING 相位调整调整
NOTES 笔记记
CHAPTER 12: Volume, Open Interest, and Breadth 第十二章:成交量、未平仓合约和市场广度度
FUTURES VOLUME AND OPEN INTEREST 期货交易量和未平仓合约数数
EXTENDED HOURS AND 24-HOUR 延长营业时间和 24 小时小时
TRADING 交易交易
VARIATIONS FROM THE NORMAL 偏离正常值值
PATTERNS 图案案
STANDARD INTERPRETATION 标准解释解释
VOLUME INDICATORS 音量指示器器
BREADTH INDICATORS 广度指标指标
IS ONE VOLUME OR BREADTH INDICATOR BETTER THAN ANOTHER? 是否有一种交易量或广度指标优于其他指标??
MORE TRADING METHODS USING 更多交易方法方法
VOLUME AND BREADTH 成交量和广度度
AN INTEGRATED PROBABILITY MODEL 集成概率模型模型
INTRADAY VOLUME PATTERNS 当日成交量模式模式
FILTERING LOW VOLUME 过滤低音量量
MARKET FACILITATION INDEX 市场促进指数指数
NOTES 笔记记
CHAPTER 13: Spreads and Arbitrage 第十三章:价差与套利套利
DYNAMICS OF FUTURES INTRAMARKET SPREADS 期货市场内部价差动态动态
CARRYING CHARGES SPREADS IN STOCKS 股票持有成本价差差
SPREAD AND ARBITRAGE RELATIONSHIPS RISK REDUCTION IN SPREADS ARBITRAGE 价差和套利关系在价差套利中的风险降低降低
THE CARRY TRADE 套息交易交易
IMPLIED VERSUS HISTORIC VOLATILITY 隐含波动率与历史波动率率
CHANGING SPREAD RELATIONSHIPS 变动的点差关系关系
INTERMARKET SPREADS 跨市场价差差
NOTES 笔记记
CHAPTER 14: Behavioral Techniques 第 14 章:行为技术技术
MEASURING THE NEWS 衡量新闻新闻
EVENT TRADING 事件交易交易
COMMITMENT OF TRADERS REPORT 交易者承诺报告报告
OPINION AND CONTRARY OPINION 意见与反对意见意见
FIBONACCI AND HUMAN BEHAVIOR 斐波那契与人类行为行为
ELLIOTT'S WAVE PRINCIPLE 艾略特波浪理论理论
PRICE TARGET CONSTRUCTIONS USING 价格目标构造使用使用
THE FIBONACCI RATIO 斐波那契比率率
FISCHER'S GOLDEN SECTION COMPASS 费希尔的黄金分割比例圆规规
SYSTEM 系统系统
W. D. GANN: TIME AND SPACE W.D.甘恩:时间与空间空间
FINANCIAL ASTROLOGY 金融占星术术
NOTES 笔记记
CHAPTER 15: Short-Term Patterns 第 15 章:短期模式模式
PROJECTING DAILY HIGHS AND LOWS 预测每日高低温温
TIME OF DAY 一天中的时间时间
OPENING GAPS 打开间隙隙
WEEKDAY, WEEKEND, AND REVERSAL PATTERNS 工作日、周末和反转模式模式
COMPUTER-BASED PATTERN RECOGNITION 基于计算机的模式识别别
ARTIFICIAL INTELLIGENCE METHODS 人工智能方法方法
NOTES 笔记记
CHAPTER 16: Day Trading 第十六章:日间交易交易
IMPACT OF TRANSACTION COSTS 交易成本的影响影响
SLIPPAGE AND LIQUIDITY 滑点与流动性性
KEY ELEMENTS OF DAY TRADING 日内交易的关键要素素
TRADING USING PRICE PATTERNS 使用价格模式进行交易交易
INTRADAY BREAKOUT SYSTEMS 日内突破系统系统
HIGH-FREQUENCY TRADING 高频交易交易
INTRADAY VOLUME PATTERNS 当日成交量模式模式
INTRADAY PRICE SHOCKS 盘中价格冲击击
NOTES 笔记记
CHAPTER 17: Adaptive Techniques 第十七章: 自适应技术技术
ADAPTIVE TREND CALCULATIONS 自适应趋势计算计算
ADAPTIVE VARIATIONS 适应性变化变化
OTHER ADAPTIVE MOMENTUM 其它自适应动量量
CALCULATIONS 计算计算
ADAPTIVE INTRADAY BREAKOUT SYSTEM 自适应日内突破系统系统
AN ADAPTIVE PROCESS 适应性过程过程
NOTES 笔记记
CHAPTER 18: Price Distribution Systems 第 18 章:价格分配系统系统
ACCURACY IS IN THE DATA 准确性就在数据中中
USE OF PRICE DISTRIBUTIONS AND 价格分布的使用和和
PATTERNS TO ANTICIPATE MOVES 预判动作的模式模式
THE IMPORTANCE OF THE SHAPE OF THE 形状的重要性性
DISTRIBUTION 分配配
A PURCHASER'S INVENTORY MODEL 一个购买者的库存模型模型
A PRODUCER'S SELLING MODEL 生产者的销售模式模式
STEIDLMAYER'S MARKET PROFILE 斯泰德迈尔的市场轮廓廓
A FAST VERSION OF MARKET PROFILE 市场剖析的快速版本版本
NOTES 笔记记
CHAPTER 19: Multiple Time Frames 第 19 章:多重时间框架架
TUNING TWO TIME FRAMES TO WORK 调节两个时间框架以工作工作
TOGETHER 在一起一起
DISPLAYING TWO OR THREE TIME FRAMES 显示两个或三个时间框架架
ELDER'S TRIPLE SCREEN TRADING 老人的三重屏幕交易交易
SYSTEM 系统系统
ROBERT KRAUSZ'S MULTIPLE TIME 罗伯特·克劳斯的多重时间时间
FRAMES 帧帧
MARTIN PRING'S KST SYSTEM 马丁·普林格的 KST 系统系统
NOTES 笔记记
CHAPTER 20: Advanced Techniques 第 20 章:高级技术技术
MEASURING VOLATILITY 测量波动率率
THE PRICE-VOLATILITY RELATIONSHIP 价格与波动性之间的关系关系
USING VOLATILITY FOR TRADING 利用波动性进行交易交易
LIQUIDITY 流动性性
TRENDS AND PRICE NOISE 趋势和价格噪音音
TRENDS AND INTEREST RATE CARRY 趋势和利率差额额
FUZZY LOGIC 模糊逻辑辑
EXPERT SYSTEMS 专家系统系统
GAME THEORY 博弈论论
FRACTALS, CHAOS, AND ENTROPY 分形、混沌和熵熵
GENETIC ALGORITHMS 遗传算法算法
NEURAL NETWORKS 神经网络网络
MACHINE LEARNING AND ARTIFICIAL 机器学习与人工智能智能
INTELLIGENCE 智力力
REPLICATION OF HEDGE FUNDS 对冲基金的复制复制
NOTES 笔记记
CHAPTER 21: System Testing 第 21 章:系统测试测试
EXPECTATIONS 期望望
SELECTING THE TEST DATA 选择测试数据数据
TESTING INTEGRITY 测试完整性性
IDENTIFYING THE PARAMETERS 识别参数参数
SEARCHING FOR THE BEST RESULT 寻找最佳结果结果
TOO LARGE TO TEST EVERYTHING 太大而无法测试所有内容内容
VISUALIZING AND INTERPRETING TEST 可视化与解释测试测试
RESULTS 结果结果
THE IMPACT OF COSTS``` 成本的影响影响
REFINING THE STRATEGY RULES 精炼战略规则规则
ARRIVING AT VALID TEST RESULTS 得出有效的测试结果结果
COMPARING THE RESULTS OF TWO TREND 比较两种趋势的结果结果
SYSTEMS 系统系统
RETESTING TO STAY CURRENT 重新测试以保持最新最新
PROFITING FROM THE WORST RESULTS 从最差的结果中获利利
TESTING ACROSS A WIDE RANGE OF 对广泛范围的测试测试
MARKETS 市场市场
PRICE SHOCKS 价格冲击击
ANATOMY OF AN OPTIMIZATION 优化的解剖图图
SUMMARIZING ROBUSTNESS 总结稳健性性
NOTES 笔记记
CHAPTER 22: Adding Reality 第 22 章:加入现实现实
SOME COMPUTER BASICS 一些计算机基础知识知识
THE ABUSE OF POWER 权力滥用用
FINAL STEPS BEFORE LAUNCH 最后的发射前步骤步骤
EXTREME EVENTS 极端事件事件
GAMBLING TECHNIQUES: THE THEORY OF 赌博技巧:理论理论
RUNS 运行运行
SELECTIVE TRADING 选择性交易交易
SYSTEM TRADE-OFFS 系统权衡衡
SILVER AND AMAZON: TOO GOOD TO BE 银和亚马逊:好得令人难以置信置信
TRUE 真真
SIMILARITY OF SYSTEMATIC TRADING 系统交易的相似性性
SIGNALS 信号号
NOTES 笔记记
CHAPTER 23: Risk Control
MISTAKING LUCK FOR SKILL
RISK AVERSION
LIQUIDITY
MEASURING RETURN AND RISK
POSITION SIZING
INDIVIDUAL TRADE RISK
KAUFMAN ON STOPS AND PROFIT-TAKING
ENTERING A POSITION
LEVERAGE
COMPOUNDING A POSITION
SELECTING THE BEST MARKETS
PROBABILITY OF SUCCESS AND RUIN
MANAGING EQUITY RISK
IDEAL LEVERAGE USING OPTIMAL f
COMPARING EXPECTED AND ACTUAL
RESULTS
```
NOTES
CHAPTER 24: Diversification and Portfolio Allocation
DIVERSIFICATION
TYPES OF PORTFOLIO MODELS
CLASSIC PORTFOLIO ALLOCATION
CALCULATIONS
FINDING OPTIMAL PORTFOLIO
ALLOCATION USING EXCEL'S SOLVER
\section*{KAUFMAN'S GENETIC ALGORITHM SOLUTION TO PORTFOLIO ALLOCATION (GASP) \\ VOLATILITY STABILIZATION \\ NOTES \\ ABOUT THE COMPANION WEBSITE \\ INDEX \\ END USER LICENSE AGREEMENT}
\section*{List of Tables}
Chapter 1
TABLE 1.1 These price changes, reflecting the patterns in Figure 1.4, S...
Chapter 2
TABLE 2.1 Weighting an average.
TABLE 2.2 Values of \(t\) corresponding to the upper tail probabilit.
TABLE 2.3 Calculation of returns and NAVs
from daily profits and losses.
TABLE 2.4 Marginal probability.
TABLE 2.5 Transition Matrix
TABLE 2.6a Counting the occurrences of up and down days.
TABLE 2.6b Starting transition matrix.
Chapter 3
TABLE 3.1 Percentage of time gaps are closed within 1 week, based on a...
TABLE 3.2 Average upward gaps, pullbacks, and close for 275 active stocks.
TABLE 3.3 Average downward gaps, pullbacks, and close for 275 active stocks.
\section*{Chapter 5}
TABLE 5.1 Point-and-figure box sizes.
TABLE 5.2 The box size with the best
performance of the point-and-figur...
TABLE 5.3 Breakout test results using data from 2000 through November 2017.
\section*{Chapter 6}
TABLE 6.1 Calculations for the Walmart best fit.
TABLE 6.2 Output from Excel's regression function.
TABLE 6.3 Calculations for the corn-soybean regression.
TABLE 6.4 Excel solution for the corn-soybean regression.
TABLE 6.5 Spreadsheet for ABX-gold regression.
TABLE 6.6 ABX \(=f\) (gold) solution for 1st-, 2nd, and 3rd-order polynomials.
TABLE 6.7 Spreadsheet setup for linear,
logarithmic, and exponential regre.
TABLE 6.8 Spreadsheet for the curvilinear (2nd-order) solution.
TABLE 6.9 Wheat prices and set-up for Solver solution.
TABLE 6.10 Ranking of pharmaceutical companies.
Chapter 7
TABLE 7.1 General Electric analysis of
regression error based on a 20-day...
TABLE 7.2 The standard deviation of errors for different "days ahead" forecasts....
TABLE 7.3 Comparison of exponential smoothing values.
TABLE 7.4 Comparison of exponential smoothing residual impact.
TABLE 7.5 Equating standard moving averages to exponential smoothing.
TABLE 7.6 Equating exponential smoothing to standard moving averages.
TABLE 7.7 Comparison of exponential
smoothing techniques applied to Microsoft.
Chapter 8
TABLE 8.1 Frequency distribution for a sample of five diverse markets, sho...
TABLE 8.2 Comparison of entry methods for 10
years of Amazon (AMZN). Signa...
TABLE 8.3 Comparison of entries on the close, next open, and next close. ...
TABLE 8.4 Performance statistics for NASDAQ futures, 1998-June 2018.
TABLE 8.5 Results of using a moving average of the highs and lows, compa..
TABLE 8.6 MPTDI Variables for gold.
TABLE 8.7 Summary of futures market results.
TABLE 8.8 Summary of stock market results.
TABLE 8.9 Summary of system net profits for stocks.
TABLE 8.10 Average results of the three trend strategies for four sample...
TABLE 8.11 Comparison of a 120-day single moving average with a 100- and...
TABLE 8.12 Results of a 2-trend system using futures, 1991-2017.
TABLE 8.13 Adding a short-term trend to the 2trend crossover system.
Chapter 9
TABLE 9.1 Excel example of 10-day stochastic for Hewlett-Packard (HPQ).
TABLE 9.2 A/D Oscillator and trading signals, soybeans, January 25,...
TABLE 9.3 TSI calculations using two 20-day smoothing periods.
TABLE 9.4 Equations for velocity and acceleration.
Chapter 10
TABLE 10.1 Average monthly cash wheat prices.
TABLE 10.2 Monthly returns based on wheat cash prices. Average and m...
TABLE 10.3 (Top) Back-adjusted wheat futures prices, 1978-1985....
TABLE 10.4 Original cash wheat prices (top) and returns adjusted by...
TABLE 10.5 Wheat prices expressed as link relatives.
TABLE 10.6 Calculations for the moving average method.
TABLE 10.7 Weather-related events in the southern and northern hemispheres.
TABLE 10.8 Corn cash prices with seasonal buy and sell signals.
TABLE 10.9 Results of Bernstein's study, ending 1985.
TABLE 10.10 Seasonal calendar.
TABLE 10.11 Merrill's holiday results.
TABLE 10.12 The January barometer patterns, \(1938-1989\).
\section*{Chapter 11}
TABLE 11.1 Dates of the peaks and valleys in Figure 11.2.
TABLE 11.2 Dates of the combined observed and estimated peaks and valleys.
TABLE 11.3 Election year analysis for years in which the stock market...
TABLE 11.4 Corn setup for Solver solution.
Chapter 12
\section*{TABLE 12.1 Calculating On-Balance Volume. \\ TABLE 12.2 Interpreting On-Balance Volume.}
Chapter 13
TABLE 13.1 Major crossrates as of March 14,
2018.
TABLE 13.2 Gold prices and delivery months, implied yield, and total days.
TABLE 13.3 Key values of crossrates and yields, March 31, 2009.
Chapter 14
TABLE 14.1 Results of upward breakout of U.S. bonds futures (left) and...
TABLE 14.2 Results of downward breakout of U.S. bonds (left) and S\&P...
TABLE 14.3 Size and position of the planets and Earth's moon.
TABLE 14.4 Solar eclipses, 2010-2020.
TABLE 14.5 Lunar eclipses, 2011-2020.
TABLE 14.6 Dates on which Jupiter and Saturn go retrograde \((\underline{R})\) and direct \((\underline{D}) \ldots\).
TABLE 14.7 New moon and full moon
occurrences, 2018-2021.
\section*{Chapter 15}
TABLE 15.1 Merrill's hourly stock market patterns.
TABLE 15.2 Time pattern for 30-year bond futures, \(1998-2017\).
TABLE 15.3 S\&P time intervals for the three periods shown in Figure 15.4.
TABLE 15.4 Detail for crude oil time patterns.
TABLE 15.5 Results of the gap test using emini S\&P prices from 8:30...
TABLE 15.6 Summary of S\&P gap test results.
TABLE 15.7 U.S. 30-year bond futures, 19992017.
TABLE 15.8 Crude oil futures, September 2014-April 2017.
TABLE 15.9 Euro currency futures, April 2001April 2017.
```
TABLE 15.10 Amazon (AMZN) gap analysis,
2000-April 2018.
```
TABLE 15.11 General Electric (GE) gap analysis, 2000-April 2018.
TABLE 15.12 Micron (MU) gap analysis, 2000April 2018.
TABLE 15.13 Boeing (BA) gap analysis, 2000April 2018.
TABLE 15.14 Tesla (TSLA) gap analysis, 2000April 2018.
TABLE 15.15 Average upward gaps, pullbacks, and close for 275 liquid stocks.
TABLE 15.16 Average downward gaps, pullbacks, and close for 275 liquid stocks.
TABLE 15.17 Selected stocks, data from 20122017.
TABLE 15.18 Weekend results conditioned on the previous week's patterns.
TABLE 15.19 Reversal patterns showing the results of 2000-2011 on...
TABLE 15.20 Taylor's book, November 1975 Soybeans
Chapter 16
\section*{TABLE 16.1 Price ranges for S\&P futures.}
TABLE 16.2 Average high-low range of selected stocks, by year.
TABLE 16.3 Average dollar range of selected futures markets, by year.
\section*{TABLE 16.4 Opening range breakout, \% profitable trades.}
Chapter 17
\section*{TABLE 17.1 Comparative returns of four adaptive systems applied to f...}
Chapter 18
TABLE 18.1 Volatility distribution for SPY.
TABLE 18.2 Probability of annualized volatility using a frequency distribution.
Chapter 20
\section*{TABLE 20.1 VIX ETFs and ETNs, daily volume greater than 5,000, as of May 2018.}
\section*{TABLE 20.2 Predicting the trading range of the S\&P 500.}
TABLE 20.3 Frequency of price moves following a known pattern, including...
TABLE 20.4 Frequency of price moves following the completeness of the ch...
TABLE 20.5 Conditional probabilities of a price change given the complet...
TABLE 20.6 Functional description of the genes in chromosomes 1 and 2.
TABLE 20.7 Two training cases (initial state). TABLE 20.8 Two training cases (after mutated weighting factors).
Chapter 21
TABLE 21.1 Optimization report for a simple moving average test of QQQ....
TABLE 21.2 Statistics for the moving average and linear regression strategies.
TABLE 21.3 Reversing a losing strategy.
TABLE 21.4 Results of moving average
optimizations on futures, 1990-2017.
TABLE 21.5 Crossover tests, nearest futures,
1990-2017.
TABLE 21.6 Testing on 2007-2011 and projecting on 2012-2017.
TABLE 21.7 Test 1: Optimizing crude oil,
January 2, 1990-August 3, 1990.*
TABLE 21.8 Test 2: Optimizing crude oil,
January 2, 1990-January 16, 1991.*
TABLE 21.9 Test 3: Optimizing crude oil,
January 2, 1990-March 28, 1991.
\section*{Chapter 22}
TABLE 22.1 Summary of price shocks.
TABLE 22.2 Simulated runs.
TABLE 22.3 Frequency of up and down runs for selected markets, \(3 / 17 / 1998 \ldots\)
TABLE 22.4 Percent of trading days systems holding the same positions.
TABLE 22.5 SPY Moving average correlations, 1998-June 2018.
TABLE 22.6 SPY Similarity of positions using different moving average c...
TABLE 22.7 Correlations for four trend methods using a 20-day calculati...
TABLE 22.8 Correlations for four trend methods using an 80-day calculat...
Chapter 23
\section*{TABLE 23.1 A spreadsheet to calculate the Sharpe ratio.}
TABLE 23.2 VaR calculations on a spreadsheet. TABLE 23.3 Position sizing in futures.
TABLE 23.4 Position sizing for stocks using ATR.
TABLE 23.5 Stock allocation using annualized volatility.
TABLE 23.6 Position sizing using price.
TABLE 23.7 Stop-loss test of 30-year bonds, 2000-2011, applied to a movi...
TABLE 23.8 Results of averaging into a new position based on an 80-day m...
TABLE 23.9 Size of pullback and best delay for each market when waiting ...
TABLE 23.10 Results of timing the entry using an 8-day RSI, an 80-day mo...
\section*{TABLE 23.11 Building a position on new high profits.}
TABLE 23.12 Adding on new highs, long-only.
TABLE 23.13 Averaging down, 1998-2008.
TABLE 23.14 Averaging down, 2009-2018.
TABLE 23.15 Examples of risk of ruin with
unequal wins and losses.
TABLE 23.16 Probability of a loss after N trades, relative to a system ...
TABLE 23.17 The probability of a specific number of losses.
TABLE 23.18 Distribution of \(\chi^{\underline{2}}\).
TABLE 23.19 Results from Analysis of Runs
Chapter 24
TABLE 24.1 Portfolio evaluation of stocks and bonds using a spreadsheet.
\section*{TABLE 24.2 Solver Setup.}
TABLE 24.3 Returns expressed as NAVs.
TABLE 24.4 Generating random numbers to create weighting factors.
TABLE 24.5 Normalized weighting factors for each portfolio in the pool.
TABLE 24.6 Evaluating portfolio return and
\(\underline{\text { risk. }}\)
\section*{TABLE 24.7 Example of volatility stabilization.}
\section*{List of I|lustrations}
Chapter 1
FIGURE 1.1 Crude oil prices weekly chart with July 2008 in the center (top); \(\ldots\)
FIGURE 1.2 Basic measurement of noise using the efficiency ratio (also calle...
FIGURE 1.3 Three different price patterns all begin and end at the same poin...
FIGURE 1.4 By changing the net price move we can distinguish between noise a...
FIGURE 1.5 Relative change in maturity of world markets by region
FIGURE 1.6 Ranking of Asian Equity Index Markets, 2005-2010.
Chapter 2
FIGURE 2.1 The Law of Averages. The normal cases overwhelm the unusual ones....
FIGURE 2.2 Wheat prices, 1978-2017.
FIGURE 2.3 Wheat frequency distribution showing a tail to the right.
FIGURE 2.4 Normal distribution showing the percentage area included within o...
FIGURE 2.5 Gold cash prices.
FIGURE 2.6 Gold cash frequency distribution.
FIGURE 2.7 Skewness. Nearly all price
distributions are positively skewed, \(\mathrm{s} \ldots\)
FIGURE 2.8 Changing distribution at different price levels. A, B, and C are ...
FIGURE 2.9 Kurtosis. A positive kurtosis is when the peak of the distributio...
FIGURE 2.10 Measuring 10\% from each end of the frequency distribution. The d...
FIGURE 2.11 Probability network.
FIGURE 2.12a Shift in demand.
FIGURE 2.12b Demand curve, including extremes.
FIGURE 2.13 Demand elasticity. (a) Relatively elastic. (b) Relatively inelas...
FIGURE 2.14 Supply-price relationship. (a) Shift in supply. (b) Supply curve...
FIGURE 2.15 The three cases of elasticity of supply.
FIGURE 2.16 Equilibrium with shifting supply.
FIGURE 2.17 Cash wheat with the PPI and dollar index (DX), from 1978 through...
FIGURE 2.18 Wheat prices adjusted for PPI and Dollar Index (DX).
Chapter 3
FIGURE 3.1 Dow Theory has been adapted to use the current versions of the ma...
FIGURE 3.2 Bull and bear market signals are traditional breakout signals, bu...
FIGURE 3.3 NASDAQ from April 1998 through June 2002. A clear example of a bu...
FIGURE 3.4 Secondary trends and reactions. A reaction is a smaller swing in ...
FIGURE 3.5 Dow Theory applied to the S\&P. Most of Dow's principles apply to ...
FIGURE 3.6 The trend is easier to see after it has occurred. While the upwar...
FIGURE 3.7 Upward and downward trendlines applied to Intel, November 2002 th...
FIGURE 3.8 Horizontal support and resistance lines shown on bond futures pri...
FIGURE 3.9 Basic sell and buy signals using trendlines.
FIGURE 3.10 Trading rules for horizontal support and resistance lines.
FIGURE 3.11 Trading a price channel. Once the channel has been drawn, buying...
FIGURE 3.12 Turning from an upward to a downward channel. Trades are always ...
FIGURE 3.13 Price gaps shown on a chart of
Amazon.com.
FIGURE 3.14 A series of spikes in bonds. From June through October 2002, U.S...
FIGURE 3.15 AMR in early 2003, showing a classic island reversal with exampl...
FIGURE 3.16 Russell 2000 during the last half of 2002 showing reversal days,...
FIGURE 3.17 Wide-ranging days, outside days, and inside days for Tyco.
FIGURE 3.18 Symmetric and descending triangles and a developing bear market ...
FIGURE 3.19 An assortment of continuation patterns. These patterns are all r...
FIGURE 3.20 Wedge. A weaker wedge formation is followed by a strong rising w...
FIGURE \(3.21 \mathrm{~A} V\)-top in the NASDAQ index, March 2000.
FIGURE 3.22 Cotton has frequent \(V\)-tops but nothing as extreme as in 2011.
FIGURE 3.23 Two \(V\)-bottoms in crude oil, back-adjusted futures.
FIGURE 3.24 A double top in crude oil. FIGURE 3.25 Triple bottom in Bank of America (BAC).
FIGURE 3.26 A triple bottom and two double bottoms in Goldman-Sachs (GS).
FIGURE 3.27 Natural gas shows a classic triple
top.
FIGURE 3.28 Two cases of a breakout of an extended bottom in Yahoo (AABA).
FIGURE 3.29 Two rounded tops in the German DAX stock index.
FIGURE 3.30 A classic rounded bottom in the Japanese yen.
FIGURE 3.31 A large declining wedge followed by a upside breakout in the Jap...
FIGURE 3.32 Head-and-shoulders top pattern in the Japanese Nikkei index.
FIGURE 3.33 On the left, an episodic pattern shown in an upward price shock ...
FIGURE 3.34 Price objectives for consolidation patterns and channels. (a) Tw...
\section*{FIGURE 3.35 Forming new channels to determine objectives.}
FIGURE 3.36 Two profit targets following a top formation in back-adjusted cr...
FIGURE 3.37 Head-and-shoulders top price objective.
FIGURE 3.38 Triangle and flag objectives. (a) Triangle objective is based on...
FIGURE \(3.39(a-j)\) Popular candle formations.
FIGURE 3.40 Similar patterns in the S\&P, GE, and Exxon.
FIGURE 3.41 Asian equity index markets adjusted to the same volatility level...
Chapter 4
FIGURE 4.1 Nofri's Congestion-Phase System applied to wheat, as programmed o...
FIGURE 4.2 Four daily patterns.
FIGURE 4.3 U.S. 30-year T-bond prices showing pivot points above and below \(t\)... FIGURE 4.4 Tubbs' Law of Proportion. FIGURE 4.5 Trident entry-exit.
FIGURE 4.6 Soybean retracements in the late 1970 s.
FIGURE 4.7 S\&P retracement levels.
FIGURE 4.8 Trading a declining channel.
FIGURE 4.9 Channel calculation.
FIGURE 4.10 A sequential buy signal in the Deutsche mark.
Figure 4.11a Above the stomach.
Figure 4.11b Bullish belt hold.
Figure 4.11c Deliberation.
Figure 4.11d Morning doji star and evening doji star.
Figure 4.11e Bearish engulfing.
Figure 4.11f Last engulfing top.
Figure 4.11g Three outside up.
Figure 4.11h Two black gapping.
Figure 4.11i Rising window.
\section*{Chapter 5}
FIGURE 5.1 Gold futures with \(2.5 \%\) swing points marked.
FIGURE 5.2 Corresponding swing chart of gold using a \(2.5 \%\) swing filter.
FIGURE 5.3 Recording swings by putting the dates in the first box penetrated...
FIGURE 5.4 Livermore's trend change rules.
FIGURE 5.5 Failed reversal in the Livermore method.
FIGURE 5.6 Wilder's Swing Index applied to Eurobund back-adjusted futures, u...
FIGURE 5.7 Point-and-figure chart.
FIGURE 5.8 Best formations from Davis's study.
FIGURE 5.9 (a) Compound point-and-figure buy signals. (b) Compound point-and...
FIGURE 5.10 Point-and-figure trendlines.
FIGURE 5.11 Tests of box size for Apple shows smaller is better.
FIGURE 5.12 Tests of the S\&P futures shows results similar to moving average...
FIGURE 5.13 Entering IBM on a pullback with limited risk.
FIGURE 5.14 Entering on a confirmation of a new trend after a pullback.
FIGURE 5.15 Three ways to compound positions.
FIGURE 5.16 Placement of point-and-figure stops.
FIGURE 5.17 Cashing in on profits.
FIGURE 5.18 Alternative methods of plotting
point-and-figure reversals. (a) ...
FIGURE 5.19 Horizontal count price objectives.
FIGURE 5.20 Point-and-figure vertical count for QQQ. The major low in Octobe...
FIGURE 5.21 Renko Bricks pattern.
FIGURE 5.22 N -Day breakout applied to
Merck, using a breakout period of 5 da...
FIGURE 5.23 Apple breakout tests.
FIGURE 5.24 emini S\&P breakout tests.
FIGURE 5.25 Copper profits for the slower and faster trends in our version o...
FIGURE 5.26 Relative performance of N -day
breakout, copper futures, 1980-201...
Chapter 6
FIGURE 6.1 A basic regression analysis results
in a straight line through th...
\section*{FIGURE 6.2 Error deviation for method of least} squares.
FIGURE 6.3 Scatter diagram of corn, soybean pairs with linear regression sol...
FIGURE 6.4 Prices of ABX and gold show that gold remained high while ABX dec...
FIGURE 6.5 The best fit for ABX tracks the upward and downward move, but is ...
FIGURE 6.6 ABX-Gold regression using only the last 20-days of prices.
FIGURE 6.7 Degrees of correlation. (a) Perfect positive linear correlation (
FIGURE 6.8 Confidence bands. (a) A 95\% confidence band. (b) Out-of-sample fo...
FIGURE 6.9 Curvilinear (parabolas).
FIGURE 6.10 Comparison of ABS-Gold linear, 2nd-, and 3rd-order regressions....
FIGURE 6.11 Logarithmic and exponential curves.
FIGURE 6.12 Comparison of four regression methods on weekly corn data.
FIGURE 6.13 Solver set-up page.
FIGURE 6.14 Wheat cash prices and Solver solution.
FIGURE 6.15 Correlogram of monthly corn
prices, \(1978-2017\), for 24 lags.
FIGURE 6.16 Correlogram of weekly returns of corn, wheat, and gold, 1978-201...
FIGURE 6.17 ARIMA forecast becomes less accurate as it is used farther ahead...
FIGURE 6.18 Linear regression model. Penetration of the confidence band turn...
FIGURE 6.19 IBM trend using the slope and \(r\). (Top) IBM prices with 80-day mo...
FIGURE 6.20 AMGN shows a declining slope even though the price is higher.
Chapter 7
FIGURE 7.1 General Electric price from December 31, 2010, through February 1...
FIGURE 7.2 A comparison of moving averages.
The simple moving average, linea...
FIGURE 7.3 SP continuous futures, April through December 2010, with examples...
FIGURE 7.4 Exponential smoothing. The new exponential trendline value, \(E_{t}\), is...
FIGURE 7.5 Graphic evaluation of exponential smoothing and moving average eq...
FIGURE 7.6 Comparison of exponential smoothing techniques applied to Microso...
FIGURE 7.7 Double-smoothing applied to Microsoft, June 2010 through February...
FIGURE 7.8 Comparison of a 9 -day exponential smoothing with a 9 -day exponent...
FIGURE 7.9 The Hull Moving Average (slower trend in the top panel), compared...
FIGURE 7.10 Plotting a moving average lag and lead for a short period of Mic...
\section*{Chapter 8}
FIGURE 8.1 Distribution of runs. The shaded area shows the normal distributi...
FIGURE 8.2 Frequency distribution of returns for SP futures using a 40-day s...
FIGURE 8.3 Amazon (AMZN) with a 40-day moving average.
FIGURE 8.4 A trend system for NASDAQ 100 futures, using an 80 -day moving ave...
FIGURE 8.5 Four volatility bands around a 20day moving average, based on (a...
FIGURE 8.6 Adaptive bands constructed using double exponential smoothing sho...
FIGURE 8.7 Bollinger bands applied to Ford.
FIGURE 8.8 Combining daily and weekly Bollinger bands.
FIGURE 8.9 Modified Bollinger bands shown with original bands (lighter lines...
FIGURE 8.10 Simple reversal rules for using bands.
FIGURE 8.11 Basic rules for using bands.
FIGURE 8.12 A g-day TRIX based on euro futures shows that a triple smoothing...
FIGURE 8.13 Cumulative profits of S\&P futures for four strategies.
FIGURE 8.14 Results of trend strategies for Boeing (BA) from 1998 through Ju...
FIGURE 8.15 Moving average net profits from futures, 1998-2018.
FIGURE 8.16 Moving average net profits for selected stocks, 20 years ending ...
FIGURE 8.17 Amazon (AMZN) net profits from three systems.
FIGURE 8.18 Boeing (BA) net profits from three systems.
FIGURE 8.19 Ford (F) net profits from three systems.
FIGURE 8.20 Eurodollar futures have a strong trend and benefit from any tren...
FIGURE 8.21 The euro currency (CU) has a strong trend but performs about the...
FIGURE 8.22 emini S\&P futures show a weak long-term trend and excessive nois...
FIGURE 8.23 Crude oil futures (CL) has had wide-ranging, volatile price move...
FIGURE 8.24 Three ways to trade using two
moving averages. (a) Enter and exi...
FIGURE 8.25 Moving average crossover for euro futures using 100-day and 30-d...
FIGURE 8.26 Donchian's 5- and 20-Day Moving Average System (somewhat moderni...
FIGURE 8.27 The Golden Cross applied to SPY showing both long-short and long...
FIGURE 8.28 The ROC Method applied to S\&P futures, 1998-2017.
FIGURE 8.29 The Ichimoku Cloud shown on the Dow Industrials.
FIGURE 8.30 Sequences of moving averages.
Left is the original sequence. On ...
FIGURE 8.31 Ehlers' Early Onset Trend indicator for SPY during 2018.
\section*{Chapter 9}
FIGURE 9.1 Geometric representation of momentum.
FIGURE 9.2 Price (top) and corresponding momentum (bottom).
FIGURE 9.3 20- and 40-day momentum
compared to a 20- and 40-day moving avera...
FIGURE 9.4 Momentum is also called relative strength, the difference between...
FIGURE 9.5 Trend signals using momentum.
FIGURE 9.6 Relationship of momentum to
prices. (a) Tops and bottoms determin...
FIGURE 9.7 20-Day momentum (center panel) and 3 -day momentum (bottom panel) ...
FIGURE 9.8 A longer view of the 20- and 3-day momentum applied to the S\&P. T...
FIGURE 9.9 MACD for AOL. The MACD line is the faster of the two trendlines i...
FIGURE 9.10 The Herrick Payoff Index applied to the DAX, 2000 through Februa...
FIGURE 9.11 Divergence Index applied to S\&P futures.
FIGURE 9.12 John Ehlers' SwamiChart showing S\&P price using 15 -minute bars a...
FIGURE 9.13 RSI bottom and top formations using a 20-day RSI applied to SPY....
FIGURE 9.14 Performance of the 2-day RSI, MarketSci blog's favorite oscillat...
FIGURE 9.15 2-Period RSI (center panel) compared with the traditional 14-day...
FIGURE 9.16 RSI applied to the spread between a 10 -week and 40 -week moving a...
FIGURE 9.17 Comparison of simple
momentum, RSI, and stochastic, all for 14-d...
FIGURE 9.18 20-Day stochastic (bottom) and a 6o-day moving average for the S...
FIGURE 9.19 Lane's patterns. (a) Left and right
crossings. (b) Hinge. (c) Be...
\section*{FIGURE 9.20 Williams' A/D Oscillator.}
FIGURE 9.21 Williams' Ultimate Oscillator.
FIGURE 9.22 Ehlers' Relative Vigor Index for QQQ.
FIGURE 9.23 Comparing the TSI with 10-2020 smoothing (bottom) to a standard...
FIGURE 9.24 Comparison of TRIX (center panel) and TSI (lower panel) using tw...
FIGURE 9.25 (a) Average velocity. (b)
Instantaneous velocity.
FIGURE 9.26 SPY prices (top) with first differences (center) and second diff...
FIGURE 9.27 The Parabolic Stop-and-Reverse, similar to the Direction Parabol...
FIGURE 9.28 Momentum divergence.
FIGURE 9.29 An example of divergence in Amazon.com.
FIGURE 9.30 Slope divergence of NASDAQ 100 using double smoothing.
Chapter 10
FIGURE 10.1 A classic chart of wheat seasonality using cash prices, 1978-201...
FIGURE 10.2 Wheat seasonality from backadjusted futures, using differences....
FIGURE 10.3 Percentage of profitable years for cash wheat.
FIGURE 10.4 (a) Cash corn average monthly returns, 1978-2017. (b) Percentage...
FIGURE 10.5 (a) Cash cotton average monthly returns, 1978-2017. (b) Percenta...
FIGURE 10.6 (a) Unleaded gasoline, average yearly percentage change, 1985-20...
FIGURE 10.7 Comparison of heating oil monthly returns, with and without, 200...
FIGURE 10.8 (a) Cotton average monthly returns. (b) High-low price range, in...
FIGURE 10.9 Cotton percentage monthly changes, sorted highest to lowest.
FIGURE 10.10 (a) Average returns by month for Southwest Airlines (LUV). (b) ...
FIGURE 10.11 (a) Amazon average returns by month. (b) eBay average returns b...
FIGURE 10.12 Comparing the change in percentage of positive years for Amazon... FIGURE 10.13 Platinum average returns by month shows much greater demand in ...
FIGURE 10.14 Ford returns, during the past ten years, spike in the spring an...
FIGURE 10.15 (a) Cash wheat volatility as a percentage of price. (b) Wheat v...
FIGURE 10.16 Southwest Airlines (LUV) (a) average monthly returns, and (b) a...
FIGURE 10.17 Heating oil volatility (a) in cents/barrel, and (b) as a percen...
FIGURE 10.18 (a) Amazon price minus a 12month moving average lagged 6 month...
FIGURE 10.19 (a) Amazon detrended prices using a 12-month MA lagged 6 months...
FIGURE 10.20 Amazon price detrended for the period 2009-2017. Vertical lines...
FIGURE 10.21 Seasonal pattern of wheat using the method of yearly averages....
FIGURE 10.22 The four steps in creating link relatives.
FIGURE 10.23 Moving average method for wheat. (a) Moving average through mid...
FIGURE 10.24 Weather sensitivity for soybeans and corn.
FIGURE 10.25 Heating oil cash and futures average monthly returns, 2009-2017...
FIGURE 10.26 Cash and futures corn monthly returns, 2008-2017.
FIGURE 10.27 Coffee cash and futures monthly returns, 2008-2017.
FIGURE 10.28 (a) Corn seasonality for different years. (b) Comparison of cor...
FIGURE 10.29 Comparison of wheat average monthly returns for cash, futures, ...
FIGURE 10.30 Comparison of sugar seasonality, 2008-2015 for cash, futures, a... FIGURE 10.31 Comparison of coffee seasonality using cash, futures, and the E...
FIGURE 10.32 Corn net returns for the calendar years.
FIGURE 10.33 Entering a mean-reversion trade at the end of January in corn....
FIGURE 10.34 Pattern of bullish and bearish years by month.
FIGURE 10.35 Results of seasonal and nonseasonal trades using cash corn.
FIGURE 10.36 Applying the cash corn strategies to corn futures.
FIGURE 10.37 Results of modified seasonal strategy using corn futures.
FIGURE 10.38 Canadian dollars per U.S. dollar.
FIGURE 10.39 Seasonality in the U.S. stock market. (a) Average monthly retur...
FIGURE 10.40 Returns in December, 1998 2016 and 2011-2016, show similar patt... FIGURE 10.41 Daily returns of TNX and TN (futures).
FIGURE 10.42 Returns of bonds are declining.
FIGURE 10.43 Best returns of SPY and SP cluster at the beginning of the mont...
FIGURE 10.44 Returns of the equity index are increasing.
FIGURE 10.45 Results of January patterns.
FIGURE 10.46 Average returns for the year, excluding January.
FIGURE 10.47 SPY monthly volatility and returns, 1994-2017.
Chapter 11
FIGURE 11.1 Cattle cash prices, 1978-2017.
FIGURE 11.2 Peaks and valleys of cattle prices, marked visually.
FIGURE 11.3 Cattle prices for 2012-2017, with circles marking the observed p...
FIGURE 11.4 Searching for the Swiss franc/U.S. dollar cycle.
FIGURE 11.5 The 8.6-year business cycle.
FIGURE 11.6 The Wheeler Index of War.
FIGURE 11.7 The Kondratieff Wave (along the
bottom), as of 2000.
FIGURE 11.8 Another representation of the
Kondratieff Wave.
FIGURE 11.9 Returns of the Dow Jones
Industrials in the presidential cycle....
FIGURE 11.10 Volatility range, separated by presidential cycle, from 1948 to...
FIGURE 11.11 Detail of the election-year cycle. Each chart shows the history...
FIGURE 11.12 Cumulative returns trading each cycle year.
FIGURE 11.13 A 20-10 triangular MACD applied to IBM.
FIGURE 11.14 A 252-126 triangular MACD applied to back-adjusted corn futures...
FIGURE 11.15 Sinusoidal (sine) wave.
FIGURE 11.16 Compound sine wave.
FIGURE 11.17 Solver screen for corn solution.
FIGURE 11.18 Corn with trigonometric fit using Solver.
FIGURE 11.19 Spectral density. (a) A compound wave \(D\), formed from three prim...
FIGURE 11.20 10-, 20-, and 40-day cycles, within a 250 -day seasonal.
FIGURE 11.21 Output of spectral analysis program.
FIGURE 11.22 Excel spreadsheet showing input prices and output from Fourier ...
FIGURE 11.23 Results of Excel's Fourier Analysis for Southwest Airlines (LUV...
FIGURE 11.24 Cash corn cycles using Excel's
Fourier Analysis based on return...
FIGURE 11.25 The phase angle forms a sawtooth pattern.
FIGURE 11.26 A cycle with the phasor and phase angle.
FIGURE 11.27 Back-adjusted soybean futures, 1982-2018, with the Hilbert Tran...
FIGURE 11.28 Probability Density Function (PDF) of a sine wave.
FIGURE 11.29 Monthly AMR (top) prices from 1982 with the Fisher Transform (2...
FIGURE 11.30 Ehlers' Universal Oscillator shown along the bottom of a heatin...
FIGURE 11.31 The Short Cycle Indicator applied to the emini S\&P 30- (top pan...
FIGURE 11.32 Hurst's phasing and target price projection.
Chapter 12
FIGURE 12.1a Average annual volume of Amazon with 1 standard deviation line....
FIGURE 12.1b Amazon average daily volume from January 29 through February 16...
FIGURE 12.2 Tesla price and volume showing numerous spikes on price drops.
FIGURE 12.3 Gold futures with multiple volume spikes, not as extreme or as w...
FIGURE 12.4 Caterpillar (CAT) chart plotting as Equivolume.
FIGURE 12.5 Microsoft prices (top), volume (second panel), normalized 50-day...
FIGURE 12.6 On-Balance Volume applied to GE from December 2010 through April...
FIGURE 12.7 S\&P prices are shown with the volume, OBV, and a 40 -day trend of...
FIGURE 12.8 Blau's Tick Volume Indicator.
FIGURE 12.9 Volume-weighted MACD applied to euro currency futures.
FIGURE 12.10 Elastic Volume-Weighted Moving Average (tracking closer to pric...
FIGURE 12.11 Gold futures with open interest (center) and volume (bottom), e...
FIGURE 12.12 SPY prices ending in February 2018 with the McClellan Oscillato...
FIGURE 12.13 SPY prices with BoltonTremblay Index (center) and Thrust Oscil... FIGURE 12.14 The Arms Index (TRIN) shown with SPY during 2017.
FIGURE 12.15 High-Low Ratio (bottom) shown with SPY (top).
FIGURE 12.16 Total PL using the AD ratio as a countertrend signal applied to...
FIGURE 12.17 QQQ prices (top) with volume
(bottom), along with the lagged av...
FIGURE 12.18 Average return per day for 275 stocks using the volume spike ru...
FIGURE 12.19 Total returns of all trades taken using the volume spike rules....
FIGURE 12.20 Result of trades chosen randomly using the volume spike rules....
FIGURE 12.21 Trading volatility spikes in SPY that come at the same time as ...
FIGURE 12.22 Results of the Pseudo-Volume Strategy for SPY, IWM, and XLE.
FIGURE 12.23 Intraday, 15-minute tick volume patterns, 1995-2005. (a) Crude ...
Chapter 13
FIGURE 13.1 Interdelivery price relationship and terminology. (a) Precious m...
FIGURE 13.2 Major Index futures markets. From top to bottom: Dow Industrials...
FIGURE 13.3 (a) Ratio of S\&P 500 to Dow Industrial. (b) Ratio of S...
FIGURE 13.4 Lennar (LEN) and KB Home (KBH) prices.
FIGURE 13.5 Rolling correlations of Lennar and \(K B\) Home returns.
FIGURE 13.6 Price histories of ICBC and BOC from 2007, traded in Shanghai.
FIGURE 13.7 Example of standard deviation bands around the price difference ...
FIGURE 13.8 Total profits using the standard deviation of price difference \(f\)...
FIGURE 13.9 The 6-day raw stochastic of INTC, MU, and TXN prices.
FIGURE 13.10 Total profit from the pair LENKBH using the momentum differenc...
FIGURE 13.11 Stress indicator for LEN-KBH using momentum differences as inpu...
FIGURE 13.12 Gold futures (top) and Barrick Gold (ABX) from October 2016 thr...
FIGURE 13.13 Trading signals for the bondutilities arbitrage strategy, May ...
FIGURE 13.14 Intercrop spreads. (a) Normal carrying charge relationship. (b)...
FIGURE 13.15 Delivery month distortions in the old crop, making a butterfly...
\section*{FIGURE 13.16 Corrections to interdelivery} patterns.
\section*{FIGURE 13.17 Eurodollar term structure of futures prices.}
FIGURE 13.18 Implied yield from gold futures, April 5, 2011.
FIGURE 13.19 Interest rate differential versus change in futures prices duri...
FIGURE 13.20 (a) Historic volatility and implied volatility, 1998-February 2...
FIGURE 13.21 The VIX index (not tradeable) and UVXY (tradeable, leveraged)....
FIGURE 13.22 Implied vol (VIX index) and historic vol (calculated).
FIGURE 13.23 UVXY stochastic minus the HV stochastic.
FIGURE 13.24 Net asset values of long trades, short trades, and combined lon...
FIGURE 13.25 The weekly gold/silver ratio, from 2014 through 2017 based on n...
FIGURE 13.26 The platinum-gold ratio, shown here from 2014 through mid-2018 ...
FIGURE 13.27 The decline in S\&P futures (top panel) is met by higher 10-year...
FIGURE 13.28 Rolling 20-day correlations. FIGURE 13.29 Returns based on timing SPY with HYG and JNK.
FIGURE 13.30 Crude oil (top) denominated in gold (center, daily futures) giv...
FIGURE 13.31 Total profits using a 20-day trend of the crude/gold ratio.
FIGURE 13.32 Interdelivery spread volatility. (a) Actual prices. (b) Relatio...
FIGURE 13.33 Annualized volatility of
\section*{SP/NASDAQ price ratio, using futures, ...}
FIGURE 13.34 The platinum-gold ratio for 1 year beginning March 2010, using ...
FIGURE 13.35 (a) Results of buying the 10 Dow stocks with the worst returns, ...
FIGURE 13.36 Results of Dow hedge strategy.
FIGURE 13.37 Poor spread selection. (a) Spread price. (b) Spread components....
\section*{Chapter 14}
FIGURE 14.1 Price reaction to unexpected news, including delayed response. T...
FIGURE 14.2 Price shocks in U.S. bond futures (top) and the corresponding mo...
FIGURE 14.3(a) Bond futures returns from upward price shock using 2...
FIGURE 14.3(b) Figure Bond returns using a \(3 \times\) ATR threshold.
FIGURE 14.4 U.S. bond futures, returns from long positions following upward ...
FIGURE 14.5 Returns from crude oil price shocks using the threshold 2...
FIGURE 14.6 Returns from crude oil price shocks using the larger 3...
FIGURE 14.7 S\&P futures price shocks \(>2\) ATRs. (a) Upside shocks. (a) Downsi...
FIGURE 14.8 S\&P futures price shocks using 3
ATRs, 1991-2017. (a) Upward sho...
FIGURE 14.9 Commitment of Traders Report (short form) from the CFTC.gov webs...
FIGURE 14.10 Commitment of Traders Report (long form), May 10, 2011.
FIGURE 14.11 Jiler's normal trader positions.
FIGURE 14.12 (a) Soybeans nearest futures, July 2017-April 2018. (b) The Bri...
\section*{FIGURE 14.13 (a) S\&P continuous futures and}
(b) the Briese COT Index for eac...
FIGURE 14.14 Interpretation of the Bullish Consensus.
FIGURE 14.15 Typical contrarian situation: wheat, 1978.
FIGURE 14.16 The put/call ratio (\$CPCE),
October 2017-mid-April 2018.
FIGURE 14.17 The golden spiral, also the logarithmic spiral, is a perfect re...
FIGURE 14.18 Basic Elliott wave.
FIGURE 14.19 Triangles and ABCs.
FIGURE 14.20 Compound correction waves.
FIGURE 14.21 Elliott's threes.
FIGURE 14.22 Price relationships in Supercycle (V).
FIGURE 14.23 The Supercycle as of 2019.
FIGURE 14.24 MTpredictor of Elliott Wave applied to yen futures.
FIGURE 14.25 Trading signals for the Elliott Wave strategy, and the Elliott ...
FIGURE 14.26 (a) Pentagon constructed from one diagonal. (b) Pentagon constr...
FIGURE 14.27 Using circles to find support and resistance.
FIGURE 14.28 Elliott's complete wave cycle.
FIGURE 14.29 Calculation of time-goal days.
FIGURE 14.30 Price goals for standard 5 -wave moves.
FIGURE 14.31 Gann's soybean worksheet.
FIGURE 14.32 May soybean square.
FIGURE 14.33 An example of Gann angles from ganntrader.com.
FIGURE 14.34 The Hexagon Chart.
FIGURE 14.35 Saturn lines drawn on the Dow
Industrial Average.
FIGURE 14.36 The DJIA Clock.
FIGURE 14.37 Geometry of a solar eclipse.
FIGURE 14.38 Geometry of a lunar eclipse.
\section*{Chapter 15}
FIGURE 15.1 Graph of the New York Stock Market.
FIGURE 15.2 30-year bond futures percentage moves for bars in the same direc...
FIGURE 15.3 U.S. bond futures, average net point change by bar.
FIGURE 15.4 S\&P back-adjusted futures with intervals of study marked.
FIGURE 15.5 S\&P time patterns showing three different market periods corresp...
FIGURE 15.6 Back-adjusted futures for crude oil showing four intervals with ...
FIGURE 15.7 Crude oil time pattern for the sharp price decline from the high...
FIGURE 15.8 Crude oil time patterns for three cases of bull market, sideways...
FIGURE 15.9 U.S. 30-year bond futures, highs and lows by time.
FIGURE 15.10 Distribution of highs and lows for \(S \& P\) futures, during the bull...
FIGURE 15.11 S\&P futures, cumulative
percentage of highs and lows, 2009-2017...
FIGURE 15.12 S\&P futures, frequency of highs and lows during the financial c...
FIGURE 15.13 EURUSD futures from 2001 show wide price swings.
FIGURE 15.14 EURUSD high-lows marked with the times when the U.S. and Europe...
FIGURE 15.15 U.S. 30 -year bond weekday patterns, 2000-April 2018.
FIGURE 15.16 Weekday patterns for heating oil futures, 2000-April 2018.
FIGURE 15.17 Heating oil weekday patterns, April 2017-April 2018.
FIGURE 15.18 Weekday patterns for S\&P futures, 2000-April 2018.
FIGURE 15.19 S\&P futures weekday patterns, 2009-2017.
FIGURE 15.20 Amazon (AMZN) weekday patterns during the bull market, 2009-Apr...
FIGURE 15.21 U.S. bonds weekday patterns filtered with a 120-day moving aver...
FIGURE 15.22 S\&P futures weekday patterns filtered by three trends, \(30,60, \ldots\)
FIGURE 15.23 U.S. 30 -year bond futures, 2010-April 2018, average price chang...
FIGURE 15.24 U.S.30-year bond futures, volume ratio.
FIGURE 15.25 Euro futures price differences by day of month, 2010-2017.
FIGURE 15.26 Euro futures volume ratio by day of month, 2010-2017.
FIGURE 15.27 S\&P futures price differences,
2010-2017.
FIGURE 15.28 S\&P futures volume ratio, 20102017.
FIGURE 15.29 Amazon returns by day, 20102017.
FIGURE 15.30 Amazon volume ratio by day, 2010-2017.
FIGURE 15.31 The 3-day trade system applied to SPY, showing net P/L with and...
FIGURE 15.32 Specific buying and selling days. Chapter 16
FIGURE 16.1 Moving averages applied to a 20minute bar crude oil business da...
FIGURE 16.2 USDGBP 5-min, 24-hr data with a 20-bar moving average.
FIGURE 16.3 USDGBP 5-min data grouped by 100-tick bars, with a 20-bar moving...
FIGURE 16.4 Intraday volatility pattern for 20min crude oil, showing a jump...
FIGURE 16.5 Intraday volatility indicator using past 5 days applied to 20-mi...
FIGURE 16.6 Intraday timing of market
\(\underline{\text { movement. }}\)
FIGURE 16.7 Midday support and resistance breakout applied to 30 -min S\&P fut...
FIGURE 16.8 S\&P 30-min bars with a 2-bar breakout.
FIGURE 16.9 Using the LBR/RSI \({ }^{\mathrm{TM}}\) indicator to trade a 1st-hour breakout.
FIGURE 16.10 Example of using \(0.5 \times\) ATR thresholds from the open.
FIGURE 16.11 Example of using \(0.5 \times\) ATR thresholds from the previous close.
FIGURE 16.12 Optimization of \(30-\mathrm{min}\) S\&P breakout using an ATR factor measure...
FIGURE 16.13 Optimization of \(30-\mathrm{min}\) S\&P breakout using an ATR factor measure...
FIGURE 16.14 S\&P trend filter optimization based on breakout from the open....
FIGURE 16.15 S\&P trend filter optimization based on a factor of the ATR meas...
FIGURE 16.16 Net profits from S\&P breakout using the open and a trend filter...
FIGURE 16.17 Net profits from S\&P breakout using the previous close and a tr...
FIGURE 16.18 Mean reversion optimization based on the open using only the cu...
FIGURE 16.19 Net profits from the S\&P mean reversion strategy based on exten...
FIGURE 16.20 Fisher's buy-and-reverse scenario.
FIGURE 16.21 HFT market-maker sequence.
FIGURE 16.22 HFT with two similar markets,
\section*{trading the one that lags.}
FIGURE 16.23 Intraday volume patterns for crude oil, December 2004. The bott...
FIGURE 16.24 20-minute gold bars with today's bar volatility, the average ba...
Chapter 17
FIGURE 17.1 Similar price moves with low and high noise.
FIGURE 17.2 20-minute gold futures with an 8period Kaufman's Adaptive Movin...
FIGURE 17.3 S\&P futures with a 60-day KAMA (the darker line) and MA in the t...
FIGURE 17.4 Total profits using an 8-period KAMA with a fixed filter applied...
FIGURE 17.5 The adaptive indicators KAMA, VIDYA, Adaptive R2, MAMA, FAMA, an...
FIGURE 17.6 Comparison of the adaptive RSI,
KAMA, and a 10 -day moving averag...
FIGURE 17.7 Parabolic Time/Price System
applied to emini S\&P futures, Februa...
FIGURE 17.8 The Trend-Adjusted Oscillator applied to \(\mathrm{S} \& \mathrm{P}\) futures, September ...
FIGURE 17.9 Ehlers' Instantaneous Trend
applied to euro futures. The thicker...
Chapter 18
FIGURE 18.1 SPY prices and annualized
volatility from 1998 through April 201...
FIGURE 18.2 Daily values of 20-day annualized volatility of SPY sorted highe...
FIGURE 18.3 Comparison of 21-period and 65period Bollinger bands, applied t...
FIGURE 18.4 Kase's 3 DevStops with a "warning" line closer to the prices. Th...
FIGURE 18.5 Forecasted trading zones using the Chande and Kroll method appli...
FIGURE 18.6 Wheat cash prices, and wheat adjusted for inflation and currency...
FIGURE 18.7 Distribution of wheat cash prices compared to the wheat price de...
FIGURE 18.8 Price distribution of indexed cash
euro, 1999-2017.
FIGURE 18.9 Low volume (center panel) and low volatility (bottom panel), the...
FIGURE 18.10 Euro futures show that volume and volatility fall to their lowe...
FIGURE 18.11 Three short-term distribution patterns. (a) A normal, long-term...
FIGURE 18.12 Moving skewness, emini S\&P futures, June 2009-June 2010.
FIGURE 18.13 Excess kurtosis (center panel)
and skew (bottom panel), applied...
FIGURE 18.14 The Kurtosis-Skew strategy
applied to emini S\&P, 30-min data (t... FIGURE 18.15 Forecast of highest and lowest corn prices expected.
FIGURE 18.16 Stochastic indicator with and without Ehlers' roofing filter.
FIGURE 18.17 Cash and futures corn prices show futures in a long-term downtr...
FIGURE 18.18 Annualized volatility of cash corn prices.
FIGURE 18.19 Original Market Profile for 30year Treasury bonds.
\section*{FIGURE 18.20 Daily Market Profile.}
FIGURE 18.21 Buyer's and seller's curves for a sequence of days.
FIGURE 18.22 Market Profile for a trending market.
FIGURE 18.23 Monkey bars shown on the
Thinkorswim trading platform on the to...
FIGURE 18.24 SPY prices, January 1-April 22, 2018.
FIGURE 18.25 Histogram of SPY prices,
\(1 / 1 / 2018-5 / 20 / 2018\)
Chapter 19
FIGURE 19.1 Euro futures 60-min data on top with 40-day trend; daily bars in...
FIGURE 19.2 Daily and weekly data and trends
for euro futures are displayed ...
FIGURE 19.3 The Triple Screen for gold futures, March and April 2011. From t...
FIGURE 19.4 Krausz's Multiple Time Frames, June 1998, U.S. Bonds. (a) Daily ...
FIGURE 19.5 S\&P continuous futures with a 6-, 12 -, and 24 -week ROC (top to b...
FIGURE 19.6 KST combined with an 18-period ROC and a 12-period trendline can...
Chapter 20
FIGURE 20.1 Four volatility measures.
FIGURE 20.2 Apple (AAPL) with a 20-day average true range (center panel) and...
FIGURE 20.3 S\&P futures, June 2016-May 2017 (top), implied volatility (VIX) ...
FIGURE 20.4 Bank of America with average true range (center) and annualized ...
FIGURE 20.5 Bank of America price versus daily returns, 1998-May 2018.
FIGURE 20.6 BAC price versus daily price differences, 1998-May 2018.
FIGURE 20.7 Cash corn prices, 1978-May 2018.
FIGURE 20.8 Annualized volatility of cash corn.
FIGURE 20.9 A scatter diagram of corn
volatility versus price, with a log cu...
FIGURE 20.10 VIX mean-reverting strategy from MarketSci Blog, triggered by t...
FIGURE 20.11 Profits from VIX Mean-
Reverting Strategy, 1998-2011.
FIGURE 20.12 QQQ prices and annualized volatility, 1999-May 2018.
FIGURE 20.13 Profits from trading QQQ with a 6o-day moving average and a vol...
FIGURE 20.14 Daily price/volume distribution shows liquidity.
FIGURE 20.15a A low noise market allows sooner entries and exits resulting i...
FIGURE 20.15b Increased noise causes entries and exits to be delayed, result...
FIGURE 20.15c High-noise markets, typical of an equity index in a major indu...
FIGURE 20.16 How the trend calculation period (the curved line) relates to m...
FIGURE 20.17 Expectations of a price move using two time periods.
FIGURE 20.18 Three matrices associated with trading signals for three differ...
FIGURE 20.19 Payout matrix for customer and refiner. Refiner chooses the row...
FIGURE 20.20 (a) Equal attractors cause a
symmetric pattern, often a figure ...
FIGURE 20.21 Points indicating fractal patterns as well as trading signals a...
FIGURE 20.22 D'Errico and Trombetta's genetic algorithm solution applied to ...
FIGURE 20.23 A biological neural network. Information is received through de...
FIGURE 20.24 A 3-layer artificial neural network to determine the direction ...
FIGURE 20.25 Learning by feedback.
\section*{Chapter 21}
FIGURE 21.1 Comparing heating oil backadjusted data with the nearest contra...
FIGURE 21.2 Visualizing the results of a 2dimensional optimization.
FIGURE 21.3 Walk-forward test results for SPY,
October 1998-December 2018.
FIGURE 21.4 Net profits from longs, shorts, and combined displayed as a bar ...
FIGURE 21.5 Optimization of QQQ shown as a line chart.
FIGURE 21.6a Euro futures optimization of a moving average system shown for ...
FIGURE 21.6b Results of euro currency futures optimization showing performan...
FIGURE 21.7a Eurodollar futures moving
average optimization results through ...
FIGURE 21.7b Results of an emini S\&P optimization.
FIGURE 21.7c Wheat futures optimization shows erratic gains in the longer ca...
FIGURE 21.7d Hog futures optimization shows gains in the short-term.
FIGURE 21.7e Cotton shows a performance spike using an 80 -day moving average...
FIGURE 21.8 Heat map of the 2 moving average crossover system.
FIGURE 21.9 A 3-dimensional bar chart of QQQ returns using a moving average ...
FIGURE 21.10 QQQ optimization results shown as a surface chart. The best res...
FIGURE 21.11a A scatter diagram of all test profits given the trend calculat...
FIGURE 21.11b All net profits given the profit factor along the bottom.
FIGURE 21.11 c All net profits given the stoploss percentage along the botto...
FIGURE 21.12 VIX mean-reversion strategy using optimal parameters.
FIGURE 21.13 Moving average optimization of copper futures, 2007-2017, showi...
FIGURE 21.14 5-Bar averages of profits and
maximum drawdowns for a copper op...
FIGURE 21.15 Averaging of map output results. (a) Center average (9 box). (b...
FIGURE 21.16 Impact of costs on the moving average system.
FIGURE 21.17 Patterns resulting from changing rules. (a) A rule change that ...
FIGURE 21.18 Net profits from a 110-period moving average and a 140-period l...
FIGURE 21.19 Net profits from the two strategies, taking only long positions...
FIGURE 21.20 Consecutive tests.
FIGURE 21.21 Heat map of ES optimization of the standard crossover system.
FIGURE 21.22 Heat map of ES optimization, "fading" the short-term trend in t...
FIGURE 21.23 Best calculation period, sorted smallest to largest.
FIGURE 21.24a Total profits from long and short positions using a 100-day mo...
FIGURE 21.24b Net gain and loss from price shocks for the QQQ trend system....
Chapter 22
FIGURE 22.1 The Gorbachev abduction caused a double price shock, with most im...
FIGURE 22.2 Labour's victory in the British
election of 1992 represents a mor...
FIGURE 22.3 Crude oil prices from Iraq's invasion of Kuwait through the begin...
FIGURE 22.4 The price shock of 9/11/2001.
FIGURE 22.5 The surprising results of the
British vote on staying in the Euro...
FIGURE 22.6 The U.S. election of 2016 was a surprise to both the stock market...
FIGURE 22.7 S\&P 500 futures. Moving average trendlines become out of phase a...
FIGURE 22.8 The S\&P decline due to the subprime crisis generated large profi...
FIGURE 22.9 Sequence of random numbers
representing occurrences of red and b...
FIGURE 22.10 Betting pattern.
FIGURE 22.11 Runs of SPY compared to
random runs.
FIGURE 22.12 Comparison of total profits for SPY and QQQ using a 120-day mov...
FIGURE 22.13 Anti-Martingales applied to
QQQ, doubling the position when the...
FIGURE 22.14 Relative risk of a moving average system.
FIGURE 22.15 Entry point alternatives for a mean-reverting strategy.
FIGURE 22.16 Relationship of profits to risk
per trade based on opportunitie...
\section*{FIGURE 22.17 Combining trends and trading} ranges.
FIGURE 22.18 Cash silver prices, 1978-June 2018.
FIGURE 22.19 Moving average results for SPY using different calculation peri...
Chapter 23
FIGURE 23.1 Changes in utility versus changes in wealth.
\section*{FIGURE 23.2 Investor utility curves.}
FIGURE 23.3 The efficient frontier. The line drawn from \(\underline{R}\), the risk-free ret...
FIGURE 23.4 Two cases in which the Sharpe ratio falls short. (a) The order i...
FIGURE 23.5 The Hindenburg Omen shown as vertical bars on a chart of SPY pri...
FIGURE 23.6 Bank of America prices with position sizes based on a \(\$ 10,000\) in...
\section*{FIGURE 23.7 VIX and annualized volatility of SPY.}
FIGURE 23.8 A closer look at VIX and SPY annualized volatility during the fi...
FIGURE 23.9 Trailing stop based on volatility, applied to Hang Seng futures....
FIGURE 23.10 30-Year bonds with an 80-day
moving average (the smooth line) a...
FIGURE 23.11 Three profit targets based on volatility and measured from the ...
FIGURE 23.12 Wait for a pullback. Most markets show that waiting can improve...
FIGURE 23.13 Compounding structures. (a) Scaled-down size (upright pyramid) ...
FIGURE 23.14 Defining the DM.
FIGURE 23.15 The 14-day ADX, PDM, and MDM, applied to NASDAQ 100 continuous ...
FIGURE 23.16 The ADX and ADXR.
FIGURE 23.17 Scatter diagram of the profit factor versus the efficiency rati...
FIGURE 23.18 Risk of ruin based on invested capital.
FIGURE 23.19 Original NAVs and filtered NAVs for a macrotrend system using s...
FIGURE 23.20 Pascal's triangle.
Chapter 24
FIGURE 24.1 Effect of diversification on risk.
FIGURE 24.2 Improving the return ratio using negatively correlated systems....
FIGURE 24.3 Rolling correlation of S\&P futures against 30-year bonds, the eu...
FIGURE 24.4 Returns of cap-weighted and
\section*{equally weighted sector ETFs.}
FIGURE 24.5 Weights of XLV components. FIGURE 24.6 Returns of XLV, capitalizationweighted 9 stocks, and equally-we...
FIGURE 24.7 SPY and BND NAVs compared to a portfolio of \(60 \%\) SPY + 40\% BND.
FIGURE 24.8 Prices of the 4 assets used in the Solver solution, converted to...
FIGURE 24.9 Solver results.
FIGURE 24.10 GASP solution for 16 NASDAQ 100 futures strategies.
FIGURE 24.11 NAV of macrotrend system with no volatility stabilization.
FIGURE 24.12 NAV of the same macrotrend system with volatility stabilization...
\title{
TRADING SYSTEMS AND METHODS
}
Sixth Edition
\author{
Perry J. Kaufman
}
WILEY
Copyright (C) 2013, 2020 by Perry J. Kaufman. All rights reserved.
Published by John Wiley \& Sons, Inc., Hoboken, New Jersey.
Published simultaneously in Canada.
No part of this publication may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, scanning, or otherwise, except as permitted under Section 107 or 108 of the 1976 United States Copyright Act, without either the prior written permission of the Publisher, or authorization through payment of the appropriate per-copy fee to the Copyright Clearance Center, Inc., 222 Rosewood Drive, Danvers, MA 01923, (978) 750-8400, fax (978) 646-8600, or on the Web at www.copyright.com. Requests to the Publisher for permission should be addressed to the Permissions Department, John Wiley \& Sons, Inc., 111 River Street, Hoboken, NJ 07030, (201) \(748-6011\), fax (201) \(748-6008\), or online at www.wiley.com/go/permissions.
Limit of Liability/Disclaimer of Warranty: While the publisher and author have used their best efforts in preparing this book, they make no representations or warranties with respect to the accuracy or completeness of the contents of this book and specifically disclaim any implied warranties of merchantability or fitness for a particular purpose. No warranty may be created or extended by sales representatives or written sales materials. The advice and strategies contained herein may not be suitable for your situation. You should consult with a professional where appropriate. Neither the publisher nor author shall be liable for any loss of profit or any other commercial damages, including but not limited to special, incidental, consequential, or other damages.
For general information on our other products and services or for technical support, please contact our Customer Care Department within the United States at (800) 762-2974,
outside the United States at (317) 572-3993, or fax (317) 5724002.
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.
\section*{Library of Congress Cataloging-in-Publication Data is Available:}
ISBN 9781119605355 (Hardcover)
ISBN 9781119605386 (ePDF)
ISBN 9781119605393 (ePub)
Cover Design: Wiley
Cover Images: (C) Nikada/Getty Images,
(C) KTSDESIGN/SCIENCE PHOTO LIBRARY/Getty Images
Author Photo Credit: AlexZ Photography
To my mother, in her \(100^{\text {th }}\) year
\section*{PREFACE}
What I've learned by trading and studying the markets for many years is that markets do not repeat themselves. Yes, there are similar moves for different reasons, and seemingly the same reasons cause different moves. Where is the common ground? I believe it is in turning specific patterns into generalized ones. For example, is a weekly pattern where there are four days up and one day down on Tuesday different from four days up and a down day on Friday? It's not different if you see it only as four days up and one day down. Successful strategies move from the specific to the general.
Success in trading is in the ability to see the bigger picture, the shape of the price moves rather than the highly specific pattern. That's why long-term moving averages work. You can mix the prices around and still get the same average. Fine tuning was never a good solution. We always return to the idea "loose pants fit everyone." Because we don't know exactly how a price move will develop, we need to build in the flexibility to stay with your strategy through as many challanging scenarios as possible.
\section*{THE MOVE TOWARD MORE ALGORITHMIC APPROACH}
The algorithmic trader, myself included, is more comfortable having an idea of the risk and reward of a
system, knowing full well that future losses can be greater, but so can future profits. What makes traders nervous is the unknown and unexpected risk. Having any type of loss-limiting method, whether a stop loss or just the change in trend direction, means you have some control over risk. It may not be perfect, but it's much better than watching your equity disappear and having to make a decision under stress. "Better to be out and wish you were in, than in and wish you were out."
Institutions such as Blackrock see algorithmic solutions in a different light. It is said that a year ago they eliminated portfolio stock selection by managers in favor of computerized selection. There are methods, discussed in Chapter 24, that have proved highly successful, and don't require more than a few seconds of compute time (although a substantial database is needed). A computer may not be better than the best trader, but it can compete at a high level.
I know a trading company that is gearing up to provide artificial intelligence support for clients, including portfolio selection and individual trade
recommendations. Their approach also includes training for beginning and intermediate traders. Is this the way knowledge is going to be disseminated in the future? It may be clearer to get an answer from a computer than to ask an "expert." And, if you don't yet understand, you can keep asking and the computer won't become impatient.
\section*{COMPETITION}
Trading has become more competitive. High-frequency trading surged 10 years ago as technology made access faster and easier. Just like program trading, institutions jumped into the space, quickly reducing the chances for making big returns. Many players dropped out, not willing to allocate capital to small returns. The market seems to sort all of it out on its own.
It is the same with the deluge of ETFs. There are multiple ETFs for nearly every aspect of the markets, the S\&P 500, S\&P high dividend stocks, growth stocks, leveraged, and every sector in the S\&P, with inverse ETFs for each one, midcaps, small caps, no caps. Again, the market sorts them out. Simply look at the volume to know which will survive.
What about the trend follower? Can he or she survive? Because major trends are based on fundamentals, usually interest rate policy, growth, or trade, they continue to drive prices with persistence, sometimes lasting for six months, sometimes for six years, and in the case of U.S. interest rates, for most of 35 years. We can't capture all of that move, and there are some volatile periods along the way, but a macrotrend trader will capture enough to be rewarded.
\section*{ACCEPTING RISK}
One of the most important lessons that I've learned is to accept risk. No matter how we engineer a trading system, adding stops and profit-taking, leveraging up and down, and hedging when necessary, it's not possible to remove the risk. If you think you've eliminated it in one place, it
will pop up somewhere else. If you limit each trade to only a small loss, a series of losses will still add to a large loss.
The way to survive is first to understand the risk profile of your method. Then capitalize it so that you won't panic and do something irrational, such as sell out at the lows. As you accumulate profits, you can increase your investment without risking your initial capital. Think of it as a long-term partnership with the market.
\section*{THE LONG BULL MARKET}
Following the 2008 financial crisis, the U.S. experienced one of the longest bull markets in its history. During these unusual periods, traders try to adjust to low volatility and small drawdowns. Buying any pullback is profitable. But all bull markets end, just as the Internet bubble ended in 2000. They don't all "burst," but they become far more volatile as they revert to their longterm pattern.
Taking advantage of an unusual pattern can be profitable but should only be done with a small part of your investment. The next pattern is not likely to last as long as the 8 -year bull market. Watching the way prices move can lead to changes in the way you enter orders. For example, during past few years, stocks that gap much higher on earnings reports tend to close even higher. Stocks that gap much lower tend to close near or above their open. Observations can be turned into profits. There is no substitute for watching price movement.
\section*{WHAT'S NEW IN THE SIXTH EDITION}
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0080.jpg?height=126&width=144&top_left_y=175&top_left_x=65)
Besides updating many of the charts and examples, some of the chapters have been largely rewritten to make them clearer and better organized. Unnecessary detail has been removed to make room for more new material, such as artificial intelligence and game theory. More professional techniques have been added, including volatility stabilization and risk management. There are new systems and techniques, most of which have been programmed and can be found on the Companion Website. Large tables have been removed in favor of putting them online. Many of the tables now appear in Excel format, which I find easier to read. Some of the math has been removed and replaced by Excel functions and other software apps.
I recognize that a large part of the readership in now outside the United States. Some of the new examples use Asian markets. Many of the more technical words familiar to U.S. readers have been replaced by more general explanations. I'm sure that readers in all countries will find this an improvement.
\section*{COMPANION WEBSITE}
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0080.jpg?height=134&width=146&top_left_y=1637&top_left_x=64)
The Companion Website is an important part of this book. You will find hundreds of TradeStation programs and Excel spreadsheets, and some MetaStock programs, that allow you to test many of the strategies
with your own parameters. Look for the "e" in the margin to indicate a Website program. There is no substitute for trying it yourself, then modifying the code to reflect your own ideas.
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0081.jpg?height=135&width=146&top_left_y=322&top_left_x=66)
In addition, the Appendices in the previous edition, and the Bibliography, have been moved to the Companion Website to make room for new material.
\section*{WITH APPRECIATION}
This book draws on the hard work and creativity of hundreds of traders, financial specialists, engineers, and many others who are passionate about the markets. They continue to redefine the state of the art and provide all of us with profitable techniques and valuable tools.
The team at John Wiley have provided a high professional level of support for my work over the past 40 years. It is not possible to name all of those who have helped, from Stephen Kippur to Pamela van Giessen, and now Bill Falloon and Michael Henton. I truly appreciate their efforts.
As a final note, I would like to thank all the previous readers who have asked questions that have led to clearer explanations. They are the ones who find typographical errors and omissions. They have all been corrected, making this edition that much better.
Wishing you success,
Freeport, Grand Bahama
December 2019
\section*{CHAPTER 1}
\section*{Introduction}
It is not the strongest of the species that survive, nor the most intelligent, but the ones most responsive to change.
-Charles Darwin
Let's start by defining the term technical analysis. Technical analysis is the systematic evaluation of price, volume, breadth, and open interest, for the purpose of price forecasting. A systematic approach may simply use a bar chart and a ruler, or it may use all the computing power available. Technical analysis may include any quantitative method as well as all forms of pattern recognition. Its objective is to decide, in advance, based on a set of clear and complete rules, where prices will go over some future period, whether 1 hour, 1 day, or 5 years.
Technical analysis is not just the study of chart patterns or the identification of trends. It includes intermarket analysis, complex indicators, and mean reversion, as well as the testing process and the evaluation of test results. It can use a simple moving average or a neural network to forecast price moves. This book serves as a reference guide for all of these techniques, puts them in some order, and explains the functional similarities and differences for the purpose of trading. It includes portfolio construction and multilevel risk control, which
are integral parts of successful trading.
\section*{THE EXPANDING ROLE OF TECHNICAL}
\section*{ANALYSIS}
Quantitative methods for evaluating price movement and making trading decisions have become a dominant part of market analysis. Those who do not actively trade with methods such as overbought and oversold indicators are most likely to watch them along the bottom of their screen. The major financial networks are always pointing out price trends and support and resistance levels. They are quick to say that a price that moves up or down was done on low volume, implying that it might be unreliable. The 200-day moving average seems to be the benchmark for long-term direction, and the 50-day for short-term.
In 2002 the U.S. government questioned the integrity of the research produced by major financial houses that have a conflict between financing/underwriting and advising retail brokerage. The collapse of Enron caused us to question the earnings, debt, quality of business, and other company data released to the public by large and small firms. When trading equities in other countries, it is never clear that the financial data is either correct or timely. But price and volume are always accurate. It is not surprising that more quantitative trading methods have been adopted by research firms. In March 2017, Blackrock announced that it would eliminate 40 portfolio managers in favor of algorithmic stock selection. When decisions are made with clear
rules and calculations that can be audited, those analysts recommending buys and sells are safe from scrutiny.
Extensive quantitative trading exists around the world. Interest rate arbitrage is a major source of revenue for banks. Location arbitrage is the process that keeps the price of gold and other precious metals the same all over the globe. Program trading keeps the collective price of stocks in line with S\&P futures and SPY (the SPDR ETF) prices. These fully automated systems are now called algorithmic trading.
If you don't think of arbitrage as technical trading, then consider market neutral strategies, where long and short positions are taken in related markets (pairs trading) in order to profit from one stock rising or falling faster than the other. If you change your time horizon from hours and days to milliseconds, you have high-frequency trading. You might prefer to take advantage of the seasonality in the airline industry or try your hand trading soybeans. Both have clear seasonal patterns as well as years when other factors (such as a disruption in energy supply) overwhelm the seasonal factors. Trading seasonal patterns falls under technical analysis.
Technology that allows you to scan and sort thousands of stocks, looking for key attributes - such as high momentum, a recent breakout, or other indicator values - is technical analysis on a broad scale. High-frequency trading has become a profit center for large financial institutions, but involves placing computer equipment as close to the source of the exchange price transmission as possible - a contentious issue. High-frequency trading is
credited for adding liquidity by increasing volume in equities, but has also been blamed for spectacular, highly volatile price moves.
Most impressive is the increase in managed funds that use technical and quantitative analysis. Many billions of investment dollars are traded using trend-following, timing techniques, mean reversion, and countless other systematic methods. It is thought that well over half of all managed money uses algorithmic trading. The use of technical analysis has infiltrated even the most guarded fundamental fortresses.
\section*{CONVERGENCE OF TRADING STYLES IN STOCKS AND FUTURES}
The development of technical analysis has taken a different path for stocks and futures. This seems natural because the two markets cater to investors with different time frames and different commercial interests. At the same time, those markets place very different financial demands on the investor.
The original users of the futures markets were grain elevators and grain processors, representing the supply side and the demand side. The elevators are the grain wholesalers who bought from the farmers and sold to the processors. The futures markets represented the fair price and grain elevators sold their inventory on the Chicago Board of Trade to lock in a price (hopefully a profit). The processor, typically a bread manufacturer or meat packer, used the futures markets to fix a low price
for their material cost and as a substitute for holding inventory. Both producer (the sell side) and processor (the buy side) only planned to hold the position for a few weeks or a few months, until they either delivered their product to market or purchased physical inventory for production. There was no long-term investment, simply a hedge against risk. Futures contracts, similar to stock options, expire every two or three months and can be held for about one year; therefore, it is nearly impossible to "invest" in futures.
One other critical difference between futures and stocks is the leverage available in futures. When a processor buys one contract of wheat, that processor puts up a good faith deposit of about \(5 \%\) of the value of the contract. If wheat is selling for \(\$ 10\) a bushel and a standard contract is for 5,000 bushels, the contract value is \(\$ 50,000\). The processor need only deposit \(\$ 2,500\) with the broker. The processor is essentially buying with leverage of 20:1.
In the 1970s, the futures trader paid a round-turn commission of \(\$ 50\) per contract. This is about 0.3 of one percent, less than the stock market cost of \(1 \%\) per trade at the time. Now, years after negotiated commissions have become part of the system, the fee is no more than \(\$ 8\), or 0.05 of one percent for either stocks or futures, often less. Commission costs are so low that they are not a consideration when trading futures. The same low costs are also available to equity traders. Low costs allow fast trading, even day trading. It has changed the way we approach the markets.
\section*{A Line in the Sand between Fundamental and Technical Analysis}
The market is driven by fundamentals. These are often employment, GDP, inflation, consumer confidence, supply and demand, and geopolitical factors, all of which create expectations of price movement. But it is too difficult to trade using those facts, and economists have never been very accurate. Economic reports are not usually timely, and individual companies are not forthcoming about problems. We have had too many cases where the data we use to make fundamental decisions about individual companies have been unreliable, or a major computer breach isn't reported for months. We can add that to the conflict of interest inherent in the government's calculation of the Consumer Price Index, because an increase in the CPI requires that all those receiving Social Security checks get a cost-of-living increase.
Technical analysis, when used to determine the longterm direction of prices, attempts to objectively evaluate these complex fundamentals. It is no different from the economists who use regression, seasonality, and cyclic analysis to forecast the economy. The technical trader can use those tools as well as chart trendlines, recognize patterns, and calculate probability distributions. Perhaps the economists are doing the same thing.
It is well known that the Federal Reserve monitors trading and prices to decide how to time their interest rate changes and, when necessary, their currency intervention. All monetary authorities know that, when
their currency is rising too fast, you don't try to stop it. If the public wants to buy the Japanese yen, the Central Bank doesn't have enough clout to halt it unless it first waits for the move to be exhausted. It must use its resources carefully, and it uses market know-how and price analysis to time its actions.
The primary advantages of a technical approach are that it is objective and completely well-defined. The accuracy of the data is certain. One of the first great advocates of price analysis, Charles Dow, said:
The market reflects all the jobber knows about the condition of the textile trade; all the banker knows about the money market; all that the best-informed president knows of his own business, together with his knowledge of all other businesses; it sees the general condition of transportation in a way that the president of no single railroad can ever see; it is better informed on crops than the farmer or even the Department of Agriculture. In fact, the market reduces to a bloodless verdict all knowledge bearing on finance, both domestic and foreign.
Much of the price movement reflected in any market is anticipatory; it results from the expectations of the effects of macroeconomic developments or the outcome of good corporate management and new products. Markets, however, are subject to change without notice. For example, the government may block the merger of two companies, or approve or reject a new drug. A hurricane bound for the Philippines will send sugar prices higher, but if the storm turns off course, prices
reverse. Anticipation of employment reports, housing starts, or corn production reports causes highly publicized expert estimates, which may correctly or incorrectly move prices before the actual report is released. Markets then react to the accuracy of the estimates rather than to the economic data itself. By the time the public is ready to act, the news is already reflected in the price.
\section*{PROFESSIONAL AND AMATEUR}
Beginning technical traders may find a system or technique that seems extremely simple and convenient to follow, one that appears to have been overlooked by the professionals. Most often there is a simple reason why that method is not used. As you learn more about trading, you find that execution is difficult, or the risk is much higher than originally expected, or that the system has too many losses in a row. Trading is a business, not one to be taken casually. As Richard Wyckoff said, "Most men make money in their own business and lose it in some other fellow's." Plan to invest your time before your money, so that when you begin trading, you have more realistic expectations.
That does not mean that simple systems don't work, but that each has a return and risk profile that is typical of that style and difficult to change. One purpose of this book is to present many different trading methods, each with its own risk and reward profile, so that each trader understands the true cost of trading.
To compete with a professional speculator, you must be
accurate in anticipating the next move. This can be done by
Recognizing recurring patterns in price movement and determining the most likely results of such patterns.
Identifying the "trend" of the market by isolating the underlying direction of prices over a selected time interval.
Exploiting an unusual divergence in price between two related companies or commodities, called arbitrage.
\section*{The Tools}
The bar chart, discussed in Chapter 3, is the simplest representation of the market. These patterns are the same as those recognized by Jesse Livermore, in the early 1900s, on the tickertape. Because they are interpretive, more precise methods such as point-andfigure charting came into being, which add a level of exactness to charting.
Mathematical modeling, using traditional regression or statistical analysis, remains a popular technique for anticipating price direction. Most modeling methods are variations on econometrics, basic probability, and statistical theory. They are precise because they are based entirely on numerical data; however, they need trading rules to make them operational.
The proper assessment of the price trend is critical to most trading systems. Countertrend trading, which takes
a position opposite to the trend direction, is just as dependent on knowing the trend. Large sections of this book are devoted to the various ways to identify the trend, although it would be an injustice to leave the reader with the idea that a "price trend" is a universally accepted concept. There have been many studies claiming that price trends do not exist. The most authoritative papers on this topic are collected in Cootner, The Random Character of Stock Market Prices (MIT Press, 1964); very readable discussions can be found in the Financial Analysts Journal, an excellent resource.
Personal money management has an enormous number of tools, many of which can be found in Excel and other spreadsheet software. These include linear regression and correlation analysis. An Excel add-in, Solver, can easily be adapted to portfolio allocation. There is also inexpensive software to perform spectral analysis and apply advanced statistical techniques. Trading systems development platforms such as TradeStation and MetaStock provide programming languages and data management that greatly reduce the effort needed to implement your ideas. Professionals maintain the advantage of having all of their time to concentrate on the investment problems; however, nonprofessionals are no longer at a disadvantage.
\section*{RANDOM WALK}
It has been the position of many advocates of fundamental and economic analysis that there is no
relationship between price movements from one day to the next. That is, prices have no memory of what came before - this has been named the random walk theory. Prices will seek a level that will balance the supplydemand factors, but that level will be reached either instantaneously, or in an unpredictable manner as prices move in response to the latest available information or news release.
If the random walk theory is correct, the many welldefined trading methods based on mathematics and pattern recognition will fail. There are two arguments against random price movement.
The first argument is simply the success of many algorithmic trading strategies. There is definitive documentation of performance for systematized arbitrage programs, hedge funds, and derivatives funds, showing success for upward of 40 years. This is not to say that all technical programs are successful - far from it. But neither are fundamental methods. You still need a sound strategy, whether discretionary or systematic, in order to be profitable. Not everyone can create and implement such a strategy.
The second argument against the random walk is that prices move on anticipation. One can argue academically that all participants (the "market") know exactly where prices should move following the release of news.
However practical or unlikely this is, it is not as important as market movement based on anticipation of further news. For example, if the Fed lowered rates twice this year and the economy has not yet responded, would
you expect it to lower rates again? Of course you would. Therefore, as soon as the Fed announces a rate cut you would speculate on the next rate cut. When most traders hold the same expectations, prices move quickly to that level. Prices then react to further news relative to expectations, but only to the degree that investors have confidence in their future forecast. Is this price movement that conforms to the random walk theory? No. But the actual pattern of price movement can appear similar to random movement.
Excluding anticipation, the apparent random movement of prices is dependent on both the time interval and the frequency of data observed. Over a longer time span, using lower frequency data (for example, weekly), the trending characteristics become more obvious, along with seasonal and cyclic variations. In general, the use of daily data shows more noise (random movement) than weekly or monthly data.
In the long run, prices seek a level of equilibrium. Investors will switch from stocks to bonds to futures if one offers better return for the same risk. Investors are, in essence, arbitraging the investment vehicles. To attract money, an investment must offer more.
Prices do not have a normal distribution, another fact that argues against random walk. The asymmetry of the index markets, in particular those built on traditional stocks, is easy to understand because the public consists overwhelmingly of buyers. When looking at price movement in terms of "runs" - hours or days when prices continue in the same direction for an unusually
long sequence - we find that price data, and the profits that result from trending systems, have a fat tail, representing much longer runs than can be explained by a normal distribution. The existence of a fat tail also means that some other part of the distribution must differ from the norm because the extra data in the tail must come from somewhere else. When we discuss trending systems, the fat tail plays a critical role in profitability.
Price movement is driven by people, and people can buy and sell for nonrandom reasons, even when viewed in large numbers. People move prices and create opportunities that allow traders to profit. The long-term trends that reflect economic policy, normally identified by quarterly data, can be of great interest to longer-term position traders. It is the shorter-term price moves caused by anticipation (rather than actual events), frequent news releases, unexpected volatility, prices that are far from value, countertrend systems looking for price reversals, and shifts in supply and demand that are the primary focus of this book.
\section*{DECIDING ON A TRADING STYLE}
It may seem backward to talk about a trading style in advance of reading all the material, but many traders have already decided that they want to day trade or hold long-term positions because it suits their disposition, their belief of what moves prices, or their time schedule. That's important because you must be comfortable with the way you trade. With that in mind, short-term and
long-term traders will focus on different strategies and markets while portfolio structure and risk control will be much the same for either approach.
To understand how markets and different trading styles work together, consider a daily chart of any market, an individual stock, a short-term interest rate futures contract, or the sector SPDR SPY. There are periods of trending and sideways patterns. However, if you change that chart from intraday to daily, and from daily to weekly, the longer-term trend emerges. Lower frequency data makes the trend clearer. Figure 1.1 shows crude oil weekly, daily, and 20-minute charts, centered around July 2008. The weekly chart shows the smoothest pattern, the daily adds a few extra reversals, and the 20minute chart has some abrupt changes on the open of the day.
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0097.jpg?height=1937&width=1328&top_left_y=66&top_left_x=66)
FIGURE 1.1 Crude oil prices weekly chart with July 2008 in the center (top); daily chart with July 2008 in the center (center); 20-min chart with July 2008 in the center (bottom).
Selecting a price frequency that complements your trading strategy is important. If you are a long-term, macrotrend follower, then you want the price series that shows more trends, which is improved by weekly or daily charts. Short-term traders focus on mean reversion or fast directional price moves, and those strategies are enhanced using higher-frequency data, such as hourly or 15 -minute bars.
\section*{MEASURING NOISE}
Noise is the erratic movement that makes up the pattern of any price series. High noise can be compared to a drunken sailor's walk while low noise is a straight line from the starting to the ending point. Understanding the effects of noise can give you a trading edge. A market that has high noise is good for mean-reverting and arbitrage strategies. One with low noise favors trendfollowing. By selecting markets correctly, you increase your chances of success.
Noise can be measured as price density, efficiency ratio (also called fractal efficiency), and fractal dimension. It is important that these measurements do not reflect volatility because noise should not be confused with volatility. In Figure 1.2 a short, hypothetical period of price movement gives an example of noise measured by
the efficiency ratio (ER). ER is calculated by dividing the net move (the change from point A to point B) by the sum of the individual moves during that period, each taken as positive numbers.
\section*{Absolute Value (Net change in price)}
Efficiency ratio \(=\) Sum of individual price changes (as positive numbers)
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0099.jpg?height=728&width=1331&top_left_y=599&top_left_x=59)
FIGURE 1.2 Basic measurement of noise using the efficiency ratio (also called fractal efficiency).
\section*{Levels of noise}
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0100.jpg?height=602&width=1329&top_left_y=141&top_left_x=64)
FIGURE 1.3 Three different price patterns all begin and end at the same point. The straight line shows no noise, the smaller variations are medium noise, and the larger swings are high noise.
or
\[
E R_{t}=\frac{\left|P_{t}-P_{t-n}\right|}{\sum_{i=t-n}^{i=t}\left|P_{i}-P_{i-1}\right|}
\]
where \(n\) is the calculation period.
Figure 1.3 illustrates the relative level of noise that might occur with a price move of the same net change. The straight line indicates no noise, the smaller changes that move above and below the straight line would be medium noise, and the large swings are high noise.
However, in this example it is not possible to distinguish the level of noise from volatility, yet they are not the same. In Figure 1.4, the net change in price is from 440
to 475 in one case and from 440 to 750 in the other, yet the sum of the individual component changes is similar, 595 and 554. The efficiency ratio is 0.06 for the first and 0.56 for the second, showing that the first is very noisy while the second has relatively low noise (see Table 1.1). Noise is always relative to the net price change. If prices are moving up quickly, then even large swings may not be considered "noisy."
\section*{Same volatilty, more gain = less noise}
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0101.jpg?height=653&width=1331&top_left_y=655&top_left_x=61)
FIGURE 1.4 By changing the net price move we can distinguish between noise and volatility. If the sum of the individual price changes are the same, but the net move is larger, then the noise is less.
TABLE 1.1 These price changes, reflecting the patterns in Figure 1.4, show that larger individual price changes do not correspond to higher noise if the net change over the entire period is much larger.
\begin{tabular}{|l|c|c|c|c|}
\hline Day & \begin{tabular}{c}
High \\
noise
\end{tabular} & \begin{tabular}{c}
Low \\
noise
\end{tabular} & \begin{tabular}{c}
Diff \\
high
\end{tabular} & \begin{tabular}{c}
Diff \\
low
\end{tabular} \\
\hline \(\mathbf{1}\) & 440 & 440 & & \\
\hline 2 & 510 & 549 & .70 & 109 \\
\hline 3 & 390 & 627 & 120 & .78 \\
\hline 4 & 470 & 587 & .80 & .40 \\
\hline 5 & 410 & 566 & .60 & .21 \\
\hline 6 & 530 & 725 & 120 & 159 \\
\hline 7 & 430 & 664 & 100 & .61 \\
\hline 8 & 475 & 750 & .45 & .86 \\
\hline \begin{tabular}{l}
Net \\
change
\end{tabular} & 35 & 310 & 595 & 554 \\
\hline Noise & & & 0.06 & 0.56 \\
\hline
\end{tabular}
\section*{Other Measurements of Noise}
The previous example of noise used the efficiency ratio; however, price density and fractal dimension may also be used. Intuitively, price density can be seen as the extent to which prices fill a box. If we take a 10-day period of price movement charted with highs and lows, and draw a box touching the highest high and lowest low, then the density is how much of that box is filled. It is measured as:
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0102.jpg?height=233&width=1327&top_left_y=1765&top_left_x=63)
Fractal dimension cannot be measured exactly but can be estimated over \(n\) days using the following steps:
1. Max \(=\) highest high over \(n\) days
2. Min = lowest low over \(n\) days
3. Range \(=\max -\min\)
4. \(d x^{2}=\left(\frac{1}{n}\right)^{2}\)
5. \(L=\sum_{i-t-n+1}^{i=t} \sqrt{d x^{2}+\frac{p_{i}-p_{i-1}}{\text { Range }}}\)
6. \(F D=1+\frac{\ln (L)+\ln (2)}{\ln (2 \times n)}\)
There is a strong relationship between fractal dimension and the efficiency ratio (fractal efficiency), and there is a similarity in the construction of price density and fractal dimension. Of the three methods of measuring noise, the efficiency ratio seems to be the clearest and that will be used in the following analyses.
\section*{Impact on Trading}
Without preempting the discussion in Chapter 20 ("Trends and Price Noise"), a trend system will be more profitable when the price series has less noise, and a mean reversion strategy will be better when there is more noise. That is not to say the noise is the only factor that determines the outcome; however, selecting the best markets to trade gives you a better chance of success.
Noise applies equally to all time frames because it measures erratic price movement. In that regard, it satisfies the concept of fractals, which are repeated in the same way at all levels of detail.
On a macro level, noise can help choose which markets to trade. On a micro level, it can tell you whether to enter a market quickly or wait for a better price.
\section*{MATURING MARKETS AND GLOBALIZATION}
The level of noise in each market can tell us about the maturity of that market and the nature of traders actively using it. The U.S. equity markets are where companies go to finance their business. Typical U.S. workers participate in the equity markets indirectly through their retirement program, and many are actively involved in making the decisions where to allocate those funds. The most conservative choose government debt obligations, such as 5-year Treasury notes or municipal bonds; more aggressive investors may allocate a portion to professionally managed funds. Some may actively trade their investment using ETFs, individual stocks, or futures.
Workers in other countries are not as involved in their equity markets, even though movement of the equity index in these countries reflects the health of their economy. With less involvement, there is less liquidity and with that, less price noise. However, most world markets are becoming more active, even if that liquidity
comes from globalization, where traders from one country buy and sell shares in another country.
We can look at the way price noise has changed over the 20 years from 1990 to 2010 to see the maturity of the world markets, shown in Figure 1.5. As a benchmark, North America shows noise increasing each of the five years, and the highest noise of all regions. Europe and Australia follow close behind. Eastern Europe shows a rapid change from low to high noise, indicating a surge in trading activity. Latin America has the lowest level of noise (the highest value) but is represented only by Mexico. In general, the level of noise has increased as globalization has increased.
For traders, emerging markets have lower liquidity and less noise. Trend systems work well until noise increases. It is only the lack of liquidity, and often difficulty in accessing these markets, that prevent traders from capturing large profits.
Asia continues to be the most important area of world development. China, which holds most of the U.S. debt, has given a great deal of economic freedom to its people, but limited access to the equity markets for outside investors. Figure 1.6, which is ranked from higher to lower noise values (less maturity to more maturity) from left to right shows the relative development of the Asian equity markets. It is not surprising that Japan is the most developed, followed by Hong Kong, Singapore, South Korea, and Taiwan. These represent the most open economies in Asia. At the other end are Sri Lanka, Vietnam, Pakistan, and Malaysia, countries without
access to global investors. India's Sensex shows greater participation than the China Shanghai Composite, but both are toward the center of the ranking. As more traders have access to these markets, as they should in the future, they will move toward the right in the ranking.
\section*{Market Usage by Region}
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0106.jpg?height=726&width=1337&top_left_y=529&top_left_x=64)
FIGURE 1.5 Relative change in maturity of world markets by region
Ranking of Asian Markets 2005-2010
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0107.jpg?height=834&width=1327&top_left_y=130&top_left_x=63)
FIGURE 1.6 Ranking of Asian Equity Index Markets, 2005-2010.
\section*{BACKGROUND MATERIAL}
The contents of this book assume an understanding of the stock market and futures markets, such as the S\&P 500 and Treasury notes. Futures markets have a great impact on stock patterns and trade 24 hours a day. The rules and mechanics of those markets are not explained here unless they directly relate to a trading strategy. Ideally the reader should have read one or more of the available trading guides and should understand the workings of a buy or sell order and the contract specifications of futures. Experience in actual trading would be helpful. It's an advantage if you enjoy playing
competitive games and that you like to win.
There are excellent books available to both the beginning and advanced trader. Jack Schwager's Complete Guide to Futures Markets (2017) is a new edition of a classic, as well as the popular Market Wizards (updated 2012). For equities, the newest version of Edwards, Magee, and Bassetti, Technical Analysis of Stock Trends, remains a favorite. There are too many to name them all, so I'll tell you the technical books that are in easy reach of my desk, in alphabetic order by author's last name (details can be found in the Bibliography): Carol Alexander, Market Models; Peter Bernstein, The Portable MBA; Thomas Bulkowski, Encyclopedia of Chart Patterns and The Encyclopedia of Candlestick Patterns; John Ehlers, Cycle Analytics for Traders; Mark Fisher, The Logical Trader; John Hull, Fundamentals of Futures and Options; Andrew Lo, Adaptive Markets; Edgar Peters, Chaos and Order in the Capital Markets; and Cliff Ragsdale, Statistical Modeling. Of course, there are my own books, which I refer to often (see Bibliography).
Your list of worthwhile books should also include John Bollinger, Bollinger on Bollinger Bands, and Martin Pring, Technical Analysis Explained, as well as Robert Colby, The Encyclopedia of Technical Market Indicators (Dow Jones Irwin, 2002), Alex Elder, The New Trading for a Living (Wiley, 2014), and Nassim Taleb, Fooled by Randomness.
For a constant flow of both classic and new techniques, the magazines Technical Analysis of Stocks \&
Commodities and Modern Trader have numerous
articles on trading systems and methods. A basic understanding of market phenomena and relationships, often requiring some math skill, can be found in the Financial Analysts Journal (CFA Institute).
Books that should be read by every trader, and are also next to my desk, are Edwin Lefevre, Reminiscences of a Stock; Sun Tzu, The Art of War; Charles MacKay, Extraordinary Popular Delusions and the Madness of Crowds; and my favorite, The Logic of Failure by Dietrich Dörner. There are also books by Neil deGrasse Tyson because my interest in the universe goes back to my original career path.
\section*{Blogs, User Groups, and Associations}
Times have changed, and the Internet contains a great deal of material on trading systems not published elsewhere. It requires some sifting to locate information that you find relevant, but there are useful ideas out there. Just don't expect to find the golden chalice. You'll need to take the ideas, develop them, and test them yourself. Not all will be as good as they first appear. But ideas are valuable. Scan for "Trading Systems blogs."
There are a number of associations and user groups that can be very helpful to traders at all levels. The CMT Association (renamed from the Market Technician's Association) offers a Certified Market Technician credential, and the CFA Institute (previously the Association for Investment Management Research, AIMR) offers the Charter Financial Analyst credential. For those with higher math skills, the International
Association of Financial Engineers (IAFE) offers excellent resources. There are also user groups, sometimes called forums, for all of the popular development platforms, such as TradeStation, MetaStock, and Ninja Trader. These groups usually meet in larger cities, but can be reached on social media and are a valuable resource for solving a difficult problem.
As for this book, a reader with a good background in high school mathematics can follow everything but the more complex parts. A basic course in statistics is ideal, but knowledge of the type of probability found in Edward Thorp's Beat the Dealer (Vintage, 1966) is adequate. Fortunately, computer spreadsheet programs, such as Excel, allow anyone to use statistical techniques immediately, and most of the formulas in this book are presented in such a way that they can easily be adapted to spreadsheets, if they are not already presented that way. Even better, if you have a computer with trading software, you are well equipped to continue. If you have a live data feed, such as Bloomberg, Reuters, or Thinkorswim, you will also have access to technical studies that you will find very helpful. Bloomberg and Reuter's are also excellent sources of global data.
\section*{SYSTEM DEVELOPMENT GUIDELINES}
Before starting, there are a few guidelines that can help make the task of developing a trading system easier.
1. Know what you want to do before you start. Base your trading on a sound premise. It could be an observation of how prices move in response to
government policy, a theory about how prices react to economic reports, or simply a pattern that shows up at the same time each day or each month. This is the underlying premise of your method. It cannot be discovered by computer testing. It comes from the experience of observing price movement, reminiscent of Jesse Livermore, and understanding the factors that drive prices. If that's not possible, then select ideas from credible books or articles.
2. State your idea or premise in its simplest form. The more complex, the more difficult it will be to evaluate the answer and to understand the interaction of the parts. Simple methods tend to have more longevity. Remember Occam's razor.
3. Do not assume anything. Many projects fail on basic assumptions that were incorrect. It takes practice to avoid making assumptions and to be critical of certain elements that you believe to be true. Verify everything.
4. Try the simplest and most important parts
first. Some of the rules in your trading program will be more important than others. Try those first. It's best to understand how each rule or technique contributes to the final system. Then build slowly and carefully to prove the value of each element of the system. The ability to readily understand the operation of each part of your system is called a transparent solution, rather than a fully integrated or complex one. Transparent solutions are very desirable.
5. Watch for errors of omission. It may seem odd to look for items that are not there, but you must continually review your work, asking yourself if you have included all the necessary costs and accounted for all the risk. Simply because all the questions were answered correctly does not mean that all the right questions were asked.
6. Question the good results. There is a tendency to look for errors when results are bad, but to accept the results that are good. Exceptionally good results are just as likely to be caused by errors in rules, formulas, or data. They need to be checked as carefully as bad results. "Surprisingly good" results are often wrong.
7. Do not take shortcuts. It is sometimes convenient to use the work of others to speed up the research. Check their work carefully; do not use it if it cannot be verified. Check your spreadsheet formulas manually. One error can ruin all your hard work.
8. Start at the end. Define your goal and work backward to find only the necessary input. In this way, you only work with information relevant to the results; otherwise, you may expend a lot of unnecessary effort.
9. Be tenacious. Not all ideas work the first time, or the second. If you believe that your idea is good, keep working at it. There might be a "bug" in your code, or you might have omitted a rule that will make it successful.
\section*{OBJECTIVES OF THIS BOOK}
This book is intended to give you a complete understanding of the tools and techniques needed to develop or choose a trading program that has a good chance of being successful. Execution skill and market psychology are not considered - only the strategies, the methods for testing those strategies, and the means for controlling the risk. This is a goal of significant magnitude.
Not everything can be covered in a single book; therefore, some guidelines were needed to control the material included here. Every technique in this book qualifies as systematic; that is, each has clear rules. Most of them can be automated. We begin with basic concepts, including definitions, how much data to use, how to create an index, some statistics and probability, and other tools that are used throughout the book. The next several chapters cover the techniques that are most important to trading, such as the trend and momentum. All chapters are organized by common grouping so that you can compare variations of the same basic method. Although charting is an extremely popular technique, it is included only to the degree that it can be compared with other systematic methods, or when various patterns can be used in a computerized program (such as identifying a key reversal day). There has been no attempt to provide a comprehensive text on charting; however, various formations may offer very realistic profit objectives or provide reliable entry filters.
Neither stock options nor options on futures are
included in this book. The subject is too large and too specialized. There are already many good books on options strategies. The exception is that there are strategies using VIX, and comparisons of implied volatility versus historic volatility.
This book does not attempt to prove that one system is better than another, because it is not possible to know what will happen in the future or how each reader will cleverly apply these techniques. Instead the book evaluates the conditions under which certain methods are likely to do better and situations that will be harmful to specific approaches. By grouping similar systems and techniques together, and by presenting many of the results in a uniform way, you should be able to compare the differences and draw your own conclusions. Seeing how analysts have modified existing ideas can help you decide how to personalize a strategy and give you an understanding of why you might choose one path over another. With a more complete picture, common sense should prevail over computing power.
\section*{PROFILE OF A TRADING SYSTEM}
There are quite a few steps to be considered when developing a trading program. Some of these are simply choices in style while others are essential to the success of the results. They have been listed here and are discussed briefly as items to bear in mind as you continue the process of creating or choosing a trading system.
\section*{Changing Markets and System Longevity}
Markets are not static. They evolve as does everything else. The biggest changes continue to be in technology, participation, globalization, new markets, and the cost of doing business.
Technology includes communications, trading equipment (primarily computers and handheld devices), electronic exchanges, data access, and order entry. These innovations have accelerated the trading process.
Electronic markets have changed the nature of the order flow and made information about buyers and sellers more accessible. They have changed the speed at which prices react to news, and they have facilitated highfrequency trading and smart executions.
Globalization is mostly the result of the advances in communications. Not only can we see the same news at the same time everywhere in the world, but we can pass on information just as quickly. Equally important, we do not think about the reliability of our equipment. We expect our computers, telephones, and Internet connections to work without question. When we trade, we are willing to bet on it.
The dramatic reduction in commission cost has been a major influence on trading, opening opportunities for the fast trader. For institutions, stock transactions can be done at a fraction of a cent per share, and the individual investor will pay no more than \(\$ 8\) per order and as little as \(\$ 1\). This not only facilitates fast trading but encourages greater participation. Everyone wins.
The challenge for the trader is to find a system that will adapt to as-yet-unknown changes in the future. Most changes are not sudden, but are gradually reflected in price patterns (alternating with an occasional price shock). Biogenetic research has increased crop production while global warming may do the opposite. The rising middle class in China and India will change the demand for energy and retail goods. The increase in trading choices - ETFs, mutual funds, stocks, futures, options - causes a complex interdependence of markets. Index arbitrage and the trading of sector ETFs force the component stocks to move in the same direction regardless of their individual fundamentals. It is both challenging and rewarding to create a program with longevity.
\section*{The Choice of Data}
System decisions are limited by the data used in the analysis. Although price and volume for the specific stock or futures market may be the definitive criteria, there is a multitude of other valid statistical information that might also be used. Some of this data is easily included, such as price data from companies in the same sector or industrial group, or the current yield curve relationship. Other statistical data, including the wide range of U.S. economic data and weekly energy inventories, may add a level of robustness to the results but are less convenient to obtain and less timely.
\section*{Diversification}
Not all traders are interested in diversification, which
tends to reduce returns at the same time that it limits risk. Concentrating all your resources on a single market that you understand may produce a specialized approach and much better results than using a more generalized technique over more markets. Diversification may be gained by trading two or more unique strategies applied to the same market, instead of one strategy used on a broad set of markets. On the other hand, overdiversification can introduce marginal returns with greater risk. It will be important to find the right balance.
\section*{Trade Selection}
Although a trading system produces signals regularly, it is not necessary to enter all of them. Selecting one over another can be done by a method of filtering. This can be a confirmation of another technique or system, a limitation on the amount of risk that can be accepted on any one trade, the use of outside information, or the current volume. Many of these additional rules add a touch of reality to an automated process. You may find, however, that too many filters result in overfitting or no trading.
\section*{Testing}
A mistake in testing may cause you to trade a losing strategy or discard a profitable one. Back-testing is the only option available to confirm or validate your ideas. Testing is misguided when it is used to "discover" a trading method by massive scanning of techniques. A robust solution, one that works on many stocks or across
similar markets, will never appear as good as an optimized result of a single stock. But using the same system for all stocks in the same sector exposes it to more patterns and will give you a more realistic assessment of expectations, both risk and reward, and a much better chance of success.
\section*{Risk Control}
Trading survival requires risk control. Risk must be addressed at all levels. It begins with the individual trade, but must also balance the risks of all markets in a common sector, the risk of those sectors in a portfolio, and finally the risk of multiple systems traded together. Trade risk can be controlled using a stop-loss but can effectively be managed by volatility. Futures traders must also pay attention to leverage. Risk management does not need to be complex, but it cannot be overlooked.
\section*{Transaction Costs}
A system that performs well on paper may be dismal when actually traded. Part of a trading program is knowing how to enter and exit the market, as well as having realistic expectations about the transaction costs, both commissions and slippage. Short-term, fast trading systems are most sensitive to transaction costs because the expected profit on each trade is small. Directional trading strategies, those that buy as prices are rising and sell when they are falling, have larger slippage than mean reversion techniques.
There is equal damage in overstating costs as there is in underestimating them. By burdening a system with unrealistic fees, tests may show a loss instead of a profit, causing you to reject a successful trading method.
\section*{Performance Monitoring and Feedback}
A system is not done when you begin trading; it is only entering a new phase. Trading results must be carefully monitored and compared with expectations to know if the system is performing properly. It is very likely that knowing the true execution slippage will cause you to make some changes to the system rules or to the size of the positions. Performance monitoring provides the essential feedback needed to be successful. It can be an early warning that tells you something is wrong, or it can give you added confidence that everything is going well.
\section*{A WORD ABOUT THE NOTATION USED IN THIS BOOK}
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0119.jpg?height=127&width=148&top_left_y=1303&top_left_x=63)
To make the contents of this book more useful for trading, some of the traditional mathematical formulas are also shown as Microsoft's Excel notation, as well as TradeStation's EasyLanguage. EasyLanguage can be understood by anyone who has experience with a programming language, and is easily converted to other development platform code. You will find hundreds of examples on the Companion Website, with references to them noted in the margins throughout the book.
Some of the examples are more complex systems and indicators, written in either, or both, Excel and EasyLanguage. Although these programs have been carefully tested, there may have been occasional errors introduced during final editing. Recent market activity may also produce combinations of price movements that did not occur during the test period. Readers are advised to check over the code and test it thoroughly before using it.
Be aware that the statistical functions may have slightly different names in different platforms. For the standard deviation, Excel uses stdev while EasyLanguage uses stddev. One program expects the mean to be avg while another requires average. Excel uses log when it's really \(\ln\) (natural log). Please check the notation in each formula and solution so that it reflects your needs.
\section*{A FINAL COMMENT}
Throughout this book the principle of unnecessary plurality, better known as Occam's razor, will be stressed. The principle states that, given more than one explanation or solution, the simplest one is the preferred. (Smart people have been around for a long time.) When developing or choosing a trading strategy, it is normally the case that adding complexity for the sake of a few extra basis points increases the potential problems and risk more than it increases returns.
Pluralitas non est ponenda sine necessitate.
William of Ockham (c. 1285-1349)
The goal here is to provide the tools and the understanding to help both aspiring and experienced traders develop systematic ways to trade that satisfy their inherent risk preference and their investment objectives. It is unlikely that any two traders will develop the same system, but the greater their knowledge, the more likely it will be profitable.
\section*{CHAPTER 2}
\section*{Basic Concepts and Calculations}
Economics is not an exact science: it consists merely of Laws of Probability. The most prudent investor, therefore, is one who pursues only a general course of action which is "normally" right and who avoids acts and policies which are "normally"wrong.
—LLB Angas
Technology puts data from everywhere in the world at our fingertips, programs that perform sophisticated calculations instantly, and access to anyone at any time.
As Isaac Asimov foretold, there will come a time when we will no longer know how to do the calculation for long division because miniature, voice-activated computers will be everywhere. We might not even need to be able to add; it will all be done for us. We will just assume that the answer is correct, because computers don't make mistakes.
In a way this is happening now. Not everyone checks their spreadsheet calculations by hand to be certain they are correct before going further. Nor does everyone print the intermediate results of computer calculations to verify their accuracy. Computers don't make mistakes, but people do.
With computer software and trading platforms making
price analysis easier and more sophisticated, we no longer think of the steps involved in a moving average or linear regression. A few years ago, we looked at the correlation between investments only when absolutely necessary because they were too complicated and timeconsuming to calculate. Now we face a different problem. If the computer does it all, we lose our understanding of why a moving average trendline differs from a linear regression. Without looking at the data, we don't see an erroneous outlier, a stock that wasn't adjusted for splits, or that the early price of Apple (AAPL) went negative due to the way splits were applied. By not reviewing each hypothetical trade, we miss seeing that the slippage can turn a profit into a loss.
To avoid losing the edge needed to create a profitable trading strategy, the basic tools of the trade are explained in this chapter. Those of you already familiar with these methods may skip over it; others need to be confident that they can perform these calculations manually even while they use a spreadsheet.
\section*{Helpful Software}
In Excel, many of the functions, such as the standard deviation, are readily accessible. The more advanced statistical functions require that you install the add-ins, which also come free with Excel. These include histograms, regression analysis, \(F\)-test, \(t\)-test, \(z\)-test, Fourier analysis, and various smoothing techniques. To install these add-ins in most versions of Excel, go to file/options/add-ins and select all of the add-ins. Be sure you get Solver. Once installed, which takes only a few
seconds, these functions can be accessed in the Data menu at the top of the screen.
There are other very useful and user-friendly statistical programs, available at a wide range of sophistication and price. One of the best values is Pro-Stat by Poly Software (polysoftware.com). At the high end will be SAS, SPSS, and Statistica. The examples in this chapter will use both Excel and Pro-Stat.
\section*{A BRIEF WORD ABOUT DATA}
Selection and use of data will be discussed in Chapter 21, System Testing; however, there are a few important points to remember as you progress through this book.
More is better. Your system will be more robust if it works on more data. That data needs to include bull and bear markets, and the occasional large price shock.
No data is too old to use. Your rules must adapt to changing times. The data 20 years ago may seem irrelevant now, and today's data will also seem irrelevant in 20 years, but it is not.
Economic data is not timely. Traders react to economic data releases even though some of them reflect averages of the past month and corrections to previous releases. Data from other countries other than the United States and Europe are often very late and not always accurate. Be careful about putting too much dependence on economic data.
In-sample and out-of-sample data. Proper testing involves saving some data to verify your work after you have completed your development. It is the first time you will get a chance to test your idea on unseen data.
\section*{SIMPLE MEASURES OF ERROR}
When you use a small amount of data, the results are not reliable. Financial news is filled with polls that show accuracy of \(\pm 5 \%\). We would like more accuracy. The two basic measures of error are sample error and standard error.
\section*{Sample Error}
With any calculation, it is necessary to have enough data to make the result accurate. The process for verifying if there is adequate data is called the testing of significance. Accuracy increases as the number of items becomes larger, and the sample error becomes proportionately smaller:
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0125.jpg?height=221&width=1329&top_left_y=1407&top_left_x=64)
Using only one item has a sample error of \(100 \%\); with four items, the error is \(50 \%\). The size of the error is important to the reliability of any trading system. If a system has had only 4 trades, whether profits or losses, it is very difficult to draw any reliable conclusions about
future performance. There must be sufficient trades to assure a comfortably small error factor. To reduce the error to \(5 \%\), there must be 400 trades. This presents a dilemma for a very slow trend-following method that may only generate 2 or 3 trades each year. To compensate for this, the identical method can be applied across many markets and the number of trades used collectively.
\section*{Standard Error}
The standard error(SE) uses the variance, which gives the estimation of error based on the distribution of the data using multiple data samples. It is a test that determines how the sample means differ from the actual mean of all the data. It addresses the uniformity of the data.
\[
S E=\sqrt{\frac{V a r}{n}}
\]
where
Var \(=\) the variance of the sample means
\(n=\) the number of data points in the sample means
Sample means refers to a large amount of data being sampled a number of times, each with \(n\) data points, and the means of these samples are used to find the variance. Most of us will use the mean of all the data rather than multiple samples. Any measure of confidence is better than none.
\section*{ON AVERAGE}
\section*{The Law of Averages}
We begin at the beginning, with the law of averages, a greatly misunderstood principle. In trading, the law of averages is most often quoted incorrectly when an abnormally long series of losses is expected to be offset by an equal and opposite run of profits. It is equally wrong to expect a market that is currently overvalued or overbought to next become undervalued or oversold. That is not what is meant by the law of averages. Over a large sample, the bulk of events will be scattered close to the average in such a way that the typical values overwhelm the abnormal events and cause them to be insignificant.
This principle is illustrated in Figure 2.1, where the number of average items is extremely large, and the addition of a small abnormal grouping to one side does not affect the balance. It is the same as being the only passenger on a jumbo jet. Your weight is insignificant to the operation of the airplane and is not noticed when you move about the cabin. A long run of profits, losses, or an unusually sustained price movement is simply a rare, abnormal event that will be offset over time by the overwhelmingly large number of normal events. Further discussion of this and how it affects trading can be found in "Gambling Technique: The Theory of Runs," in
Chapter 22.
\section*{How We Use Averages}
In working with numbers, it is often necessary to use representative values. The average of a range of values may be substituted to change individual prices into a general characteristic in order to solve a problem. For example, the average retail price of one pound of coffee in the Northeast is more meaningful to a cost-of-living calculation than the price at any one store. However, not all data can be combined or averaged and still have meaning. The average of all prices taken on the same day would not say anything about an individual market that was part of the average. Averaging the prices of unrelated items, such as a box of breakfast cereal, the hourly cost of automobile repair, and the price of the German DAX index would produce a number of questionable value. The average of a group of numbers must have some useful meaning.
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0128.jpg?height=746&width=1222&top_left_y=1048&top_left_x=168)
FIGURE 2.1 The Law of Averages. The normal cases overwhelm the unusual ones. It is not necessary for the
extreme cases to alternate - one higher, the next lower to create a balance.
The average can be misleading in other ways. Consider coffee, which rose from \(\$ 0.40\) to \(\$ 2.00\) per pound in 1 year. The average price of these two values is \(\$ 1.20\); however, this would not account for the time that coffee was sold at various price levels. Table 2.1 divides the coffee price into 4 equal intervals, then shows that the time spent at these levels was inversely proportional to the price rise. That is, prices remained at lower levels longer and at higher levels for shorter time periods, which is very normal price behavior.
When the time spent at each price level is included, it can be seen that the average price should be lower than \(\$ 1.20\). One way to calculate this, knowing the specific number of days in each interval, is by using a weighted average of the price:
\[
W=\frac{a_{1} d_{1}+a_{2} d_{2}+a_{3} d_{3}+a_{4} d_{4}}{d_{1}+d_{2}+d_{3}+d_{4}}
\]
and its corresponding intervals:
\[
\begin{aligned}
& W=\frac{6000+8000+8400+7200}{280} \\
& W=105.71
\end{aligned}
\]
This result can vary based on the number of time intervals used; however, it gives a better idea of the correct average price. There are two other averages for
which time is an important element - the geometric mean and the harmonic mean.
\section*{Geometric Mean}
The geometric mean is a growth function in which a price change from 50 to 100 is as important as a change from 100 to 200 . It should be used when working with percentages rather than raw prices. If there are \(n\) prices, a1, a2, a3, ..., an, then the geometric mean is the \(n\)th root of the product of \(n\) prices:
\section*{TABLE 2.1 Weighting an average.}
\begin{tabular}{|l|l|c|c|c|c|}
\hline Prices Go & \multicolumn{5}{|c|}{} \\
\hline From To & \begin{tabular}{c}
Average \\
During \\
Interval
\end{tabular} & \begin{tabular}{c}
Total \\
Days for \\
Interval
\end{tabular} & Weighted & 1/a \\
\hline 40 & 80 & \(\mathrm{a} 1=60\) & \(\mathrm{~d} 1=100\) & 6000 & 0.01666 \\
\hline 80 & 120 & \(\mathrm{a} 2=100\) & \(\mathrm{~d} 2=80\) & 8000 & 0.01000 \\
\hline 120 & 160 & \(\mathrm{a} 3=140\) & \(\mathrm{~d} 3=60\) & 8400 & 0.00714 \\
\hline 160 & 200 & \(\mathrm{a} 4=180\) & \(\mathrm{~d} 4=40\) & 7200 & 0.00555 \\
\hline
\end{tabular}
\[
G=\left(a_{1} \times a_{2} \times a_{3} \times \cdots \times a_{n}\right)^{1 / n}
\]
or in Excel:
\[
\operatorname{product}\left(a_{1}, a_{2}, a_{3}, \ldots, a_{n}\right)^{\wedge}(1 / n)
\]
To solve this without using the product function, the equation above can be changed to either of two forms:
\section*{\(\ln (G)=\underline{\ln \left(a_{1}\right)+\ln \left(a_{2}\right)+\cdots+\ln \left(a_{n}\right)}\) \\ \(n\)}
or
\[
\ln (G)=\frac{\ln \left(a_{1} \times a_{2} \times a_{3} \times \cdots \times a_{n}\right)}{}
\]
\(n\)
The two solutions are equivalent. The term \(\ln\) is the natural log, or log base \(e\). (Note that in Excel, the function \(\log\) actually is \(\ln\).) Using the price levels in Table 2.1,
\[
\ln (G)=\frac{\ln (40)+\ln (80)+\ln (120)+\ln (160)+\ln (200)}{5}
\]
Disregarding the time intervals, and substituting into the first equation:
\(\ln (G)=\frac{3.689+4.382+4.787+5.075+5.298}{5}\)
Then:
\[
\begin{aligned}
\ln (G) & =4.6462 \\
G & =104.19
\end{aligned}
\]
While the arithmetic mean, which is equal-weighted, gave the value of 105.71 , the geometric mean shows the average as 104.19.
The geometric mean has advantages in applications to economics and indices. A classic example compares a tenfold rise in price from 100 to 1000 to a fall to one tenth from 100 to 10 . An arithmetic mean of the two values 10 and 1000 is 505 , while the geometric mean gives:
\[
G=(10 \times 1000)^{1 / 2}=100
\]
and shows the relative distribution of prices as a function of comparable growth. Due to this property, the geometric mean is the best choice when averaging ratios that can be either fractions or percentages.
\section*{Quadratic Mean}
The quadratic mean is most often used for estimation of error. It is calculated as:
\[
Q=\sqrt{\frac{\sum a^{2}}{N}}
\]
The quadratic mean is the square root of the mean of the square of the items (root-mean-square). It is most well known as the basis for the standard deviation. This will be discussed later in this chapter in the section "Moments of the Distribution."
\section*{Harmonic Mean}
The harmonic mean is another time-weighted average, but not biased toward higher or lower values as in the
geometric mean. A simple example is to consider the average speed of a car that travels 4 miles at 20 mph , then 4 miles at 30 mph . An arithmetic mean would give 25 mph , without considering that 12 minutes were spent at 20 mph and 8 minutes at 30 mph . The weighted average would give:
\[
W=\frac{(12 \times 20)+(8 \times 30)}{12+8}=24
\]
The harmonic mean is:
\[
\frac{1}{H}=\frac{\frac{1}{a_{1}}+\frac{1}{a_{2}}+\cdots+\frac{1}{a_{n}}}{n}
\]
which can also be expressed as:
\[
H=n / \sum_{i=1}^{n}\left(\frac{1}{a_{i}}\right)
\]
For two or three values, the simpler form can be used:
\[
H_{2}=\frac{2 a b}{a+b}
\]
\[
H_{3}=\frac{3 a b c}{a b+a c+b c}
\]
This allows the solution pattern to be seen. For the 20 and 30 mph rates of speed, the solution is:
\[
H_{2}=\frac{2 \times 20 \times 30}{20+30}=24
\]
which is the same answer as the weighted average. Considering the original set of numbers again, the harmonic mean would be:
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0134.jpg?height=651&width=1065&top_left_y=482&top_left_x=194)
We might apply the harmonic mean to price swings, where the first swing moved 20 points over 12 days and the second swing moved 30 points over 8 days.
\section*{The Relationship Between the Means}
The measures of central tendency discussed in the previous section are used to describe the shape and extremes of price movement that will also be seen in the frequency distribution described in the next section. The general relationship between the three principal means when the distribution is not perfectly symmetric is:
\section*{Arithmetic mean \(>\) Geometric mean \(>\) Harmonic mean}
\section*{PRICE DISTRIBUTION}
The measurement of distribution tells you, in general terms, what to expect. We cannot know what S\&P price will be in one year, but if the current price is 2400 , then we have a high level of confidence that it will fall between 2100 and 2700, less confidence that it will fall between 2300 and 2500, and we have virtually no chance of picking the exact value. The following measurements of distribution allow you to put a probability, or confidence level, on the chance of an event occurring.
In the statistics that follow, we will use a limited number of prices and - in some cases - individual trading profits and losses as the sample data. We want to measure the characteristics of our sample, find the shape of the distribution, decide how results of a smaller sample compare to a larger one, and see if the two samples are similar to each other. All of these measures will show that the smaller samples are less reliable, yet they can still be used if you understand the size of the error or the difference in the shape of the distribution compared to the expected distribution of a larger sample.
\section*{Frequency Distributions}
The frequency distribution (also called a histogram) can give a good picture of the characteristics of the data. Theoretically, we expect commodity prices to spend more time at low price levels and only brief periods at high prices. That pattern is shown in Figure 2.2 for wheat from 1978 to 2017. The most frequent occurrences are at the price where the supply and demand are
balanced, called equilibrium. When there is a shortage of supply, or an unexpected demand, prices rise for a short time until either the demand is satisfied or supply increases to meet demand. Although brief, the rising prices can be extreme and can be seen as the "fat tail" of the distribution stretching to the right in Figure 2.3. There is usually a small tail to the left where prices occasionally trade for less than the cost of production, or at a discounted rate during periods of high supply.
To calculate a frequency distribution, we divide the price range into 20 bins.
- Take the highest high to the lowest low over the data period and divide by 19 to get the size of one bin.
\section*{Wheat cash prices (cents/bushel)}
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0136.jpg?height=693&width=1228&top_left_y=990&top_left_x=161)
FIGURE 2.2 Wheat prices, 1978-2017.
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0137.jpg?height=639&width=1208&top_left_y=100&top_left_x=183)
FIGURE 2.3 Wheat frequency distribution showing a tail to the right.
- Beginning with the lowest price, add the bin size to get the second value, add the bin size to the second value to get the third value, and so on.
When completed, you will have 20 bins that begin at the lowest price and end at the highest price.
Instead, we'll use Excel. Once you have installed the addins, go to Data/Data Analysis. Be sure you have Histogram. To set up the analysis:
1. Import the closing prices of your market.
2. Create a set of bins, based on the range of data. In our case, wheat prices ranged from about 200 to about 1300 (expressed in cents). We set up a column starting at zero and incremented by 50 up to 1300.
3. Now go to Data Analysis and choose Histogram.
4. The input range will be the closing prices.
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0138.jpg?height=542&width=1220&top_left_y=58&top_left_x=171)
Mean
FIGURE 2.4 Normal distribution showing the percentage area included within one standard deviation about the arithmetic mean.
5. Thebin range is the short column of values we created from o to 1300 .
6. Allow the output to be a New Worksheet.
7. Click on \(O K\).
The program will fill the bins and allow you to plot the results shown in Figure 2.3.
The frequency distribution shows that the most common price fell between \(\$ 4.00\) and \(\$ 4.50\) per bushel. The tail to the right extends to \(\$ 12 /\) bushel and illustrates the fat tail. If this was a normal distribution there would be no entries to the right of \(\$ 6\). The absence of price data below \(\$ 2.00\) is due to farmers refusing to sell at a loss. Wheat prices can also be viewed net of inflation or changes in the U.S. dollar. This will be seen at the end of this chapter.
You should expect that the distribution of prices for
other physical commodities, such as agricultural products, metals, and energy, would look similar to the wheat chart. They will be skewed toward the left (more occurrences at lower prices) and have a long tail at higher prices toward the right. Many commodities are seasonal, which allows them to "restart" each year. The financial markets are quite different because, over time, many of them keep going higher. Currencies prices may fluctuate by \(25 \%\) or more but could go anywhere if the United States or another economy has a structural change.
When observing shorter price periods, patterns that are elongated may be considered in transition, or trending. For more, see Chapter 18 , especially the sections "The Importance of the Shape of the Distribution" and "Steidlmayer's Market Profile."
\section*{Median and Mode}
The median and the mode are also used to describe the distribution. The median, or "middle item," is helpful for establishing the "center" of the data; when the data is sorted, it is the value in the middle. The median is often a better choice than the average because it discounts extreme values, which might distort the arithmetic mean. Its disadvantage is that you must sort all of the data in order to locate the middle point, and it should not be used for a small number of items.
The mode is the most commonly occurring value. In Figure 2.3, the mode is the highest bar in the frequency distribution, at bin 400 .
In a normally distributed price series, the mode, mean, and median all occur at the same value; however, as the data become skewed, these values will move farther apart. The general relationship is:
\section*{Mean \(>\) Median \(>\) Mode}
A normal distribution is commonly called a bell curve, and values fall equally on both sides of the mean. For much of the work done with price and performance data, the distributions tend to be skewed to the right
(positively skewed with the tail to the right), and appear to flatten or cut off on the left (lower prices or trading losses), as we saw in Figure 2.3. If you were to chart a distribution of trading profits and losses based on a trend system with a fixed stop-loss, you would get profits that could range from zero to very large values while the losses would be theoretically limited to the size of the stop-loss. In fact, it would look a lot like the wheat distribution. Skewed distributions will be important when we measure probabilities later in this chapter. There are no "normal" distributions in a trading environment. You may hear statisticians refer to normal distributions as Gaussian.
\section*{Summary of the Principal Averages}
Each averaging method has its unique meaning and usefulness. The following are their principal characteristics:
The arithmetic mean is affected by each data element equally, but it has a tendency to emphasize
extreme values more than other methods.
The geometric mean is most important when using data representing percentages, ratios, or rates of change. It cannot be used for negative numbers.
The harmonic mean is most applicable to time changes and, along with the geometric mean, has been used in economics for price analysis. It is more difficult to calculate; therefore, it is less popular than either of the other averages.
The mode is the most common value and is only determined by the frequency distribution. It is the location of greatest concentration and indicates a typical value for a reasonably large sample.
The median is the middle value and is most useful when the center of an incomplete set is needed. It is not affected by extreme variations and is simple to find; however, it requires sorting the data, which can cause the calculation to be slow.
\section*{MOMENTS OF THE DISTRIBUTION: MEAN, VARIANCE, SKEWNESS, AND KURTOSIS}
To be uncertain is to be uncomfortable, but to be certain is to be ridiculous.
-Chinese proverb
The moments of the distribution describe the shape of the data points, the way they cluster around the mean.
There are four moments: mean, variance, skewness, and kurtosis.
1. The mean is the center or average value, around which other points cluster.
2. Variance is the distance of the individual points from the mean.
3. Skewness is the way the distribution leans to the left or right relative to the mean.
4. Kurtosis is the peakedness of the clustering.
We have already discussed the mean, so we will start with the 2 nd moment. In the following calculations, we will use the bar notation, \(\bar{P}\), to indicate the average of a list of \(n\) prices. The capital \(P\) refers to all prices and the small \(p\) to individual prices. We'll use the following form so that the similarity between moments can be easily seen. The mean is calculated as:
\[
\bar{P}=\underline{\sum_{i=1}^{n} p_{i}}
\]
\(n\)
\section*{Variance (2nd Moment) and Standard Deviation}
Variance (Var) is very similar to mean deviation (MD), which does not square the differences, and is the best estimation of dispersion.
\[
\operatorname{Var}=\frac{\sum_{i=1}^{n}\left(p_{1}-\bar{p}\right)^{2}}{n-1}
\]
Notice that the variance is the square of the standard deviation, var \(=s^{2}=\sigma^{2}\), one of the most commonly used statistics. In Excel, the variance is the function var and in TradeStation it is variance(series, \(n\) ).
The standard deviation, most often shown as \(\sigma\) (sigma), is a special form of measuring average deviation from the mean, which uses the root-mean-square:
\[
\sigma=\sqrt{\frac{\sum_{i-1}^{n}\left(p_{i}-\bar{p}\right)^{2}}{n}}
\]
where the differences between the individual prices and the mean are squared to emphasize the significance of extreme values, and then the total value is reduced using the square root function. This popular measure, also used throughout this book, is the Excel function Stdevp and the TradeStation function, StdDev(price, \(n\) ), for \(n\) prices.
\section*{Gold cash prices}
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0144.jpg?height=683&width=1323&top_left_y=133&top_left_x=65)
\section*{FIGURE 2.5 Gold cash prices.}
The standard deviation is the most popular way of measuring the dispersion of data as well as volatility, or risk. In a perfectly normal set of data, the value of 1 standard deviation about the mean represents a clustering of approximately \(68 \%\) of the data, 2 standard deviations from the mean include \(95.5 \%\) of all data, and 3 standard deviations encompass \(99.7 \%\), nearly all the data. While it is not possible to guarantee that all data will be included, we use 3.5 standard deviations to represent \(100 \%\) of the data. Figure 2.6 illustrates the standard deviation groupings.
The \(z\)-score, a term used later in this book, is the number of standard deviations from the mean for a specific data point, also called the standard score. If a data point has a \(z\)-score of 2.0, it is 2 standard deviations from the mean.
\section*{Skewness (3rd Moment)}
Most price data, however, are not normally distributed. For physical commodities, such as gold, grains, energy, and even interest rates (expressed at yields), prices tend to spend more time at low levels and much less time at extreme highs. In another example, gold peaked at \(\$ 800\) per ounce in January 1980, then at \$1,895 in September 2011 (see Figure 2.5). After the peak in 1980, prices fell back to between \(\$ 250\) and \(\$ 400\) for most of the next twenty years. That period averaged \(\$ 325\) with a standard deviation of \(\$ 140\). A normal distribution of 2 standard deviations would put \(95 \%\) of the data between \(\$ 45\) and \(\$ 605\), which is not realistic. Using all the data, we get an average of \(\$ 607\) and a standard deviation of \(\$ 408\). Then 2 standard deviation puts the range at \(-\$ 391\) to \(\$ 1,423\), again an unlikely scenario.
The frequency distribution (Figure 2.6) shows two nodes, one where prices remained near \(\$ 400\), and then a newer area where prices are settling at \(\$ 1,300\). In both cases there is a long tail to the right, making it necessary to consider the skew (Figure 2.7). Skew measures the amount of distortion from a symmetric distribution, making the curve appear to be short on the left (lower prices) and extended to the right (higher prices). The extended side, either left or right, is called the tail, and a longer tail to the right is called positive skewness. Negative skewness has the tail extending toward the left.
Gold cash prices 1978-2017
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0146.jpg?height=562&width=1339&top_left_y=127&top_left_x=65)
Bins
FIGURE 2.6 Gold cash frequency distribution.
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0146.jpg?height=716&width=1329&top_left_y=851&top_left_x=64)
Arithmetic mean average
FIGURE 2.7 Skewness. Nearly all price distributions are positively skewed, showing a longer tail to the right, at higher prices.
The formula for skew is:
\[
s_{K}=\frac{\sum_{=1}^{n}\left(p_{p}-\bar{p}\right)^{3}}{(n-1) \sigma^{3}}
\]
\section*{Skew in Terms of the Mean, Median, and Mode}
In a perfectly normal distribution, the mean, median, and mode all coincide. As prices become positively skewed, typical of a period of higher prices, the mean will move the farthest to the right, the mode will move the least, and the median will fall in between. The difference between the mean and the mode, adjusted for dispersion using the standard deviation of the distribution, gives a good measure of skewness:
\[
(\text { Skewness }) S_{K}=\frac{\text { Mean }- \text { Mode }}{\text { Standard deviation }}
\]
The distance between the mean and the mode, in a moderately skewed distribution, turns out to be three times the difference between the mean and the median; the relationship can also be written as:
\section*{(Skewness) \(S_{K}=\frac{3 \times(\text { Mean }- \text { Mode })}{\text { Standard deviation }}\)}
Skewness in Distributions at Different Relative Price Levels
Because the lower price levels of most commodities are determined by production costs, price distributions show a clear tendency to resist moving below these thresholds.
This contributes to the positive skewness in those markets. Considering only the short term, if prices are at unusually high levels due to a supply and demand imbalance and not a structural change, they can be volatile and unstable, causing a negative skewness that will seem top heavy, the area where prices cannot be pushed any higher. Somewhere between the very high and very low price levels, we may find a frequency distribution that looks normal. Figure 2.8 shows the change in the distribution of prices over, for example, 20 days, as prices move sharply higher. The mean shows the center of the distributions as they change from positive to negative skewness. This pattern indicates that a normal distribution is not appropriate for all price analysis, and that a log, exponential, or power distribution would only apply best to long-term analysis.
\section*{Kurtosis (4th Moment)}
The 4th moment, kurtosis, describes the peakedness or flatness of a distribution as shown in Figure 2.9. This can be used as an unbiased assessment of whether prices are trending or moving sideways. If you see prices moving steadily higher, then the distribution will be flatter and cover a wider range. This is call negative kurtosis. If prices are rangebound, then there will be a clustering around the mean and we have positive kurtosis. Steidlmayer's Market Profile, discussed in Chapter 18 , uses the concept of kurtosis, with the frequency distribution accumulated dynamically using real-time price changes.
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0149.jpg?height=706&width=1327&top_left_y=57&top_left_x=63)
FIGURE 2.8 Changing distribution at different price levels. A, B, and C are increasing mean values of three shorter-term distributions and show the distribution changing from positive to negative skewness.
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0150.jpg?height=1026&width=1337&top_left_y=60&top_left_x=64)
FIGURE 2.9 Kurtosis. A positive kurtosis is when the peak of the distribution is greater than normal, typical of a sideways, or range-bound, market. A negative kurtosis, shown as a flatter distribution, occurs when the market is trending.
Using the same form as the 3rd moment, skewness, kurtosis can be calculated as
\[
K=\frac{\sum_{i=1}^{n}\left(p_{i}-\bar{P}\right)^{4}}{(n-1) \sigma^{4}}
\]
Most often the excess kurtosis is used, \(K E=K-3\), which makes it easier to see abnormal distributions. The
normal value of the kurtosis is 3 .
Kurtosis is also useful when reviewing system tests. The kurtosis of the daily returns will be better than 3 if the system is profitable; however, a kurtosis of a system test that is above 7 or 8 indicates that the trading method is probably overfitted. A high kurtosis means that there are an overwhelming number of profitable trades of similar size, which is not likely to happen in real trading. Any high value of kurtosis should make you immediately suspicious.
\section*{Moments and Other Statistics Using Excel}
Life is easier with spreadsheets. It is no longer necessary to look up tables for to find the location in a probability distribution or enter a complex formula. In Excel:
Variance(list) or VAR.S is the variance of a list of values with the denominator \(n\). The population variance(list) or VAR.P is the same calculation with the denominator \(n-1\).
Stdev(list) or Stdev.S is the standard deviation and Stdev.p(list) is the population standard deviation. The difference is that the denominator of Stdev is
\(n-1\) while the denominator of Stdevp is \(n\).
Skew(list) and Skew.p(list) are the skew with \(n\) as the denominator or \(n-1\) as the denominator.
Kurt(list) is the kurtosis.
Normdist ( \(x\),mean,sd,TRUE) gives you the probability associated with a standard deviation
value in the distribution. \(X\) is the value (e.g., 1.5), mean is the average of the list values, \(s d\) is the standard deviation of the list values, and TRUE indicates that you want the cumulative distribution. An answer of 0.933 means your value is at the \(93.3 \%\) level (far right) of the distribution.
Rand and Randbetween ( \(a, b\) ) returns uniform (evenly distributed) random numbers. Rand returns values between 0 and 1 , and randbetween returns evenly distributed values between the two input numbers \(a\) and \(b\).
To find other statistical functions in Excel, go to the Formulas drop-down tab and click on \(f x\) (insert function) for a list of functions and descriptions. All of the basic functions are also part of any development platform but may have different names.
\section*{Stock Market Returns}
If we assume a normal distribution (shown in Figure 2.4) of the annual returns for the stock market over the past 50 years, it has a mean of about \(8 \%\) and one standard deviation of \(16 \%\). In any one year, we can expect the returns to be \(8 \%\); however, there is a \(32 \%\) chance that it will be either greater than \(24 \%\) ( \(16 \%\) for the right tail determined by the mean plus one standard deviation) or less than \(-8 \%(16 \%\) for the left tail determined by the mean minus one standard deviation). If you would like to know the probability of a return of \(20 \%\) or greater, you must first rescale the values:
Objective - Mean
Probability of reaching objective \(=\)
Standard deviation
If your objective is 20\%, we calculate:
\[
\text { Probability }=\frac{20 \%-8 \%}{16 \%}=0.75
\]
The time period over which you would achieve your goal is the same as the data period used to calculate the standard deviation, 50 years.
\section*{CHOOSING BETWEEN FREQUENCY DISTRIBUTION AND STANDARD DEVIATION}
Frequency distributions are important because the standard deviation doesn't work for skewed distributions, which is common for most price data over long time periods. We have shown examples of both wheat and gold where the average less 2 standard deviations was far lower than what we would consider realistic.
\section*{Wheat Frequency Distribution}
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0154.jpg?height=576&width=1329&top_left_y=124&top_left_x=62)
FIGURE 2.10 Measuring 10\% from each end of the frequency distribution. The dense clustering at low prices will make the lower zone look narrow while high prices with less frequent data will appear to have a wide zone.
The frequency distribution gives a more useful picture. If we wanted to know the price at the \(10 \%\) and \(90 \%\) probability levels based on the frequency distribution, we would sort all the data from low to high. If there were 300 data points, then the \(10 \%\) level would be in position 30 and the \(90 \%\) level in position 271 . The median price would be at position 151. This is shown in Figure 2.10 for wheat.
\section*{MEASURING SIMILARITY}
Many readers will be familiar with the concept of correlation, which is a basic measure of similarity.
Correlation is derived from a linear regression and is discussed in Chapter 6 under "Linear Correlation."
\section*{t-Statistic and Degrees of Freedom}
When fewer prices or trades are used in a distribution, we can expect the shape of the curve to be more erratic. For example, it may be spread out so that the peak of the distribution will be only slightly higher than either end. A way of measuring how close the sample distribution of a smaller set is to the normal distribution is to use the \(t\) statistic (also called the student's \(t\)-test). The \(t\)-test is calculated according to its degrees of freedom ( \(d f\) ), which is \(n-1\), where \(n\) is the sample size, the number of prices used in the distribution.
\section*{Average of price changes}
\section*{Standard deviation of price changes}
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0155.jpg?height=141&width=203&top_left_y=850&top_left_x=1134)
The more data in the sample, the more reliable the results. We can get a broad view of the shape of the distribution by looking at Table 2.2, which gives the values oft corresponding to the upper tail areas of 0.10 , \(0.05,0.025,0.01\), and 0.005 . The table shows that as the sample size \(n\) increases, the values of \(t\) approach those of the standard normal values of the tail areas.
TABLE 2.2 Values of \(t\) corresponding to the upper tail probability of 0.025 .
\begin{tabular}{|l|l|}
\hline Degrees of Freedom ( \(\boldsymbol{d} \boldsymbol{f})\) & Value of \(\boldsymbol{t}\) \\
\hline .1 & 12.706 \\
\hline .10 & .2 .228 \\
\hline .20 & .2 .086 \\
\hline
\end{tabular}
\begin{tabular}{|l|l|}
\hline .30 & .2 .042 \\
\hline 120 & .1 .980 \\
\hline Normal & .1 .960 \\
\hline
\end{tabular}
The values of \(t\) needed to be significant can be found using Excel. The function T.TEST returns the probability associated with the test, T.DIST returns the left tail distribution. Other functions associated with the tdistribution can be found by searching Excel for "T Distribution." The significant levels are the same as other tests where \(5 \%\) is usually considered significant and \(1 \%\) (0.01) highly significant.
Degrees of freedom applies to the rules and variables in your strategy. When testing a trading system, the greater the degrees of freedom, the more data you need to validate the strategy, whether price data or the number of trades. The \(t\)-test is the most common way of measuring whether you have done enough.
\section*{2-Sample t-Test}
You may want to compare two periods of data to decide whether the price patterns have changed significantly. Some analysts use the 2-sample \(t\)-test to eliminate inconsistent data, but characteristics of price and economic data change as part of the evolving process, and trading systems should be able to adapt to these changes. This test is best applied to trading results in order to decide if a strategy is performing consistently.
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0157.jpg?height=399&width=568&top_left_y=55&top_left_x=447)
where
\(\bar{P}_{1}\) and \(\bar{P}_{2}=\) the averages of the prices for periods 1
var \(_{1}\) and \(=\) the variances of the prices for periods 1 var \(_{2}\) and 2
\(n_{1}\) and \(n_{2}=\) the number of prices in periods 1 and 2 and the two periods being compared are mutually exclusive.
The degrees of freedom, \(d f\), needed to find the confidence levels can be calculated using Satterthwaite's approximation, where \(s\) is the standard deviation of the data values:
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0157.jpg?height=587&width=825&top_left_y=1404&top_left_x=318)
When using the \(t\)-test to find the consistency of profits and losses generated by a trading system, replace the data items by the net returns of each trade, the number of data items by the number of trades, and calculate all other values using trading returns rather than prices.
\section*{Autocorrelation}
Serial correlation or autocorrelation looks for persistence in the data - that is, being able to predict future data from past data. That could indicate the existence of trends. A simple way of finding autocorrelation is the put the data into column A of a spreadsheet, then copy it to column B while shifting the data down by 1 row. Then find the correlation of column A and column B. Additional correlations can be calculated shifting column B down 2,3 , or 4 rows, which might show the existence of a cycle. A formal way of finding autocorrelation is by using the Durbin-Watson test, which gives the \(d\)-statistic. This approach measures the change in the errors ( \(e\) ), the difference between \(N\) data points and their average value.
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0158.jpg?height=492&width=699&top_left_y=1401&top_left_x=381)
The value of \(d\) always falls between 0 and 4 . There is no
autocorrelation if \(d=2\). If \(d\) is substantially less than 2, there is positive autocorrelation; however, if it is below 1 , then there is more similarity in the errors than is reasonable. The farther \(d\) is above 2 , the more negative autocorrelation appears in the error terms.
A positive autocorrelation, or serial correlation, means that a positive error factor has a good chance of following another positive error factor.
\section*{STANDARDIZING RISK AND RETURN}
To compare one trading method with another, it is necessary to standardize both the tests and the measurements used for evaluation. If one system has total returns of \(50 \%\) and the other \(250 \%\), we cannot decide which is best unless we know the duration of the test and the volatility of the returns, or risk. If the \(50 \%\) return was over 1 year and the \(250 \%\) return over 10 years, then the first one is best. Similarly, if the first return had an annualized risk of \(10 \%\) and the second a risk of \(50 \%\), then both would be equivalent. The return relative to the risk is crucial to performance as will be discussed in Chapter 21, "System Testing." For now it is only important that returns and risk be annualized or standardized to make comparisons valid.
\section*{Calculating Returns}
In its simplest form, the 1-period rate of return, \(r\), or the holding period rate of return, is:
\section*{Ending value - Starting value - Ending value \\ Starting value \\ Starting value}
This is often used to find the return for the current year. For the stock market, which has continuous prices, this can be written:
\[
r_{1}=\frac{p_{1}-p_{0}}{p_{0}}=\frac{p_{1}}{p_{0}}-1
\]
where \(P_{0}\) is the initial price and \(P_{1}\) is the price after one period has elapsed. This cannot be done for futures, which has back-adjusted data that can go negative. Instead, the return would be:
\[
\left(\text { futures } r_{t}=\frac{\text { Equity }_{t}-\text { Equity }_{t-1}}{\text { Equity }_{t-1}}\right.
\]
The securities industry often prefers a different calculation, using the natural log function:
\[
r_{t}=\ln \left(\frac{P_{t}}{P_{t-1}}\right)=\log _{c}\left(\frac{P_{t}}{P_{t-1}}\right)
\]
Both methods have advantages and disadvantages. To distinguish the two calculations, the first method will be called the standard method and the second the ln method. We will use the first method unless indicated.
In the following spreadsheet example, shown in Table 2. 3 over 22 days, the standard returns are in column D and the \(\ln\) returns in column E. The differences seem small, but the averages are 0.00350 and 0.00339 . The standard returns are better by \(3.3 \%\) over this one month, but could reverse the next month. The net asset values (NAVs), used extensively throughout this book, are the compound periodic returns, and most often have a starting value, \(N A V_{0}=100\).
\[
N A V_{t}=N A V_{t-1} \times\left(1+r_{t}\right)
\]
\section*{Annualizing Returns}
The most powerful force in the Universe is compound interest.
-Albert Einstein
\section*{TABLE 2.3 Calculation of returns and NAVs from daily profits and losses.}
\begin{tabular}{|l|r|r|r|r|r|}
\hline Date & PL & \begin{tabular}{l}
Cum \\
PL
\end{tabular} & \begin{tabular}{c}
Standard \\
Return
\end{tabular} & \begin{tabular}{c}
Return \\
Using \\
LN
\end{tabular} & NAV \\
\hline \(9 / 10 / 2010\) & & 100000 & & & 100. \\
\hline \(9 / 13 / 2010\) & 1154 & 101154 & 0.01154 & 0.01147 & 101 \\
\hline \(9 / 14 / 2010\) & 1795 & 102949 & 0.01774 & 0.01759 & 102 \\
\hline \(9 / 15 / 2010\) & -1859 & 101090 & -0.01806 & -0.01822 & 101. \\
\hline \(9 / 16 / 2010\) & -1603 & 99487 & -0.01585 & -0.01598 & .99 \\
\hline \(9 / 17 / 2010\) & 449 & 99936 & 0.00451 & 0.00450 & .99 \\
\hline
\end{tabular}
\begin{tabular}{|l|r|r|r|r|r|}
\hline \(9 / 20 / 2010\) & 1090 & 101026 & 0.01090 & 0.01084 & 101. \\
\hline \(9 / 21 / 2010\) & 2949 & 103974 & 0.02919 & 0.02877 & 103 \\
\hline \(9 / 22 / 2010\) & 1346 & 105320 & 0.01295 & 0.01286 & 105 \\
\hline \(9 / 23 / 2010\) & 64 & 105384 & 0.00061 & 0.00061 & 105 \\
\hline \(9 / 24 / 2010\) & -2051 & 103333 & -0.01946 & -0.01966 & 103 \\
\hline \(9 / 27 / 2010\) & 3269 & 106602 & 0.03164 & 0.03115 & 106. \\
\hline \(9 / 28 / 2010\) & 1795 & 108397 & 0.01684 & 0.01670 & 108. \\
\hline \(9 / 29 / 2010\) & -1154 & 107243 & -0.01064 & -0.01070 & 107 \\
\hline \(9 / 30 / 2010\) & 128 & 107372 & 0.00120 & 0.00119 & 107 \\
\hline \(10 / 1 / 2010\) & -705 & 106666 & -0.00657 & -0.00659 & 106 \\
\hline \(10 / 4 / 2010\) & 1090 & 107756 & 0.01022 & 0.01016 & 107 \\
\hline \(10 / 5 / 2010\) & -449 & 107307 & -0.00416 & -0.00417 & 107 \\
\hline \(10 / 6 / 2010\) & 2308 & 109615 & 0.02150 & 0.02128 & 109 \\
\hline \(10 / 7 / 2010\) & -769 & 108846 & -0.00702 & -0.00704 & 108 \\
\hline \(10 / 8 / 2010\) & -256 & 108589 & -0.00236 & -0.00236 & 108 \\
\hline \(10 / 12 / 2010\) & -1218 & 107372 & -0.01122 & -0.01128 & 107 \\
\hline Average & & & 0.00350 & 0.00339 & \\
\hline Std Dev & & & 0.01502 & 0.01495 & \\
\hline Ann & & & 0.23846 & 0.23730 & \\
\hline StdDev & & & & & \\
\hline AROR & & & & & 125.8 \\
\hline
\end{tabular}
In most cases, it is best to standardize the returns by annualizing. This is particularly helpful when comparing two sets of test results, where each covers a different time period. When annualizing, it is important to know
that:
■ Government instruments use a 360-day rate (based on 90-day quarters).
- A 365-day rate is common for most other data that can change daily, including weekends.
- Trading returns are best with 252 days, which is the typical number of days in a trading year for the United States, slightly less in Europe. For comparisons, 252 will be used everywhere in this book.
The annualized rate of return (AROR) on a simpleinterest basis for an investment over \(n\) days is:
\[
A R O R_{\text {simple }}=\frac{E_{n}}{E_{0}} \times \frac{252}{n}
\]
where \(E_{0}\) is the starting equity or account balance, \(E_{n}\) is the equity at the end of the \(n\)th period, and \(252 / n\) are the years expressed as a decimal. The annualized compounded rate of return is:
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0163.jpg?height=253&width=861&top_left_y=1468&top_left_x=290)
Note that \(A R O R\) or \(R\) (capital) refers to the annualized rate of return while \(r\) is the daily or 1-period return. Also, the form of the results is different for the two calculations. An increase of \(25 \%\) for the simple return
will show as 0.25 while the same increase using the compounded returns will be 1.25 .
When the 1-period returns use the ln method, then the annualized rate of return is the sum of the returns divided by the number of years, \(n\) :
\section*{\(A R O R_{\text {ln method }}=\underline{\sum_{i=1}^{n} r_{i}}\)}
\(n\)
An example of this can be found in column F , the row labeled AROR, in the previous spreadsheet. Note that the annualized returns using the ln method are much lower than those using division and compounding. The compounded method will be used throughout this book and is required for U.S. regulatory disclosure.
\section*{Probability of Returns Using the Compound Rate of Return}
The probability of achieving a return can be estimated using the standard deviation and compounded rate of return. In the following calculation, \(\frac{1}{-1}\) the arithmetic mean of continuous returns is \(\ln \left(1+R_{g}\right)\), and it is assumed that the returns are normally distributed.
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0164.jpg?height=315&width=785&top_left_y=1627&top_left_x=332)
where
\(z=\) standardized variable (the probability)
\(T=\) target value or rate-of-return objective
\(B=\) beginning investment value
\(R_{g}=\) geometric average of periodic returns
\(n=\) number of periods
\(s=\) standard deviation of the logarithms of the quantities 1 plus the periodic returns
\section*{Risk and Volatility}
While we would always like to think about returns, it is even more important to be able to assess risk. With that in mind, there are two extreme risks. The first is event risk, which may take the form of an unpredictable price shock. The worst of these is catastrophic risk, which will cause fatal losses or ruin. The second is risk that is selfinduced by overleverage, or gearing up your portfolio, until a sequence of bad trades causes ruin. The risk of price shocks and leverage will both be discussed in detail in other chapters.
The standard risk measurement is essential for comparing the performance of two systems. It can be applied to any series of returns, including portfolio performance, then compared to a benchmark, such as the returns of the S\&P 500 or a bond fund. The most common estimate of risk is the standard deviation, \(\sigma\), of returns, \(r\), shown earlier in this chapter. Annualizing the risk allows you to use it with the annualized return:
\section*{Annualized risk \((\) daily \()=\) standard deviation (daily returns) \(\times \sqrt{252}\)}
\section*{Annualized risk \((\) monthly \()=\) standard deviation \((\) monthly returns \() \times \sqrt{12}\)}
Risk is also called volatility. When we refer to the target volatility of a portfolio, we mean the percentage of risk represented by 1 standard deviation of the annualized returns. For example, in the previous spreadsheet, column D shows the daily returns. The standard deviation of those returns is shown in the row "Std Dev" as o.01502. Looking only at column D, there is a \(68 \%\) chance of a daily profit or loss less than \(1.862 \%\) and greater than \(-1.162 \%\) (the mean \(\pm 1\) stddev). However, target volatility always refers to annualized risk, and to change a daily return to an annualized one we multiply by \(\sqrt{252}\). Then the standard deviation of daily returns of \(1.502 \%\) becomes an annualized volatility of \(23.8 \%\), also shown at the bottom of the spreadsheet example. Because we only care about the downside risk, there is a \(16 \%\) chance that we could lose \(23.8 \%\) in one year. The greater the standard deviation of returns, the greater the risk.
\section*{Beta}
Beta ( \(\beta\) ) is commonly used in the securities industry to express the relationship of a single market risk to an index or portfolio. If beta is zero, then there is no relationship; if it is positive, it represents the relative volatility of the stock compared to the index. Specifically:
\(0<\beta<1\), the volatility of the single market is less than the index
\(\beta=1\), the volatility of the single market is the same as the index
\(\beta>1\), the volatility of the single market is greater than the index
\(\beta<0\), the market and the index are going in opposite directions
A beta of 1.25 means the stock has \(25 \%\) more volatility than the index, but it also means that, if the index rises by \(4 \%\), the stock should rise by \(5 \%\).
Beta is found by calculating the linear regression of the single market with respect to the index. It is the slope of the single market divided by the slope of the index. Alpha, the added value, is the \(y\)-intercept of the solution. The values can be found using Excel, and are discussed in detail in Chapter 6. A general formula for beta is:
\section*{\(\operatorname{Beta}(\mathrm{A})=\operatorname{COV}(\) returns A , returns B\() / \operatorname{VAR}(\) returns B\()\),} where A is the single market and B is a portfolio or index. The reliability of beta is best when the correlation of the returns of \(A\) and \(B\) is high.
\section*{Downside Risk}
Because the standard deviation is symmetric, a series of jumps in profits will be interpreted as larger risk. Some analysts believe that it is more accurate to measure the
risk using only the drawdowns. The use of only losses is called lower partial moments, where lower refers to the downside risk and partial means that only one side of the return distribution is used. Semivariance measures the dispersion that falls below the average return, \(\bar{R}\), or some target value:
\section*{Semivariance \(=\underline{\sum_{i=1}^{n}\left(\bar{R}-r_{i}\right)^{2}}\), where each \(r_{i}<\bar{R}\) \\ \(n\)}
However, the most common calculation for downside risk is to take the daily drawdowns - that is, the difference between the peak equity and the current equity when it is below the peak equity. For example, if the system returns had produced an equity of \(\$ 25,000\) on day \(t\), followed by a daily loss of \(\$ 500\), and another loss of \(\$ 250\), then we would have two values as input \(500 / 25000\) and \(750 / 25000\), or 0.02 and 0.03 . Only those returns below the previous peaks are used in the calculation, and the result is the average net drawdown. A better alternative is to take the standard deviation of these daily drawdowns, which then gives you the probability of a drawdown.
One concern about using only the drawdowns to predict other drawdowns is that it limits the number of cases and discards the likelihood that higher-than-normal profits can be related to higher overall risk. In situations where there are limited amounts of test data, using both the gains and losses will give more robust results.
A full discussion of performance measurements can be
found in Chapter 21, "System Testing," and in Chapter 23 under the heading "Measuring Return and Risk" and the subheading "Ulcer Index."
\section*{THE INDEX}
The purpose of an average is to transform individuality into classification. In doing that the data is often smoothed to gain useful information. Indices have attracted enormous popularity in recent years. Where there was only the Value Line and S\&P 500 trading as futures markets in the early 1980s, now there are equity index futures contracts representing the markets of every industrialized country. The creation of trusts, such as SPDRs (called "Spyders," the S\&P 500 ETF SPY), "Diamonds" (DIA, the Dow Jones Industrials), and the "Qs" (QQQ, the NASDAQ 100), have given stock traders an efficient vehicle to invest in the broad market rather than pick individual shares. Industrial sectors, such as pharmaceuticals, health care, and technology, first appeared as mutual funds, then as ETFs. These index markets all have the additional advantage of not being constrained by having to borrow shares in order to sell short, or by the uptick rule (if it is reinstated) requiring all short sales to be initiated on an uptick in price.
Index markets allow both individual and institutional participants a number of specialized investment strategies. They can buy or sell the broad market, they can switch from one sector to another (sector rotation), or they can sell an overpriced sector while buying the broad market index (statistical arbitrage). Institutions
find it very desirable, from the view of both costs and taxes, to temporarily hedge their cash equities portfolio by selling S\&P 500 futures rather than liquidating stock positions. They may also hedge using options on S\&P futures or SPY. An index simplifies the decision-making process for trading.
The index also holds an important role as a benchmark for performance. Most investors believe that a trading program is only attractive if it has a better return-to-risk ratio than a portfolio of \(60 \%\) stocks (as represented by the S\&P 500 index) and \(40 \%\) bonds (the Lehman Brothers Treasury Index). Beating the index is called creating alpha, proving that you're smarter than the market. The term crisis alpha refers to those years when futures markets return large gains to offset equally large losses in the stock market, as happened in 2008.
\section*{Constructing an Index}
An index is a standardized way of expressing price movement, as an accumulation of percentage changes. This effectively compounds the returns. Most indices have a starting value of 100 . The selection of the starting year is often "convenient" but can be any year. The base year for U.S. productivity and for unemployment is 1982; for consumer confidence, 1985; and for the composite of leading indicators, 1987. The CRB Yearbook shows the Producer Price Index (PPI) from as far back as 1913. For example, the PPI, which is released monthly, had a value of 186.8 in October 2010 and 185.1 in September 2010, a \(0.9184 \%\) increase in one month. An index value less than 100 means that the index has less value that when it
started.
Each index value is calculated from the previous value as:
Current index value \(=\) Previous index value \(\times\)
\[
\left(\frac{\text { Current price }}{\text { Previous price }}\right)
\]
\section*{Calculating the Net Asset Value: Indexing Returns}
The last calculations shown in the spreadsheet, Table 2.3, are the net asset value (NAV), calculated two ways. This is essentially the returns converted to an index, showing the compounded rate of return based on daily profit and losses relative to a starting investment. In the spreadsheet, the NAVs are shown in column F using standard returns and G using ln returns.
The process of calculating NAVs can be done with the following steps:
1. Establish the initial investment, in this case \(\$ 100,000\), shown at the top of column C. This can be adjusted later based on the target volatility.
2. Calculate the cumulative account value by adding the daily profits or losses (column B) to the previous account value (column C).
3. Calculate the daily returns by either (a) dividing today's profit or loss by yesterday's account value to get \(r\), or (b) taking the natural log of \(1+r\).
4. If using method (a), then each subsequent
\(N A V_{t}=N A V_{t-1} \times(1+r)\), and if using method
(b), then each \(N A V_{t}=N A V_{t-1}+\ln (1+r)\).
The final values of the NAV are in the last dated rows. The U.S. government requires that NAVs be calculated this way, although it doesn't specify whether returns should be based on the natural log. This process is also identical to indexing, which turns any price series into one that reflects percentage returns.
Compounding returns implies that all the investment is used all of the time. Test results are always compounded returns. When you trade, you will need to be sure that you are fully invested; otherwise, you will underperform the compounded return.
\section*{Leveraged Long or Short Index Funds}
As index markets have become more popular, financial engineering has created a wide range of innovative trading vehicles. Mutual funds, such as Rydex and ProFunds, cater to market timers, a group of money managers who may trade in and out of the funds every few days. These funds track the major index markets closely, but offer unique variations. There are both long and short funds, and each may be leveraged. When you buy a long fund that tracks the S\&P 500 (called Nova by Rydex), you are simply long the equivalent of the S\&P 500 . However, when you buy a short S\&P fund, called Ursa, you profit when the S\&P index price drops. In addition, both Rydex and ProFunds offer leverage of 1.5 or 2.0 on these funds, so that a gain of \(1.0 \%\) in the S\&P
500 translates into a gain of 2.0\% in ProFunds' UltraBull \(S \& P\) fund; a drop of \(1.0 \%\) in the S\&P would generate a profit of \(2.0 \%\) in ProFunds' UltraBear fund. The motivation behind the short funds, or inverse funds, is to circumvent the U.S. government rule that does not permit short sales in retirement accounts.
The calculation for leveraged long funds is very similar to a simple index; however, a short fund (where you profit from a decline in prices) is compounded to the upside, in the same way as a long fund. The following calculation will create a long and short index that closely approximates those used by Rydex and ProFunds. In addition, it includes the calculation of the daily high and low index values. If you intend to create a leveraged S\&P index, start with the cash S\&P price. Use the cash index equivalent for each of the mutual fund indices that you plan to duplicate.
In the following calculations, leverage is the leverage factor of the fund, for example, 1.5. Initial index values for both long and short funds are:
\section*{\(X C_{1}=100\)}
\[
\begin{aligned}
X H_{1} & =X C_{1}+100 \times\left(\frac{H_{1}}{C_{1}}-1.0\right) \times \text { Leverage } \\
X L_{1} & =X C_{1}+100 \times\left(\frac{L_{1}}{C_{1}}-1.0\right) \times \text { Leverage }
\end{aligned}
\]
Each subsequent index value for long funds is:
\[
\begin{aligned}
& X C_{i}=X C_{i-1} \times\left(\left(\frac{C_{i}}{C_{i-1}}-1.0\right) \times \text { Leverage }+1.0\right) \\
& X H_{i}=X C_{i-1} \times\left(\left(\frac{H_{i}}{C_{i-1}}-1.0\right) \times \text { Leverage }+1.0\right) \\
& X L_{i}=X C_{i-1} \times\left(\left(\frac{L_{i}}{C_{i-1}}-1.0\right) \times \text { Leverage }+1.0\right)
\end{aligned}
\]
For each subsequent value for the short funds, invert the middle term:
\[
\begin{aligned}
& X C_{i}=X C_{i-1} \times\left(\left(\frac{C_{i-1}}{C_{i}}-1.0\right) \times \text { Leverage }+1.0\right) \\
& X H_{i}=X C_{i-1} \times\left(\left(\frac{H_{i-1}}{C_{i}}-1.0\right) \times \text { Leverage }+1.0\right) \\
& X L_{i}=X C_{i-1} \times\left(\left(\frac{L_{i-1}}{C_{i}}-1.0\right) \times \text { Leverage }+1.0\right)
\end{aligned}
\]
where
\(X C, X H,=\) the leveraged index closing, high, and low and \(X L \quad\) prices
\(C, H\), and \(L=\) the underlying close, high, and low prices or index values
If there is no leverage, then substitute the value 1 for
leverage in the equations. Note that there are no costs included in this calculation, but the final short fund values should be net of the short-term borrowing costs.
\section*{Cross-Market and Weighted Index}
It is very convenient to use an index when two markets cannot normally be compared because they trade in different units. For example, if you wanted to show the spread between gold and IBM, you could index each of them beginning at the same date. The new indices would then be in the same units (percent) and would be easy to compare.
Most often, an index combines a number of related markets into a single number. A simple aggregate index is the ratio of unweighted sums of market prices in a specific year to the same markets in the base year. Most of the popular indices, such as the New York Stock Exchange Composite Index, fall into this class. A weighted aggregate index biases certain markets by weighting them to increase or decrease their effect on the composite value. The index is then calculated as in the simple aggregate index. When combining markets into a single index value, the total of all the weights will equal 1 and all weights are expressed as a percentage.
\section*{The Construction of the Major Index Markets}
Not all the index markets are calculated the same way, even in the United States. The following is a brief list of how the most popular index markets are calculated.
\section*{- Capitalization Weighted}
The outstanding shares \(\times\) price, also called a market-value-weighted index. They include the S\&P 500, NASDAQ 100, the Hang Seng, the MSCI EAFE Index, the German DAX, and the Japanese TOPIX.
\section*{Price Weighted}
Average of the price of all components. Includes the Dow Jones Industrials, the Nikkei 225.
\section*{World Production Index}
The Goldman Sachs Commodity Index (GSCI) is weighted by the production of the component commodities over the past five years, implying that more production is more important to the index.
\section*{- Trade Weighted Index}
The U.S. Dollar Index (DX on the New York Board of Trade and USDX on the Intercontinental Exchange - ICE) is a trade-weighted, geometric average of six currencies: the euro, \(57.6 \%\); the Japanese yen, \(13.6 \%\); the UK pound, \(11.9 \%\); the Canadian dollar, 9.1\%; the Swedish krona, 4.2\%; and the Swiss franc, \(3.6 \%\).
The Dollar Index rises when the U.S. dollar increases in value relative to the other currencies. In the daily calculation of the Dollar Index, each price change is represented as a percent. If, for example, the euro rises 50 points from 1.2500 to 1.2550 , the change is \(1.2550 / 1.2500=.004\); this is multiplied by its weighting factor 0.576 and
contributes -0.002304 to the index (a rising euro is a falling dollar).
\section*{Commodity Index Markets}
Besides the GSCI, other commodity indices have very specific weightings. As of 2018 they were:
Bloomberg Commodity Index(BCI) has energy \(30.57 \%\), grains \(23.46 \%\), industrial metals \(17.39 \%\), precious metals \(15.29 \%\), softs \(7.22 \%\), and livestock \(6.07 \%\)
Bloomberg (DJ-UBS) Commodity Index, energy \(36.69 \%\), agriculture \(28.21 \%\), industrial metals \(16.74 \%\), precious metals \(12.62 \%\), livestock \(5.74 \%\).
Commodity Research Bureau Index (CRB), energy \(39 \%\), agriculture \(41 \%\), precious metals \(7 \%\), industrial metals \(13 \%\).
Thomson Reuters Equal Weight Continuous Commodity Index, energy 18\%, agriculture 47\%, livestock \(12 \%\), metals \(23 \%\). A simple average of the daily prices of the 17 components.
\section*{Price-Volume Index}
Price \(\times\) volume would show the impact of a stock and create an index that reflects the strength of the move rather than the potential shown by a capitalization-weighted index. Although suggested by Paul Dysart in the 1930s, there are no popular index markets calculated this way.
Calculation must measure the incalculable.
-Dixon G. Watts
It's not possible to know tomorrow's price, or the effect of the next economic report. We can only estimate, not predict, its impact from price history. The area of study that deals with uncertainty is probability. Everyone uses probability in daily thinking and actions. When you tell someone that you will "be there in 30 minutes," you are assuming:
- Your car will start.
- You will not have a breakdown.
- You will have no unnecessary delays.
- You will drive at a predictable speed.
- You will have the normal number of green lights.
All these circumstances are extremely probabilistic, and yet everyone makes the same assumptions. Actually, the 30-minute arrival is intended only as an estimate of the average time it should take for the trip. If the arrival time were critical, you would extend your estimate to 40 or 45 minutes to account for unexpected events. In statistics, this is called increasing the confidence interval. You would not raise the time to two hours because the likelihood of such a delay would be too remote. Estimates imply an allowable variation, all of which is considered normal.
Probability is the measurement of the uncertainty surrounding an average value. Probabilities are measured in percent of likelihood. For example, if \(M\)
numbers from a total of \(N\) are expected to fall within a specific range, the probability \(P\) of any one number satisfying the criteria is:
\[
P=\frac{M}{N}, \quad 0<P<1
\]
When making a trade, or forecasting prices, we can only talk in terms of probabilities or ranges. We expect prices to rise 30 to 40 points, or we have a \(65 \%\) chance of a \(\$ 400\) profit from a trade. Nothing is certain, but a high probability of success is very attractive.
\section*{Laws of Probability}
Two basic principles of probability are easily explained by using examples with playing cards. In a deck of 52 cards, there are 4 suits of 13 cards each. The probability of drawing a specific card on any one turn is \(1 / 52\). Similarly, the chances of drawing a particular suit or card number are \(1 / 4\) and \(1 / 13\), respectively. The probability of any one of these three possibilities occurring is the sum of their individual probabilities. This is known as the law of addition. The probability of success in choosing a numbered card, suit, or specific card (that is, either a 10, or a spade, or the queen of hearts) is:
\[
P=\frac{1}{13}+\frac{1}{4}+\frac{1}{52}=\frac{18}{52}=35 \%
\]
The other basic principle, the law of multiplication, states that the probability of two occurrences happening simultaneously or in succession is equal to the product of their separate probabilities. The likelihood of drawing a 3 and a club from the same deck in two consecutive turns (replacing the card after each draw) or of drawing the same cards from two decks simultaneously is:
\[
P=\frac{1}{13} \times \frac{1}{4}=\frac{1}{52}=2 \%
\]
\section*{Joint and Marginal Probability}
Price movement is not as clearly defined as a deck of cards. There is often a relationship between successive events. For example, over two consecutive days, prices must have one of the following sequences or joint events: (up, up), (down, down), (up, down), (down, up), with the joint probabilities of \(0.40,0.10,0.35\), and 0.15 , respectively. In this example, there is the greatest expectation that prices will rise. The marginal probability of a price rise on the first day is shown in Table 2.4, which concludes that there is a \(75 \%\) chance of higher prices on the first day and a \(55 \%\) chance of higher prices on the second day.
\section*{Contingent Probability}
What is the probability of an outcome "conditioned" on the result of a prior event? In the example of joint probability, this might be the chance of a price increase on the second day when prices declined on the first day.
The notation for this situation (the probability of \(A\) conditioned on \(B\) ) is:
\section*{\(P(A \mid B)=\frac{P(A \text { and } B)}{P(B)}=\frac{\text { Joint probability of } A \text { and } B}{\text { Marginal probability of } B}\)}
\section*{TABLE 2.4 Marginal probability.}
\begin{tabular}{|c|c|c|c|c|c|c|}
\hline \multirow{7}{*}{ Day 1} & & \multicolumn{3}{|c|}{ Day 2} & \multirow[b]{3}{*}{ Up } & \multirow{4}{*}{\begin{tabular}{l}
Marginal \\
probability \\
on Day 1
\end{tabular}} \\
\hline & \multirow[b]{2}{*}{ Up } & \multirow{2}{*}{\(\frac{\text { Up }}{.40}\)} & \multicolumn{2}{|c|}{ Down } & & \\
\hline & & & .35 & .75 & & \\
\hline & Down & . 15 & .10 & . 25 & Down & \\
\hline & & . 55 & .45 & & & \\
\hline & & Up & Down & & & \\
\hline & & rgin & y 2 & & & \\
\hline
\end{tabular}
then
\(P(\) up Day \(2 \mid\) down Day 1 \()=\frac{\text { Jointprobability of }(\text { down, up })}{\text { Marrginal probability of }(\text { down Day } 1)}\)
\[
=\frac{0.15}{0.25}=0.60
\]
The probability of either a price increase on Day 1 or a price increase on Day 2 is:
\section*{\(P(\) either \()=P(\) up Day 1) \(+P(\) up Day 2) \(-P(\) up Day 1 and up Day 2) \\ \(=0.75+0.55-0.40\) \\ \(=0.90\)}
\section*{Markov Chains}
If we believe that today's price movement is based in some part on what happened yesterday, we have a situation called conditional probability. This can be expressed as a Markov process, or Markov chain. The results, or outcomes, of a Markov chain express the probability of a state or condition occurring. For example, the possibility of a clear, cloudy, or rainy day tomorrow can be related to today's weather.
The different combinations of dependent possibilities are given by a transition matrix. In our weather prediction example, a clear day has a \(70 \%\) chance of being followed by another clear day, a \(25 \%\) chance of a cloudy day, and only a \(5 \%\) chance of rain. In Table 2.5, each possibility today is shown on the left, and its probability of changing tomorrow is indicated across the top. Each row totals \(100 \%\) and accounts for all weather combinations. The relationship between these events can be shown as a continuous network (see Figure 2.11).
The Markov process can reduce intricate relationships to a simpler form. First, consider a 2 -state process. Using the markets as an example, what is the probability of an up or down day following an up day, or following a down day? If there is a \(70 \%\) chance of a higher day following a
higher day and a \(55 \%\) chance of a higher day following a lower day, what is the probability of any day being an up day?
Start with either an up or down day, and then calculate the probability of the next day being up or down. This is done by simply counting the number of cases, given in Table 2.6a, then dividing to get the percentages, as shown in Table 2.6b.
Because the first day may be designated as up or down, it is an exception to the general rule and therefore is given the weight of \(50 \%\). The probability of the second day being up or down is the sum of the joint probabilities:
\[
\begin{aligned}
P(\text { up })_{2} & =(0.50 \times 0.70)+(0.50 \times 0.55) \\
& =0.625
\end{aligned}
\]
The probability of the second day being up is \(62.5 \%\). Continuing in the same manner, use the probability of an up day as 0.625 , the down as 0.375 , and calculate the third day:
\[
\begin{aligned}
P(\text { up })_{3} & =(0.626 \times 0.70)+(0.375 \times 0.55) \\
& =0.64375
\end{aligned}
\]
\section*{TABLE 2.5 Transition Matrix}
\begin{tabular}{|c|c|c|c|c|}
\hline & & \multicolumn{3}{|c|}{ Tomorrow } \\
\hline & & Clear & Cloudy & Rainy \\
\hline & Clear & 0.70 & 0.25 & 0.05 \\
\hline & & & & \\
\hline
\end{tabular}
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0184.jpg?height=1168&width=1331&top_left_y=56&top_left_x=61)
FIGURE 2.11 Probability network.
TABLE 2.6a Counting the occurrences of up and down days.
\begin{tabular}{|c|c|c|c|c|}
\hline & & \multicolumn{3}{|r|}{ Today } \\
\hline & & Up & Down & Total \\
\hline & Up & 75 & 60 & 135 \\
\hline Previous day & & & & \\
\hline & Down & 60 & 65 & 125 \\
\hline
\end{tabular}
TABLE 2.6b Starting transition matrix.
\begin{tabular}{|c|c|c|c|c|}
\hline & & & Today & \\
\hline & & Up & Down & Total \\
\hline & Up & 0.555 & 0.444 & 1.00 \\
\hline Previous day & & & & \\
\hline & Down & 0.480 & 0.520 & 1.00 \\
\hline
\end{tabular}
and the fourth day:
\[
\begin{aligned}
P(\text { up })_{4} & =(0.64375 \times 0.70)+(0.35625 \times 0.55) \\
& =0.64656
\end{aligned}
\]
which can now be seen to be converging. To generalize the probability of an up day, look at what happens on the ith day:
\(P(\text { up })_{i}=\left[\left(P(\text { up })_{i-1} \times 0.70\right]+\left[\left(1-P(\text { up })_{i-1} \times 0.55\right)\right]\right.\)
Because the probability is converging, the relationship
\[
P(\operatorname{up})_{i+1}=P(\operatorname{up})_{i}
\]
can be substituted and used to solve the equation
\[
P(u p)_{i}=\left[P(u p)_{i} \times 0.70\right]+\left[0.55-P(u p)_{i} \times 0.55\right]
\]
giving the probability of any day being up within an uptrend as:
\[
P(u p)_{i}=0.64705
\]
We can find the chance of an up or down day if the 5 -day trend is up simply by substituting the direction of the \(5^{-}\) day trend (or \(n\)-day trend) for the previous day's direction in the example just given.
Predicting the weather is a more involved case of multiple situations converging and may be very representative of the way prices react to past prices. By approaching the problem in the same manner as the two-state process, a \(1 / 3\) probability is assigned to each situation for the first day; the second day's probability is:
\[
\begin{aligned}
P(\text { clear })_{2} & =(0.333 \times 0.70)+(0.333 \times 0.20)+(0.333 \times 0.20) \\
& =0.3663
\end{aligned}
\]
\(P(\text { cloudy })_{2}=(0.333 \times 0.25)+(0.333 \times 0.60)+(0.333 \times 0.40)\)
\[
=0.41625
\]
\[
P(\text { rainy })_{2}=(0.333 \times 0.05)+(0.333 \times 0.20)+(0.333 \times 0.40)
\]
\[
=0.21645
\]
Then, using the second day results, the third day is:
\(P(\text { clear })_{3}=(0.3663 \times 0.70)+(0.41625 \times 0.20)+(0.21645 \times 0.20)\)
\[
=0.38295
\]
\(P(\text { cloudy })_{3}=(0.3663 \times 0.25)+(0.41625 \times 0.60)+(0.21645 \times 0.40)\)
\[
=0.42791
\]
\[
\begin{aligned}
P(\text { rainy })_{3} & =(0.3663 \times 0.05)+(0.41625 \times 0.20)+(0.21645 \times 0.40) \\
& =0.18815
\end{aligned}
\]
The general form for solving these three equations is:
\[
P(\text { clear })_{i+1}=\left[P(\text { clear })_{i} \times 0.70\right]+\left[P(\text { cloudy })_{i} \times 0.20\right]+\left[P(\text { rainy })_{i} \times 0.20\right]
\]
\[
P(\text { cloudy })_{i+1}=\left[P(\text { clear })_{i} \times 0.25\right]+\left[P(\text { cloudy })_{i} \times 0.60\right]+\left[P(\text { rainy })_{i} \times 0.40\right]
\]
\(P(\text { rainy })_{i+1}=\left[P(\text { clear })_{i} \times 0.05\right]+\left[P(\text { cloudy })_{i} \times 0.20\right]+\left[P(\text { rainy })_{i} \times 0.40\right]\)
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0187.jpg?height=133&width=151&top_left_y=1193&top_left_x=62)
where each \(i+1\) element can be set equal to the corresponding \(i\) th value. There are then three equations in three unknowns, which can be solved directly or by matrix multiplication, as shown in Appendix 2 on the
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0187.jpg?height=78&width=1279&top_left_y=1517&top_left_x=63)
use the additional relationship
\section*{\(P(\text { clear })_{i}+P(\text { cloudy })_{i}+P(\text { rainy })_{i}=1.00\)}
The results are:
\section*{\(P(\) clear \()=0.400\) \\ \(P(\) cloudy \()=0.425\) \\ \(P(\) rainy \()=0.175\)}
\section*{Bayes' Theorem}
Although historic generalization exists concerning the outcome of an event, a specific current market situation may alter the probabilities. Bayes' theorem combines the original probability estimates with the added-event probability (the reliability of the new information) to get a posterior or revised probability:
\section*{\(P(\) Original and added-event \()\)}
\section*{\(P(\) Added-event \()\)}
Assume that the price changes \(P(\) up \()\) and \(P(\) down \()\) are both original probabilities, and an added-event probability, such as an unemployment report, trade balance, crop report, inventory stocks, or Federal Reserve interest rate announcement is expected to have an overriding effect on tomorrow's movement. Then the new probability \(P(\mathrm{Up} \mid\) added-event \()\) is:
\section*{\(P(U p\) and added-event \()\)}
\(P\left(U_{P}\right.\) and added-event \()+P(\) Down and added-event \()\) where \(u p\) and down refer to the original historic probabilities.
Bayes' theorem finds the conditional probability even if the joint and marginal probabilities are not known. The new probability \(P\) (up | added-event) is:
\section*{\(P(U p) \times P(\) Added-event \(\mid\) up \()\)}
\(\overline{P\left(U_{p}\right) \times P(\text { Added-event } \mid \text { up })+P(\text { Down }) \times P(\text { Added-event } \mid \text { down })}\) where
\(P(\) Added-event \(\mid\) up \()=\) the probability of the new event being a correct predictor of an upwards move
\(P(\) Added-event \(\mid\) down \()=\) the probability of prices going down when the added news indicates up
For example, if a quarter percent decline in interest rates has an \(80 \%\) chance of causing stock prices to move higher, then:
\[
P(\text { Added-event } \mid \text { up })=0.80
\]
and
\section*{\(P(\) Added-event \(\mid\) down \()=0.20\)}
\section*{SUPPLY AND DEMAND}
Trading system are not always constructed from moving averages and momentum indicators. Arbitrage is a large profit center in financial institutions and, while most arbitrage looks for price differences in similar stocks or
futures markets, there are analysts who would like to know the "fair value" of a commodity. This allows them to buy when the current price is below the fair value and sell when it is higher. To understand and construct a technical or econometric model that estimates fair value requires a knowledge of the fundaments of supply and demand. This section is an overview of those factors.
Price is the balancing point of supply and demand. In order to estimate the future price of any product or explain its historic patterns, it will be necessary to relate the factors of supply and demand and then adjust for inflation, technological improvement, and other indicators common to econometric analysis. The following sections briefly describe these factors.
\section*{Demand}
The demand for a product declines as price increases. The rate of decline is always dependent on the need for the product and its available substitutes at different price levels. In Figure 2.12a, \(D\) represents normal demand for a product over some fixed period. As prices rise, demand declines. \(D^{\prime}\) represents increased demand, resulting in higher prices at all levels.
In most cases the demand relationship is not a straight line. Production costs and minimum demand prevent the curve from going to zero; instead, it approaches a minimum price level. This can be seen previously in the frequency distribution for wheat, Figure 2.3, where the left side of the distribution (lower price) falls off sharply. It is also shown in Figure 2.12b, where 100 represents
the cost of production for a producer. The demand curve, therefore, shows the rate at which a change in quantity demanded brings about a change in price. Note that, although a producer may lose money below 100, lack of demand and the need for income can force sales at a loss. As a trader, don't assume that prices will stop going lower at the point where a producer loses money.
On the higher end of the scale, there is a lag in the response to increased prices and a consumer reluctance to reduce purchasing even at higher prices (called "inelastic demand"). Coffee is well known for having inelastic demand - most coffee drinkers will pay the market price rather than go without.
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0192.jpg?height=1297&width=1323&top_left_y=60&top_left_x=65)
FIGURE 2.12a Shift in demand.
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0193.jpg?height=1271&width=1327&top_left_y=59&top_left_x=63)
FIGURE 2.12b Demand curve, including extremes.
Source: Geoffrey S. Shepherd and G. A. Futrell.
Agricultural Price Analysis (Ames: Iowa State University, 1969), 53.
\section*{Elasticity of Demand}
Elasticity is the key factor in expressing the relationship between price and demand; it defines the shape of the curve. It is the relative change in demand as price increases:
\section*{Relative change (\%) in demand
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0194.jpg?height=153&width=979&top_left_y=123&top_left_x=235)
The formula for the elasticity of demand uses the Greek letter nu ( \(\eta\) ):
\[
\eta=\frac{\left(Q_{1}-Q_{0}\right) /\left(Q_{1}+Q_{0}\right)}{\left(P_{1}-P_{0}\right) /\left(P_{1}+P_{0}\right)}
\]
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0194.jpg?height=370&width=407&top_left_y=695&top_left_x=63)
(a)
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0194.jpg?height=366&width=411&top_left_y=697&top_left_x=509)
(b)
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0194.jpg?height=368&width=461&top_left_y=696&top_left_x=930)
(c)
FIGURE 2.13 Demand elasticity. (a) Relatively elastic. (b) Relatively inelastic. (c) Normal market.
where \(Q_{0}\) is the starting quantity and \(P_{0}\) is the starting price. We will take another look at this formula in
Chapter 12 , where we replace quantity with trading volume.
A market that always consumes the same amount of a product, regardless of price, is called inelastic; as price rises, the demand remains the same and \(E_{D}\) is
negatively very small. An elastic market is just the opposite. As demand increases, price remains the same and \(E_{D}\) is negatively very large. Figure 2.13 shows the
demand curve for various levels of demand elasticity.
If supply increases for a product that has been in short supply for many years, consumer purchasing habits will require time to adjust. The demand elasticity will gradually shift from relatively inelastic (Figure 2.13b) to relatively elastic (Figure 2.13a).
\section*{Supply}
Figure 2.14a shows that, as price increases, the supplier will respond by offering greater amounts of the product. Figure 2.14b shows the full range of the supply curve. At low levels, below production costs, there is a nominal supply by those producers who must maintain operations due to high fixed costs and difficulty restarting after a shutdown (as in mining). At high price levels, supply is erratic. There may be insufficient supply in the short term, followed by the appearance of new supplies or substitutes, as in the case of a location shortage. When there is a shortage of orange juice, South American countries are happy to fill the demand; when there is an oil disruption, other OPEC nations will increase production. In most cases, however, it is reduced demand that brings price down.
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0196.jpg?height=635&width=663&top_left_y=58&top_left_x=64)
(a)
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0196.jpg?height=627&width=655&top_left_y=68&top_left_x=738)
(b)
FIGURE 2.14 Supply-price relationship. (a) Shift in supply. (b) Supply curve, including extremes.
\section*{Elasticity of Supply}
The elasticity of supply \(E_{S}\) is the relationship between the change in supply and the change in price:
\[
E_{S}=\frac{\text { Relative change }(\%) \text { in supply }}{\text { Relative change }(\%) \text { in price }}
\]
The elasticity of supply, the counterpart of demand elasticity, is a positive number because price and quantity move in the same direction at the same time. There are three extreme cases of elasticity of supply, shown in Figure 2.15.3
1. Perfectly elastic, where supply is infinite at any one price
2. Perfectly inelastic, where only one quantity can be supplied
3. Unit elasticity, which graphically is shown as a linear supply curve coming from the origin
Price
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0197.jpg?height=1132&width=1327&top_left_y=399&top_left_x=63)
FIGURE 2.15 The three cases of elasticity of supply.
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0198.jpg?height=909&width=918&top_left_y=64&top_left_x=66)
\section*{Quantity (Demand)}
FIGURE 2.16 Equilibrium with shifting supply.
\section*{Equilibrium}
The demand for a product and the supply of that product cross at a point of equilibrium. The current price of any product, or any security, represents the point of equilibrium for that product at that moment in time, essentially the netting of all information. Figure 2.16 shows a constant demand line \(D\) and a shifting supply, increasing to the right from \(S\) to \(S^{\prime}\).
The demand line \(D\) and the original supply line \(S\) meet at the equilibrium price \(P\); after the increase in supply, the
supply line shifts to \(S^{\prime}\). The point of equilibrium \(P^{\prime}\) represents a lower price, the consequence of larger supply with unchanged demand. Because supply and demand each have varying elasticities and are best represented by curves, the point of equilibrium can shift in any direction in a market with changing factors.
Equilibrium will be an important concept in developing trading strategies. Although the supply-and-demand balance may not be calculated, in practical terms equilibrium is a balance between buyers and sellers, a price level at which everyone is willing to trade, although not always happy to do so at that price. Equilibrium is associated with lower volatility and often lower volume because the urgency to buy or sell has been removed. Imbalance in the supply-demand-price relationship causes increased volatility. Readers interested in a practical representation of equilibrium, or price-value relationships, should study "Price Distribution Systems" in "Steidlmayer's Market Profile," Chapter 18.
\section*{Building a Econometric Model}
An econometric model can be created to explain or forecast price changes. Most models explain rather than forecast. Explanatory models analyze sets of data at concurrent times; that is, they look for relationships between multiple factors and their effect on price at the same moment in time. They can also look for causal, or lagged relationships, where prices respond to other factors after one or more days. It is possible to use the explanatory model to determine the normal price at a particular moment. Although not considered forecasting,
any variation in the actual market price from the normal or expected price could present a trading opportunity. This is similar to the concept of buying an undervalued stock.
There is a lot of similarity between the methods of creating a fundamental model and an algorithmic one. An analytic approach selects the factors and specifies the relationships in advance. Tests are then performed on the data to verify the premise. Alternatively, models are refined by fitting the data, using regression analysis or some mass testing process, which applies a broad selection of variables and weighting factors to find the best fit. These models, created with perfect hindsight, are less likely to be successful at forecasting future price levels. Even an analytic approach that is subsequently fine-tuned could be in danger of losing its forecasting ability. Construction of econometric models can suffer the same problems as optimization discussed in Chapter 21. As we will see throughout this book, simpler is often better.
The factors that comprise a model can be both numerous and difficult to obtain. It will be easier to find intramarket relationships, where the data is both available and timely, but global factors have become a major part of price movement since the mid-1970s and will be more difficult to incorporate. In addition, the change in value of the U.S. dollar and the volatility of interest rates have had far greater influence on price than some of the "normal" fundamental factors for many commodities. Companies with high debt may find the price fluctuations in their stock are larger due to interest
rate changes than increases or decreases in revenues. Be aware that factors change over time.
\section*{A Fundamental Model}
Models that explain price movements must be constructed from the primary factors of supply and demand. A simple example for estimating the price of fall potatoes \({ }^{4}\) is:
\[
P / P P I=a+b S+c D
\]
where
\(P=\) the average price of fall potatoes received by farmers
\(P P I=\) the Producer Price Index
\(S=\) the apparent domestic free supply (production less exports and diversions)
\(D=\) the estimated deliverable supply
\(a, b,=\) constants determined by regression analysis and \(c\)
This model implies that consumption must be constant (i.e., inelastic demand); demand factors are only implicitly included in the estimated deliverable supply. Exports and diversion represent a small part of the total production. The use of the PPI gives the results in relative terms based on whether the index was used as an inflator or deflator of price.
A general model, presented by Weymar, 5 may be written
as three behavior-based equations and one identity:
Consumption
\[
C_{t}=f_{C}\left(P_{t}, P_{t}^{t}\right)+e_{C_{t}}
\]
Production
\[
H_{t}=f_{H}\left(P_{t}, P_{t}^{L}\right)+e_{H_{t}}
\]
Inventory
\[
I_{t}=I_{t-1}+H_{t}-C_{t}
\]
Supply of storage
\[
P_{t}^{\prime}-P_{t}=f_{p}\left(I_{t}\right)+e_{p}
\]
where
\(C=\) the consumption
\(P=\) the price
\(P^{\mathrm{L}}=\) the lagged price
\(H=\) the production (harvest)
\(I=\) the inventory
\(P^{\prime}=\) the expected price at some point in the future \(e=\) the corresponding error factor
The first two equations show that both demand and supply depend on current and/or lagged prices, the traditional macroeconomic theory; production and
consumption are therefore dependent on past prices. The third equation, inventory level, is simply the total of previous inventories, plus new production, less current consumption. The last equation, supply of storage, demonstrates that people are willing to carry larger inventories if they expect prices to increase substantially. The inventory function itself, the third equation, is composed of two separate relationships: manufacturers' inventories and speculators' inventories. Each reacts differently to expected price change.
\section*{Changing Factors}
Although the PPI was always used as the component of inflation in forecasting prices, the value of the U.S. dollar was not always considered. Currency values have taken on more significance after mid-1970s when many countries began dropping their gold standard. The value of a currency is now based on the health of the economy as measured by production output and inflation, among other factors.
Wheat is a good example for showing the impact of these changes. Even though United States wheat is quoted in dollars, the price of wheat reflects the world value - that is, what other countries are willing to pay. Wheat is fungible; in other words, a country in need will buy from any source with the lowest price, after converting the seller's currency to the buyer's currency, and that keeps prices competitive.
We will limit our analysis to the impact of inflation and currency changes on the price of wheat. Figure 2.17
shows the monthly price of cash wheat, along with the PPI and the U.S. dollar index (DX). The dollar index shows the relative value of the U.S. dollar; therefore, a decline in DX indicates a weaker U.S. dollar. Both the PPI and DX have been indexed to begin in 1978 with the value of 100 .
In Figure 2.17 the PPI triples from 1.0 to 3.0 while the U.S. dollar drops by about \(60 \%\). At the same time wheat prices rise \(50 \%\) from 100 to about 150 (the cash price from \(\$ 3.35\) to \(\$ 5.39\) ). If we are only concerned with the big picture, the macro factors rather than the seasonality of price, then the rise in wheat prices over this 40 -year interval can be explained by either the PPI or the DX. Inflation, represented by the PPI, would cause wheat prices to rise, and the lower value of the dollar would also cause a rise so that wheat would seek the international value.
If we divide the price of wheat by the PPI, we get the net buying power of the farmer, which has now dropped by 50\% since 1978. This can be seen in Figure 2.18. Because farmers have steadily improved their yields, inflation and a weaker dollar are the only reasons why prices are not \(50 \%\) lower.
Wheat prices with inflation components
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0205.jpg?height=709&width=1339&top_left_y=130&top_left_x=61)
FIGURE 2.17 Cash wheat with the PPI and dollar index (DX), from 1978 through July 2018.
\section*{Effect of inflation on wheat prices}
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0205.jpg?height=502&width=1327&top_left_y=1150&top_left_x=63)
—Wheat \((\mathrm{X})\) —W/PPI \(\quad \mathrm{WxDX}\)
FIGURE 2.18 Wheat prices adjusted for PPI and Dollar Index (DX).
If we want to see the effect of seasonality, or supply and
demand, those factors that cause wheat prices to lose \(75 \%\) of its value or gain \(100 \%\), we need to remove the effects of inflation and the changing dollar first, so that they do not distort the results. This will be discussed with examples in Chapter 10, "Seasonality and Calendar Patterns."
\section*{Economic Reports}
Economic reports are released nearly every day. Based on the health of the nation, investors' focus can shift from one report to another. Since 2008 the focus has been on the employment data, the ultimate solution to recovery, and then Federal Reserve policy regarding raising interest rates. Other relevant data are the GDP, a measure of that recovery, and of less importance, housing, consumer confidence, and various manufacturing data. The Leading Economic Index (LEI), released by the Conference Board each month, tries to anticipate the direction of the economy about six months ahead based on:
- Average weekly hours, manufacturing
- Average weekly initial claims for unemployment insurance
Manufacturers' new orders, consumer goods and materials
- Index of supplier deliveries - vendor performance Manufacturers' new orders, nondefense capital goods
- Building permits, new private housing units
- Stock prices, 500 common stocks
Money supply, M2
Interest rate spread, 10-year Treasury bonds less Federal Funds
Index of consumer expectations
Most of these seem reasonable, but the weighting of them is not clear. It has been said that the direction of the stock market plays a relatively large part in the index.
Can these and other indicators be used for trading? Are they timely or are the expectations of their impact already in the market even before the reports are released? With many reports, the market anticipates the numbers. If unemployment was expected to increase, then the stock market tends to sell off ahead of the report, or if economists anticipate the Fed lowering rates, then the yield curve will adjust to that expectation ahead of the announcement. Therefore, it is the difference between the expectation and the actual report that moves the market, and only secondarily is it the actual numbers released. For example, if the GDP was expected to rise from \(3.5 \%\) to \(4.0 \%\) and the actual number came in at \(3.6 \%\), the market would sell off. But then it would rally again because \(3.6 \%\) is still a good number indicating growth. While large, unexpected changes move the market, the cumulative effect of small changes could also be significant.
Ruggiero has quantified the significance of some of these indicators, concentrating on predicting the direction of yields, which is key to much of the financial market price
moves: \(\underline{6}\)
\section*{Interest rates:}
\section*{Rate of Inflation \\ Yield}
\section*{Inflation Yield Oscillator \((I Y O)=R-\bar{R}\)}
where Yield is the 3 -month Treasury bill and \(\bar{R}\) is the 20-day average of the ratio, \(R\).
- If \((R<0.2\) or \(I Y O<0)\) and Yield \(_{t}>\) Yield \(_{t-3 \mathrm{mo}}\), then rates will rise.
- If \((R>0.3\) or \(I Y O>0.5)\) and Yield \(_{t}<\) Yield \(_{t-3 \mathrm{mo}}\), then rates will fall.
\section*{Money Supply:}
Using monthly data for \(M 2\) and the 3 -month Treasury bill yields, where \(m\) is the current month:
If \(\left(M 2_{m}-M 2_{m-1}\right)>\left(M 2_{m}-M 2_{m-6}\right)\) and Yield \(_{t}>\) Yield \(_{t-11 \mathrm{mo}}\), then rates will rise.
If \(\left(M 2_{m}-M 2_{m-1}\right)<\left(M 2_{m}-M 2_{m-6}\right)\) and Yield \(_{t}<\) Yield \(_{t-11 \mathrm{mo}}\), then rates will fall.
\section*{Consumer Sentiment:}
Using the University of Michigan's Consumer Sentiment Survey (CS), and where \(m\) is the month it is released:
If \(C S_{m}>C S_{m-12}\) and \(C S_{m}>C S_{m-11}\) and Yield \(_{t}>\) Yield \(_{t-4 \mathrm{mo}}\), then rates will rise.
If \(C S_{m}<C S_{m-12}\) and \(C S_{m}<C S_{m-11}\) and Yield \(_{t}<\) Yield \(_{t-4 \mathrm{mo}}\), then rates will fall.
\section*{Unemployment Claims:}
Using monthly unemployment claims (UC) released on the first Friday of each month:
If \(U C_{m}<U C_{m-11}\) and \(U C_{m}>U C_{m-14}\), then rates will rise.
If \(U C_{m}>U C_{m-11}\) and \(U C_{m}<U C_{m-14}\), then rates will fall.
The big picture of price direction is very important, and an accurate forecast can greatly improve results. Using fundamental data in a systematic way is perfectly consistent with other algorithmic approaches.
\section*{NOTES}
1 This and other very clear explanations of returns can be found in Peter L. Bernstein, The Portable MBA in Investment (New York: John Wiley \& Sons, 1995).
2 Further explanations and applications of Markov chains can be found on the Internet by searching for "Markov chains in finance."
3 See
http://www.economicsonline.co.uk/Competitive mar
January 20, 2018
4 J. D. Schwager, "A Trader's Guide to Analyzing the Potato Futures Market," 1981 Commodity Yearbook (New York: Commodity Research Bureau).
5 F. H. Weymar, The Dynamics of the World Cocoa Market (Cambridge, MA: MIT Press, 1968).
6 Murray A. Ruggiero, Jr., "Fundamentals Pave Way to Predicting Interest Rates," Futures (September 1996).
\section*{CHAPTER 3}
\section*{Charting}
It is very likely that all trading systems began with a price chart, and we come back to a chart whenever we want a clear view of where the market is going. Nowhere can a picture be more valuable than in price forecasting. Elaborate theories and complex formulas may ultimately be successful, but the loss of perspective is easily corrected with a simple chart. We should remember the investor who, anxious after a long technical presentation by a research analyst, could only blurt out, "But is it going up or down?" Even with the most sophisticated market strategies, the past buy and sell signals should be seen on a chart. The appearance of an odd trade can save you a lot of aggravation and money.
Through the mid-1980s technical analysis was considered only as chart interpretation. In the equities industry that perception is still strong. Most traders begin as chartists, and many return to it or use it even while using other methods. William L. Jiler, a great trader and founder of Commodity Research Bureau, wrote:
One of the most significant and intriguing concepts derived from intensive chart studies by this writer is that of characterization, or habit. Generally speaking, charts of the same commodity tend to have similar pattern sequences which may be
different from those of another commodity. In other words, charts of one particular commodity may appear to have an identity or a character peculiar to that commodity. For example, cotton charts display many round tops and bottoms, and even a series of these constructions, which are seldom observed in soybeans and wheat. The examination of soybean charts over the years reveals that triangles are especially favored. Head and shoulders formations abound throughout the wheat charts. All commodities seem to favor certain behavior patterns. 1
The financial markets have equally unique personalities. The S\&P traditionally makes new highs, then immediately falls back; it has fast, short-lived drops and slower, steadier gains. Currencies show intermediate trends bounded by noticeable support and resistance levels, the result of threats of Central Bank intervention, while interest rates have long-term trends.
Charting remains the most popular and practical form for evaluating price movement, and numerous works have been written on methods of interpretation. This chapter will summarize some of the traditional approaches to charting and the trading rules normally associated with these patterns. Some conclusions are drawn as to what is most likely to work and why. The next chapter covers systems that are derived from these patterns and are designed to take advantage of behavioral patterns found in charts.
\section*{FINDING CONSISTENT PATTERNS}
A price chart is often considered a representation of human behavior. The goal of any chart analyst is to find consistent, reliable, and logical patterns that can be used to predict price movement. In the classic approaches to charting, there are consolidations, trend channels, topand-bottom formations, and a multitude of other
patterns that are created by the repeated action of large groups of people. The most important of all the chart patterns is the trendline.
Computer programs can now identify chart patterns; but only Bulkowski's Encyclopedia of Chart Patterns² shows a comprehensive analysis of chart formations. In all fairness, there can be numerous valid interpretations of the same chart. In order to identify a chart formation, it is first necessary to select the data frequency (for example, daily or weekly), then the starting date and a time horizon (long-term or short-term). Given the wide range of choices, it should be surprising that any two analysts see the same patterns at the same time.
Chart analysis can be self-fulfilling. Novice speculators approach the problem with great enthusiasm and often some rigidity in an effort to follow the rules. They will sell double and triple tops, buy breakouts, and generally do everything to propagate the survival of standard chart formations. Because of its following, it is wise to know the most popular techniques, if only as a defensive measure. Chapter 4 will review some of the attempts to turn these patterns into trading systems.
\section*{What Causes Chart Patterns?}
Speculators have habits that, taken in large numbers, cause recognizable chart patterns. The typical screen trader, or an investor placing her own orders, will usually choose an even number - for example, buy Microsoft at \(\$ 74.00\), rather than at \(\$ 74.15\). If even-dollar values are not used, then \(50 \$\) and \(25 \$\) are the next most likely increments, in that order. And, as the share prices get higher, the increments get farther apart. When Berkshire Hathaway (BRK-A) was trading at \$278,000 per share, placing an order at a \(\$ 100\) increment would seem very precise. In futures trading the same is true. There are far more orders placed in the S\&P Index at 2530.00 than at 2529.80 , or 10-year Treasury notes at \(155^{16} / 32\) instead of \(12519 / 32\).
It is said that the public always enters into the bull markets at the wrong time. When the news carries stories of dangerously low oil supplies, a new cancer treatment drug, or a drought in the corn belt, the infrequent speculator enters too late in what W. D. Gann calls the grand rush, causing the final runaway move before the collapse or sell-off; this behavior is easily seen on a chart. Gann also talks of lost motion, the effect of momentum that carries prices slightly past its goal. Professional traders recognize that a fast, volatile price may move as much as \(10 \%\) farther than its objective. A downward swing in the euro/dollar from 1.3000 to a support level of 1.1000 could overshoot the bottom by 0.0100 without being considered significant.
The behavioral aspects of prices appear rational. In the
great bull markets, the repeated price patterns that defy random movement are indications of the effects of mass psychology. The classic source of information on this topic is Mackay's Extraordinary Popular Delusions and the Madness of Crowds, originally published in \(1841 .{ }^{3}\) In the preface to the 1852 edition the author says:
We find that whole communities suddenly fix their minds on one object, and go mad in its pursuit; that millions of people become simultaneously impressed with one delusion....
In 1975, sugar was being rationed in supermarkets at the highest price ever known, 50\$ per pound. The public was so concerned that there would not be enough at any price that they bought and hoarded as much as possible. This extreme case of public demand coincided with the price peak, and shortly afterward the public found itself with an abundant supply of high-priced sugar.
The world stock markets often show acts of mass psychology. While U.S. traders watched at a distance the collapse of the Japanese stock market from its heights of 38,957 at the end of December 1989 to its lows of 7,750 in 2003, a drop of \(80 \%\), they were able to experience their own South Sea Bubble when the NASDAQ 100 fell \(83.5 \%\) from its highs of 4,816 in March 2000 to 795 in October 2002. And, while the subprime crisis has taken years to play out, the unparalleled drop in value of nearly all investments at the same time, September 2008, was clearly an act of investor panic.
Charting is a broad topic. A standard bar chart (or line chart) representing highs and lows can be plotted for
daily, weekly, or monthly intervals in order to smooth out the price movement. Bar charts have been drawn on semilog and exponential scales, 4 where the significance of greater volatility at higher price levels is put into proportion with the quieter movement in the low ranges by using percentage changes. Each variation gives the chartist a different representation of price action. The shape of the chart box and its ratio of height/width will alter interpretations that use angles. Standard charting techniques may draw trendlines at \(45^{\circ}\) or \(30^{\circ}\) angles across the chart; therefore, expanding or compressing a chart on a screen will change the angles. You may be concerned that the principles and rules that govern chart interpretation were based on the early stock market, using averages instead of individual stocks or futures contracts. Edwards and Magee \({ }^{5}\) concluded that "anything whose market value is determined solely by the free interplay of supply and demand" will form the same graphic representation. They say that the aims and psychology of speculators in either a stock or commodity environment would be essentially the same, and that the effects of postwar government regulations have caused a "more orderly" market in which these same charting techniques can be used.
\section*{WHAT CAUSES THE MAJOR PRICE MOVES AND TRENDS?}
Prices can move higher for many months or even years, creating a bull market. They can also move down, creating a bear market. Although price moves can be as
short as a few minutes or as long as decades (as happened with interest rates and gold), it is how each chartist defines a "trend" that is most important. Once recognized, the price trend forms a bias for trading decisions that can make the difference between success and failure. The long-term direction of prices is driven by four primary factors:
1. Government policy. When economic policy targets a growth rate of \(4 \%\), and the current growth rate is \(1 \%\), the Federal Reserve (the "Fed" or any central bank) lowers interest rates to encourage growth. Lowering rates stimulates business activity. The Fed raises interest rates and dampens economic activity to control inflation. Changing interest rates has a profound impact on the flow of investment money between countries, on international trade, on the value of currencies, and on business activity.
2. International trade. When the United States imports goods, it pays for it in dollars. That is the same as selling the dollar. It weakens the currency. A country that continually imports more than it exports increases its trade deficit and weakens its currency. A country that increases its exports strengthens its currency and its economy.
3. Supply and demand. A shortage, or anticipated shortage, of any product causes its price to rise. An oversupply of a product results in declining prices. These trends develop as news makes the public aware of the situation. A shortage of a product that cannot be replaced causes a prolonged effect on its
price, although the jump to a higher price may happen quickly.
4. Expectations. If investors think that stock prices will rise, they buy in anticipation. Expectations can lead an economic recovery, although there is no statistical data to support a recovery. Consumer confidence is a good measure of how the public feels about spending. The economy is active when consumer confidence is high. A lack of public confidence following the subprime collapse in 2008 dampened all economic activity and delayed the recovery for years.
\section*{THE BAR CHART AND ITS INTERPRETATION BY CHARLES DOW}
The bar chart, also called the line chart, became known through the theories of Charles H. Dow, who expressed them in the editorials of the Wall Street Journal. Dow first formulated his ideas in 1897 when he created the stock averages in order to have a more consistent measure of price movement for stock groups. After Dow's death in 1902, William P. Hamilton succeeded him and continued the development of his work into the theory that is known today. Today's investors might be interested in just how far our acceptance of charting has come. In the 1920s, a New York newspaper was reported to have written:
One leading banker deplores the growing use of charts by professional stock traders and customers'
men, who, he says, are causing unwarranted market declines by purely mechanical interpretation of a meaningless set of lines. It is impossible, he contends, to figure values by plotting prices actually based on supply and demand; but, he adds, if too many persons play with the same set of charts, they tend to create the very unbalanced supply and demand which upsets market trends. In his opinion, all charts should be confiscated, piled at the intersection of Broad and Wall and burned with much shouting and rejoicing. \(\underline{6}\)
This is remarkably similar to the comments about program trading that followed the stock market plunge in October 1987, where it was condemned as the cause of the crash. In 2011 we again have comments about highfrequency trading "manipulating" the markets, and in Europe they temporarily banned short sales to stem volatility in the equity index markets. Of course, volatility continued to be high, but liquidity dropped. It's politics, not logic.
Charting has become an integral part of trading. The earliest authoritative works on chart analysis are long out of print but the essential material has been recounted in newer publications. If, however, a copy should cross your path, read the original Dow Theory by Robert Rhea; \({ }^{7}\) most of all, read Richard W. Schabacker's outstanding work Stock Market Theory and Practice, which is probably the basis for most subsequent texts on the use of the stock market for investment or speculation. Other publications were listed in Chapter 1
under "Background Material."
Automation has also come to charting, including the Dow Theory. Because these programs are constantly getting better, anyone interested should search the Internet for "Dow Theory Software."
\section*{The Dow Theory}
The Dow Theory \({ }^{8}\) is still the foundation of chart interpretation and applies to a wide variety of investment vehicles. It is part investor psychology supported by chart analysis. When you hear "the market has entered bear territory," they refer to Dow's decline of \(20 \%\) from the highs. It is impressive that it has withstood the tests of more than 100 years. Charles Dow was the first to create an index of similar stocks - the Industrials and the Railroads, although today's components are very different from those in 1897. The purpose of the index was to smooth out erratic price movement caused by less active stocks. In turn, it made price patterns more reliable.
Dow's work can be viewed in two parts: his theory of price movement, and his method of implementation.
Both are inseparable to its success. Dow determined that the stock market moved as the ocean, in three waves, called primary, secondary, and daily fluctuations. The major advances and declines, lasting for extended periods, were compared to the tides. These tides were subject to secondary reactions called waves, and the waves were composed of ripples. Readers familiar with other charting methods will recognize these patterns as
the foundation of Elliott Wave analysis. In 1897 Dow published two sets of averages in the Wall Street Journal, the Industrials and the Railroads, in order to advance his ideas. These are now the Dow Jones Industrial Average and the Transportation Index. Figure 3.1 shows more than 40 years of history for the three most important averages: the Industrials, the Transportation, and the Utilities.
\section*{The Basic Tenets of the Dow Theory}
There are six fundamental principles of the Dow Theory that fully explain its operation.
\section*{1. The Averages Discount Everything (Except "Acts of God')}
At the turn of the twentieth century there was considerably less liquidity and regulation in the market; therefore, manipulation was common. By creating averages, Dow could reduce the impact of "unusual" moves in a single stock - that is, those moves that seemed unreasonably large or out of character with the rest of the market. Dow's Industrials is the average share value of 30 companies (adjusted for splits); therefore, an odd move in one of those prices would only be \(1 / 30\) of the total. The average also represented far greater combined liquidity than a single stock. The only large moves that would appear on a chart of the average price were price shocks to the entire system or "acts of God."
\section*{2. Classifications of Trends}
There are three classifications of trends: primary trends, secondary swings, and minor day-to-day fluctuations. The primary trend, also called the wave, is the trend on a grand scale. When there is a wave of rising prices we have a bull market; when prices are declining there is a bear market. A wave is a major move over an extended period of time, generally measured in years. A clear bull market can be seen in the previous Dow charts (Figure 3.1) throughout all of the 1990s ending at the beginning of 2000 , and from late 2008 to 2018.
\section*{Bull and Bear Market Formation (for Monthly or Weekly Prices)}
The beginning of a bull or bear market is determined using a breakout signal, shown in Figure 3.2, based on large swings in the index value (more about breakout signals can be found in Chapter 5). The bull market signal occurs at the point where prices confirm the uptrend by moving above the high of the previous rally. The bear market signal occurs on a break below the low of the previous decline.
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0223.jpg?height=639&width=1327&top_left_y=66&top_left_x=63)
FIGURE 3.1 Dow Theory has been adapted to use the current versions of the major indices: the Industrials (top panel), the Utilities (center panel), and the Transportation Index (bottom panel). Although these indices represent different aspects of the economy, they have become highly correlated. Data from 1978-July 2018.
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0223.jpg?height=641&width=1326&top_left_y=1175&top_left_x=64)
FIGURE 3.2 Bull and bear market signals are traditional breakout signals, but on a larger scale.
Because a breakout can occur at many levels, it is commonly accepted that a bull or bear market begins when prices reverse \(20 \%\) from their lows or highs. In order to get an upward breakout signal needed for a new bull market, we want to look at support and resistance levels (the previous intermediate high and low prices) separated by approximately a \(10 \%\) price move based on the index value. This type of signal is called swing trading. At the top of Figure 3.4, the horizontal broken line should occur at about \(20 \%\) below the absolute price highs, and the second peak should be approximately \(10 \%\) higher than the previous swing low.
While both bull and bear markets start with a price reversal of \(20 \%, 20 \%\) from the highs can be much greater than \(20 \%\) from the lows. For example, in the selloff in September 2008, the S\&P was measured from its high of about 14,000 in late 2007. A decline to 11,200, or 2,80o points, triggered the bear market. In the first quarter of 2009 the S\&P reached its lows of about 6,500. A new bull market began at 7,800, a rally of only 1,300 points. Then the points needed to start a bull market was only \(46 \%\) of the bear market trigger, showing a significant bias toward bull markets.
\section*{Bull and Bear Market Phases}
In Dow Theory the primary trends develop in three distinct phases, each characterized by investor action. These phases can be seen in the NASDAQ bull market of the late 1990s and the subsequent bear market (Figure \(3.3)\).
\section*{The Bull Market}
- Phase 1: Accumulation. Cautious investors select only the safest and best-valued stocks to buy. They limit purchases to deeply discounted stocks at depressed price levels and consider only primary services and industries, most often buying utilities and high yielding stocks.
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0225.jpg?height=679&width=1218&top_left_y=545&top_left_x=174)
FIGURE 3.3 NASDAQ from April 1998 through June 2002. A clear example of a bull and bear market with a classic pattern of volume.
- Phase 2: Increasing volume. Greater investor participation causes increasing volume, rising prices, and an improving economic picture. A broader range of investors enter the market convinced that the market has seen its lows. Secondary stocks become popular.
- Phase 3: Final explosive move. Excessive speculation and an elated general population result
in a final explosive move. Everyone is talking about the stock market; people who have never considered investing now enter the market. The public is convinced that profits will continue and buying becomes indiscriminate. Investors borrow to buy stocks. Value is unimportant because prices keep rising. Earnings and dividends are ignored.
\section*{The Bear Market}
Phase 1: Distribution. Professionals begin selling while the public is in the final stages of buying. Stocks are distributed from stronger to weaker hands. The change of ownership is facilitated by less experienced investors who enter the bull market too late and pay what turns out to be unreasonably high prices.
Phase 2: Panic. Prices decline faster than at any time during the bull market and fail to rally. The news media constantly talk about the end of the bull market. The public sees an urgency to liquidate. Investors who borrowed money to invest late in the bull market, trading on margin or leverage, now speed up the decline. Some are forced to liquidate because their portfolio value has dropped below the critical point. The divesting of stocks takes on a sense of panic.
Phase 3: Lack of buying interest. The final phase in the sustained erosion of prices results from the lack of buying by the public. After taking losses, investors are not interested in buying even the strongest
companies at extremely undervalued prices. All news is viewed as negative. Pessimism prevails. It is the summers of 2002 and 2009.
\section*{Schabacker's Rules}
Schabacker also had a simple guideline to identify the end of both a bull and a bear market. \({ }^{9}\)
End of a bull market
1. Trading volume increases sharply.
2. Popular stocks advance significantly while some other companies collapse.
3. Interest rates are high.
4. Stocks become a popular topic of conversation.
5. Warnings about an overheated stock market appear on the news.
End of a bear market
1. Trading volume is low.
2. Commodity prices have declined.
3. Interest rates have declined.
4. Corporate earnings are low.
5. Stock prices have been steadily declining and bad news is everywhere.
Secondary Trends (Secondary Reactions Using Weekly or Daily Prices)
Secondary reactions are also called corrections or
recoveries and can be identified using smaller swing values. Corrections in bull markets are attributed to the prudent investor taking profits (a positive spin). This profit phase can have an erratic start but is considered complete when prices rise above the previous secondary rally. The bull market is back in force when a new high occurs (see Figure 3.4), the point where a swing trader will enter a new long position. Lines may be substituted for secondary movements. In Dow Theory, a line is a sideways movement lasting from two to three weeks to months, trading in about a \(5 \%\) range.
\section*{Characteristics of a Secondary Reaction}
- There are a number of clear downswings.
- The movement is more rapid in the reversal (downward during a bull market) than in the primary move.
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0228.jpg?height=768&width=1232&top_left_y=1156&top_left_x=161)
FIGURE 3.4 Secondary trends and reactions. A reaction is a smaller swing in prices that ends when a new high reinstates the bull market.
They last from three weeks to three months.
If the volume during the price drop is equal to or greater than the volume just prior to the decline, then a bear market is likely. If volume declines during the drop, then a rally is expected.
\section*{Minor Trends (Using Daily Prices)}
In Dow Theory, minor trends are the only trends that can be manipulated. They are usually under six days in duration. Because they are considered market noise, not affecting the major price direction, they are seen as less important moves.
\section*{3. The Principle of Confirmation}
For a bull or bear market to exist, two of the three major averages (the Industrials, the Transportation, and the Utilities) must confirm the direction. When first created, the Dow Theory required the confirmation of only the Utilities and the Railroads. Although much has changed since Dow devised this rule, the purpose is to assure that the bull or bear market is a widespread economic phenomenon and not a narrower industry-related event.
\section*{4. Volume Goes with the Trend}
Volume confirms the price move. Volume must increase as the trend develops, whether it is a bull or bear market.
It is greatest at the peak of a bull market or during the panic phase of a bear market.
\section*{5. Only Closing Prices Are Used}
Dow had a strong belief that the closing price each day was the most important price. It was the point of evening-up. Not only do day traders liquidate all of their positions before the close of trading, reversing their earlier impact, but many investors and hedge funds execute at the close. Although liquidity was a problem during Dow's time, even now, a large order placed at a quiet time will move prices. There is always high volume at the close of trading, when investors with different objectives come together to decide the fair price.
Some traders believe that there is no closing price anymore, given the access to 24-hour trading; however, that is not yet true. Every market has a settlement price. This is usually at the end of the primary trading session (previously the pit or open outcry session). The settlement price is necessary to reconcile all accounts, post profits and losses, and trigger needed margin calls. Banks could not operate without an official closing time and settlement price.
\section*{6. The Trend Persists}
A trend should be assumed to continue in effect until its reversal has been signaled. This rule forms the basis of all trend-following. It considers the trend as a long-term price move, and positions are entered only in the trend direction. The Dow Theory does not express expectations
of how long a trend will continue. It simply follows the trend until a signal occurs that indicates a change of direction.
\section*{Interpreting Today's S\&P Using Dow Theory}
After 120 years, can the Dow Theory correctly interpret the major market index? Figure 3.5 shows the S\&P 500, using continuous, back-adjusted futures prices, from 1994 through the middle of 2003. The sustained bull market that began after 1987, peaks at the beginning of 2000. Volume had been higher during the bull market, as Dow had foreseen, although volume does not peak at the top of the market; it starts to decline noticeably about three months before the top. We will see in the study of volume that volume spikes occur at extremes, but a longer-term volume confirmation is very important. Declining volume at the beginning of 2000 signals a divergence in sentiment that foretells the end of the bull market. Volatility increases toward the end of the uptrend, another predictable pattern. The price move from 1994 through the peak in 2000 shows both Phase 2 and Phase 3 of the bull market.
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0232.jpg?height=853&width=1327&top_left_y=62&top_left_x=63)
FIGURE 3.5 Dow Theory applied to the S\&P. Most of Dow's principles apply to the current marketplace, but some experience and interpretation is necessary.
The price decline in the third quarter of 1998 addresses the issue: Are there exceptions to the 20\% rule that changes a bull market to a bear market? A 20\% drop from a high of 1400 is 1120 , very close to the point where prices stopped their decline and reversed. Dow never used the number \(20 \%\), and analysts would claim that, because of the speed of the decline and the quick recovery, this was not a bear market signal. Some of these decisions require judgment, some experience, and just a little bit of hindsight. Realistically, we cannot expect every Dow signal to be correct, just as we cannot expect to be profitable on every trade. Long-term success is the real goal.
\section*{Transition from bull to bear in the S\&P. Looking} again for a \(20 \%\) reversal from the S\&P highs of 1675, we target the price of 1340 . This time, volume has declined from its highs and continues to decline quickly. From the second quarter of 2000 through the first quarter of 2001 prices fall sharply, giving back the gains from mid-1997, nearly 3 years. When prices break below 1300 they confirm the previous low at the end of 2000, making it clear that a bear market is underway.
During the subsequent decline, prices attempted to rally. There are four cases of a sharp "V" bottom followed by a significant move higher. After the low at 940 at the end of September 2001, prices move to about 1180, above the \(20 \%\) reversal of 1128 . However, after the first reversal to 1075 prices fail to move back above the highs, finally breaking below 1180 and continuing on to make new lows. Although the recovery exceeded 20\%, the lack of a confirming breakout can be interpreted as a bull market failure. Not every pattern falls neatly into a rule.
We come to the last year of the S\&P chart, where prices have resisted going below 850, and now appear to be moving above the level of 970 and about to confirm a bullish breakout. Is it the end of the bear market? Volume was the highest at the two lowest price spikes, and then declined. Many stocks are undervalued, according to experts, yet those same experts see no reason for the market to rally further because the recent rise has already reflected reasonable expectations for profits and growth in the next year. Who would be correct, Charles Dow or the "talking heads" of the financial news networks? It was Dow.
\section*{Dow Theory and Futures Markets}
The principles of the Dow Theory are simple to understand. Major price moves are most important when they are confirmed by volume. They follow a pattern created by investor action that seems to be universal when seen from a distance.
The primary features of the Dow Theory should hold for any highly liquid, actively traded market. This applies to index futures and most financial futures markets, as well as foreign exchange, which have enormous volume and reflect major economic trends. Because of the variety of products traded as futures and ETFs, an investor may be able to apply Dow's principle of confirmation using any two related financial markets, such as the S\&P Index, 10year Treasury notes, or the U.S. dollar index, in the same way that the Industrials, Utilities, and Transportation indices were used for stocks. A strong economic trend often begins with interest rate policy, which affects the value of the currency, and is intended to stimulate the stock market (lowering rates) or dampen excess investment (raising rates); therefore, confirmation from these three sectors is reasonable. When trading in futures, the nearby contract (the one closest to delivery) is most often used; however, the total volume of all futures contracts traded for each market must be used rather than volume for a single contract.
\section*{CHART FORMATIONS}
While Dow Theory is a macro view of price movement, more often chart analysis deals with much shorter time
periods. Most traders hold positions from a few days to a few weeks; however, they apply the same patterns to both shorter or longer intervals.
Chart analysis uses straight lines and geometric formations. It analyzes volume only in the most general terms of advancing and declining phases. Chart patterns can be classified into the broad groups of:
- Trendlines and channels
- One-day patterns
- Continuation patterns
- Accumulation and distribution (tops and bottoms)
■ Retracements
\(■\) Other patterns
Of these, the most important is the trendline.
\section*{The Trend in Retrospect}
It is easier to see the trend on a chart after it has occurred. Trying to identify the trend as it is developing is much more difficult. The monthly chart in Figure 3.6 shows a sustained upward trend, but there is a slowing of that trend toward the end. Will the upward trend continue? Will prices begin a downward trend? Will they move sideways? The purpose of charting is to apply tools that provide the best chance of identifying the future direction of prices. If wrong, these tools also control the size of the loss.
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0236.jpg?height=835&width=1327&top_left_y=59&top_left_x=63)
FIGURE 3.6 The trend is easier to see after it has occurred. While the upward trend is clear, are prices going to continue higher, or is this the end of the trend?
The time interval is a key element when identifying a trend. Weekly and monthly charts show the major trends more clearly than daily charts. Longer-term charts remove much of the noise that interferes with seeing the bigger picture. Many chartists start by evaluating a weekly or monthly chart, then apply the lines and values developed on those charts to a daily chart. The weekly chart provides the direction of trades while the daily chart, or even a 15-minute chart, is used for timing entries and exits. Further discussion of this can be found in Chapter 19.
\section*{TRENDLINES}
The trendline determines the current direction of price movement, and often identifies at what specific point that direction will change. The trendline is the most popular and recognized tool of chart analysis. Most analysts will agree that the trend is your friend, that is, it is always safer to take a position in the direction of the trend.
- An upward trendline is drawn across the lowest prices in a rising market.
- A downward trendline is drawn across the highest prices in a declining market.
Figure 3.7 shows a classic downward trendline, \(A\), drawn on a chart of Intel. It connects the highest price of \(\$ 22\) with price peaks at \(18.00,16.75\), and 16.15 before ending at 15.50 . When prices move through the trendline heading higher, the downtrend has been penetrated. This may end the downtrend or cause a new downtrend line to be drawn. In this case it was the end of the downtrend, easily seen afterward.
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0238.jpg?height=851&width=1329&top_left_y=63&top_left_x=62)
FIGURE 3.7 Upward and downward trendlines applied to Intel, November 2002 through May 2003.
\section*{Redrawing Trendlines}
Most trendlines are not as long-lived or clear as the downtrend in Intel, which was drawn after the fact. Instead, we will chart the uptrend that follows as it develops. The first uptrend line, \(B\), is drawn when the first reversal shows a second low point. The upward trendline \(B\) is drawn across the lows of points 1 and 2. Although prices do not decline through trendline \(B\), rising prices pull back to points 3 and 4 , well above the trendline. At that point we choose to redraw the upward trendline connecting point 2 with 3 and 4 , forming what appears to be a stronger trendline. Trendlines are considered more important when they touch more points. However, prices move up quickly and we decide
to redraw the trendline connecting points 4 and 5 . It is very common to redraw trendlines as price patterns develop. Care must be taken to draw the lines in a way that touches the most points, although some chart analysts would draw a line that connects points 1 and 5 , crossing through points 2,3 , and 4 , because the final picture seems to represent the dominant upward price pattern. This can be seen as the broken line in Figure 3.7.
One way to automate the upward trendline is to calculate a regression line through prices beginning on the day of the lowest price and ending at the most recent day. Then find the lowest prices away from that regression line and draw another straight line, parallel to the regression line, through that point. A downward breakout of the lower line would be a trend reversal. The opposite would be done for a downtrend.
\section*{Support and Resistance Lines}
When investors agree that the economy is doing well, we get an uptrend. Periods of uncertainty form a sideways price pattern. The top of this pattern is called the
resistance level and the bottom is the support level. Once established, the support and resistance levels become key to identifying whether a trend is still in force. Many traders consider this as important as a break in the trendline.
A horizontal support line is drawn horizontally to the right of the lowest price in a sideways pattern. It is best when drawn through two or more points and may cross above the lowest price if it makes the pattern clear. It
represents a firm price level that has withheld market penetration (or allowed minor penetration). It may be the most significant of all chart lines.
A horizontal resistance line serves the same purpose as the support line and is drawn across the highest highs of the sideways interval. It represents the price that has resisted upward movement. Resistance lines are not normally as clear as support lines because they are associated with higher volatility and erratic price movement. \(\underline{10}\)
In the chart of bond futures prices (Figure 3.8), support line \#1 is drawn across two lows of a sideways period. Resistance \#1 is across four highs just above it. At the beginning of June, prices move through resistance. They then retrace back to the resistance line before moving higher. After the peak support line \#2 is formed. When broken, prices drop to the old resistance line \#1 before rallying and penetrating support \#2 before failing. The big break comes when prices fall through the old support \#1. At the far right, a new resistance \#2 has been formed.
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0240.jpg?height=596&width=1328&top_left_y=1353&top_left_x=65)
FIGURE 3.8 Horizontal support and resistance lines shown on bond futures prices.
\section*{Failed Breakouts}
A price bar that has the high price penetrating upward through resistance but closes lower is considered a failed breakout and confirms the downward move. This can be seen in Figure 3.8, where support \#2 (now acting as a resistance line) is penetrated by the rally in September before moving lower. Failed breakouts can occur at either support or resistance levels. You may choose to raise the resistance line to the high of that failed bar, but most chartists ignore it, keeping the resistance line at its original position.
\section*{Resistance Becomes Support and Support Becomes Resistance}
Horizontal support and resistance lines are strong indicators of change. If prices are moving sideways because investors are unsure of direction, then a move through either support or resistance is usually associated with new information that causes investors to act. Whatever the cause, the market interprets this as a new event. Having moved out of the sideways pattern, prices have a tendency to remain outside that range. If prices have moved higher, then the resistance line becomes a support line. If prices fall below the resistance line, the price move is considered a failed breakout. In Figure 3.8, resistance \(\# 1\) becomes support after the break of support \#2. Traders are looking for a logical place for price to pause and regroup.
\section*{A Trendline Is Also a Support or Resistance Line}
The angled trendlines in Figure 3.7 are also called support and resistance lines. An upward trendline, drawn across the lows, is a bullish support line because it defines the lowest price allowed in order to maintain the upward trend. The downward trendline, drawn across the highs, is a bearish resistance line. Both trendlines and horizontal lines are most important for traders.
\section*{Back-Adjusted Data}
All traders use online services to display charts. They can draw support and resistance lines using various tools supplied by the service and can convert daily data to weekly or monthly with a single click. When looking at prices that go back many years, the analyst must be sure that the older data is not back-adjusted. For example, futures trade in contracts of limited maturity, and are most liquid during the last few months before expiration. Long-term charts put contracts together by backadjusting the prices, so that the older data does not give the actual price at that time, but is altered by accumulated roll difference. Long-term horizontal support and resistance lines will be wrong.
This same problem exists for stocks that have split. The old price that you see on the chart may not be the actual price traded at that time. In the case of Apple, you'll find that the oldest prices are negative. Using those older prices as a guide for support or resistance doesn't make any sense.
\section*{Trading Rules for Trendlines}
Many of the trading rules that follow have been automated and are discussed in the next chapter. They include channel breakouts, buying on pullbacks, and trading in sideways markets. The methods that follow have well-defined rules and often are the basis for the systems in the next chapter. It is easier to understand the systems if you know the reasoning behind them.
The simplest formations to recognize are the most commonly used and the most important: horizontal support and resistance lines, bullish and bearish trendlines, and channels created using those lines. Systematic traders will generate their buy and sell orders directly from their chart analysis. These major chart patterns create the underlying profitability of chart trading; the more complex formations, as we will discuss further, may enhance good performance but cannot compensate for losses resulting from being on the wrong side of the trend. Typical trading rules for trendlines are shown in Figure 3.9.
\section*{Confirming the New Trend Direction}
In actual trading, the price crossing the trendline is not as clear as in Figure 3.9. Most often prices that have been moving higher will cross through the trendline a number of times. The trendline is an important turning point and there may be indecision that is reflected in a sideways price movement before prices reestablish a trend. To deal with this situation, traders may:
Wait one or two days to confirm that prices remain
on the new side of the trendline.
Wait for a reversal after the penetration, then enter a trade in the new trend direction even if the reversal crosses the trendline again.
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0244.jpg?height=885&width=1230&top_left_y=361&top_left_x=160)
FIGURE 3.9 Basic sell and buy signals using trendlines.
- Create a small safety zone (a band or channel) around the trendline and enter the new trade if prices move through the trendline and through the safety zone.
Each of these techniques requires a delay before entering. A delay normally benefits the trader by giving a better entry price; however, if prices move quickly through an upward trendline and do not reverse or slow down, then any delay will result in a worse entry price.
Unfortunately, most of the biggest profits result from breakouts that never pull back. Catching only one of these breakouts can compensate for all the small losses due to false signals. Many professional traders wait for a better entry price but some miss the biggest moves.
\section*{Trading Rules for Horizontal Support and Resistance Levels}
As with angled trendlines, horizontal support and resistance lines show clear points for buying and selling. Also similar to angled trendlines, the horizontal lines become increasingly important when longer time intervals and more points are used to form the lines. The technique for entering trades using horizontal lines is similar to that using trendlines; however, the maximum risk of the trade is clearly defined.
- Buy when prices cross above the horizontal resistance line.
- Sell when prices cross below the horizontal support line.
Once a long position has been entered, it is not closed out until prices cross below the support line. The maximum risk of the trade is the difference between the support and resistance lines. As prices move higher, each swing reversal forms a low from which a new horizontal support line is drawn. After the initial entry, a single low point is most often used to create the horizontal support and raise the level at which the trade will be closed out. Figure 3.10 shows the pattern of horizontal support and resistance lines as the trade develops. For a swing low to
form, prices must reverse upward by more than some threshold number of points or percentage. Not every small reversal qualifies as a swing low.
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0246.jpg?height=762&width=1325&top_left_y=273&top_left_x=62)
FIGURE 3.10 Trading rules for horizontal support and resistance lines.
Note that the first pullback in Figure 3.10 shows prices crossing below the original resistance line. This is a common occurrence, but the original line no longer holds the importance it had before it was broken. While it should provide support for the pullback (a resistance, once broken, becomes a support), it is more important to record the bottom of the new pullback as the support level. After the third support level is drawn, prices rally but then fall back through the third level, at which point the long position is closed out. A short position, if any, is not entered until a new sideways price pattern is established and horizontal support and resistance lines can be drawn across more than one point.
\section*{Separating Directional from Consolidation Patterns}
It is said that markets move sideways about \(80 \%\) of the time, which means that sustained directional breakouts do not occur often, or that most breakouts are false. Classic accumulation and distribution formations, which occur at long-term lows and highs, attempt to recognize evolving changes in market sentiment. Because these formations occur only at extremes, and may extend for a long time, they represent the most obvious consolidation of price movement. Sometimes they take the shape of a rounded bottom or top. This can make it difficult to decide exactly when a breakout will occur. For an investor, the solution is to average in, where smaller positions are entered at fixed intervals as long as the developing formation remains intact.
Most other consolidation formations are best seen in the same way as a simple horizontal sideways pattern, bounded above by a resistance line and below by a support line. If this pattern occurs at low prices, we can expect a breakout upward when the fundamentals change. Prices seem to become less volatile within an extended sideways pattern, especially at low prices, and chartists take this opportunity to redefine the support and resistance levels so that they are narrower.
Breakouts based on these more sensitive lines tend to be less reliable because they may represent a temporary quiet period inside the larger, normal level of market noise; however, there are two distinct camps, one that believes that breakouts are more reliable after a period of low volatility and the other that prefers breakouts associated with high volatility. Some of these situations
are discussed later under volatility breakout systems.
\section*{Creating a Channel with Trendlines}
A channel is formed by a trendline and another line drawn parallel to the trendline enclosing a sustained price move. The width of the channel defines the volatility of the price move and establishes reasonable entry and exit points. Up to now, the trendline has only been used to identify the price direction. A long position is entered when the price crosses a downward trendline moving higher. The trade is held until the price moves below an upward trendline. However, it is more common to have a series of shorter trades based on shorter trendlines. While the biggest profits come from holding one position throughout a sustained trend, a series of shorter trades each has far less risk and is preferred by the active trader. Be aware that trendlines using very little data are essentially analyzing noise and have limited value.
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0249.jpg?height=782&width=1332&top_left_y=51&top_left_x=61)
FIGURE 3.11 Trading a price channel. Once the channel has been drawn, buying is done near the support line and selling near the resistance line.
Before a channel can be formed, the bullish or bearish trendline must be drawn. A clear uptrend line requires at least two, and preferably three or more, major low points on the chart, as shown in Figure 3.11, where points 1, 2, and 3 are used. These points do not have to fall exactly on the line. Once the trendline is drawn, the highest high, point \(B\), can be used to draw another line parallel to the upward trendline. The area in between the two parallel lines is the channel. In an earlier section, "Redrawing Trendlines," a regression line was used as a way of finding the trend and drawing a channel.
In theory, trading a channel is a simple process. We buy as prices approach the support line (in this case the upward trendline), and we sell as prices near the
resistance line. These buy and sell zones should be approximately the bottom and top \(20 \%\) of the channel. Some traders might use point A to define the top of the channel, giving it a better chance of being reached and allowing you to take profits sooner.
If prices continue through the lower trendline after a long position has been set, the trade is exited. The trend direction has changed and a new bearish resistance line, the downward trendline, needs to be drawn using points \(B\) and \(C\), shown in Figure 3.12. Once the first pull-back occurs, leaving a low at point 4 , a parallel line is drawn crossing point 4 , forming the downward channel. In a downward-trending channel, it is best to sell short in the upper zone and cover the short in the lower zone. Buying in the lower zone is not recommended; trades are safest when they are entered in the direction of the trend.
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0250.jpg?height=720&width=1311&top_left_y=1075&top_left_x=63)
FIGURE 3.12 Turning from an upward to a downward channel. Trades are always entered in the direction of
When the support and resistance lines are relatively horizontal, or sideways, the channel is called a trading range. There is no directional bias in a trading range; therefore, you can enter new long positions in the support zone and enter new shorts in the sell zone. In both cases, penetration of either the support or resistance lines forces liquidation of the trade and establishes a new trend direction.
\section*{ONE-DAY PATTERNS}
The easiest of all chart patterns to recognize occur in one day. They include gaps, spikes, island reversals, reversal days, inside days, outside days, wide-ranging days, and, to a lesser extent, thrust days. Some of these patterns are important at the moment they occur and others must be confirmed by other factors.
\section*{Gaps}
Opening gaps occur when important news influences the market at a time when the exchange is closed. Futures trade 24 hours, so opening gaps only occur on Sunday when the markets reopen while the equities markets trade from 9:30 a.m. to 4:00 p.m., New York time, and are still likely to have opening gaps. Many listed companies release quarterly earnings reports before or after the normal trading sessions. While some stocks have extended hours, the official posting of prices only uses the primary trading session.
European markets have followed the lead of the United States in extending hours but are not yet trading the full day. The German DAX, trading on Eurex, has a "day session" from 9:00 a.m. (local time) to 5:45 p.m., and an extended session from 5:45 p.m. to 8:00 p.m. (closing at the same time as the \(\mathrm{S} \& \mathrm{P}\) in Chicago), then opening for an early session from 8:00 a.m. to 9:00 a.m. Other Eurex markets have similar hours.
There are some national holidays where the exchange is officially closed, but electronic trading on Globex is available. Prices that occur on the holiday are combined with trading on the next day and posted as a single day.
An upward gap exists when the low of the current day is higher than the high of the previous day. Then the S\&P futures will not have gaps, except on Sunday evening when Globex reopens, but the SPY ETF and U.S. stocks could have a gap each morning, as could many non-U.S. markets. It is best to refer to the exchange website to get the latest session times.
\section*{Gaps During the Trading Session}
Major economic reports are released by the U.S. government at 7:30 a.m. (Central time); therefore, they occur before the SPY begins trading, but during the electronic S\&P E-mini session. If the news is a surprise, S\&P futures will move sharply and the SPY will gap open an hour later to adjust to the futures price. Other reports on housing and manufacturing production occur in the morning after the markets open. They can cause liquidity pockets where there are only buyers and no sellers or
sellers and no buyers, at least for a short time. They appear to be gaps on an intraday chart.
Gaps can also occur because of a large cluster of orders placed at the point where the stock or futures market penetrates support or resistance. There is also the rarer case of an event shock such as September 11, 2001.
In charting, gaps are interpreted differently based on where they occur in the current price pattern. In some cases, a gap signals a continued move, and in other situations it is expected to be the end of a price move. The four primary gap formations are shown on a chart of Amazon.com in Figure 3.13. They are:
1. The common gap, which appears as a space on a chart and has no particular attributes - that is, it does not occur at a point associated with any particular significance. A common gap appears in May 1999 during a downward move.
2. A breakaway gap occurs at a point of clear resistance or support. It occurs when there are a large number of buy orders just above a major resistance line, or sell orders below a support line. These support and resistance lines are drawn after a prolonged period of sideways price movement when most chartists see the same pattern. The clearer the formation, and the longer the sideways period, the more likely there will be a large breakaway gap. The term "breakaway" requires some hindsight because it is applied only when the gap is followed by a sustained price move.
There are two breakaway gaps in Figure 3.13, the first in December 1998 shortly after prices make a new high, the second near the right of the chart when prices gap through a short upward trendline while still in a major downtrend following the peak in May 1999. In order to trade a gap, your order must be entered in advance of the gap, as prices approach the support or resistance level. Once you are in a long position and prices "gap up" you gain free exposure, which is the profit caused by the gap or by a fast market moving in your favor. If prices do not gap up, they most often drift lower. The position can be exited with a small loss and reentered later.
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0254.jpg?height=793&width=1234&top_left_y=928&top_left_x=160)
FIGURE 3.13 Price gaps shown on a chart of Amazon.com.
3. An exhaustion gap occurs at the end of a sustained
and volatile price move. It confirms the reversal. Exhaustion gaps usually occur on the day after the highest price of the upward move; however, in the Amazon chart it is one day later when more traders had time to recognize that Amazon prices had topped.
4. A runaway gap occurs at different points during a clear trend and confirms the trend. It does not appear to have any practical use because the trend can stop and reverse just after a runaway gap and it would be renamed an island top. When holding a long position, an upward runaway gap quickly adds profits, but also signifies extreme risk.
Gaps can also be a hindrance to trading. Holding a long position when a downward breakaway gap occurs guarantees that any stop-loss order is executed far away from the order price. If the upward breakaway gap occurs on light volume, it may be a false breakout. If you are holding a short when an upward gap occurs, and if you are lucky, prices will fall back to the breakout level and let you exit gracefully. If unlucky, you will be executed at the high of the move. In the final analysis, if the gap breakout represents a major change, your order should be entered immediately at the market. A series of poor fills will be offset by the one time when prices move quickly in your favor and no pullback occurs. A breakaway gap on high volume is usually indicative of a strong move and a sustained change. We will also see that a volume spike means the opposite. Interpreting a chart becomes an art.
\section*{Filling the Gap}
Tradition states that prices will retrace to fill the gap. Naturally, given enough time, prices will return to most levels; therefore, nearly all gaps will eventually be filled. The most important gaps are not filled for some time.
The gap represents an important point at which prices move out of their previous pattern and begin a new phase. The breakaway gap will often occur just above the previously established price level. With commodities, once the short-term demand imbalance has passed, prices should return to near-normal (perhaps slightly above the old prices given inflation), but also slightly below the gap. When a stock price gaps higher based on earnings, a new product announcement, or a rumor of an acquisition, the price may not return to the previous level.
A computer study of opening gaps, and a program that performs the study, can be found in Chapter 15. It shows the probabilities of subsequent price moves following gaps, based on different-sized gaps, in a wide selection of markets. Bulkowski has a large section devoted to gaps, briefly covered below, and more in Chapter 4.
\section*{Trading Rules for Gaps}
- A common gap is small and occurs with low volume and for no specific reason; that is, it is not the result of an obvious, surprising news release. Active traders will take a position counter to the direction of the gap, expecting the move to reverse and fill the gap, at which point they will take profits. If the gap
is not filled within a few days, the trade is liquidated.
A breakaway gap is the result of bunched orders at an obvious support or resistance area. When a clear sideways pattern has developed, place a buy order just under the resistance level in order to benefit from the jump in prices (free exposure) when the breakout occurs. If a gap occurs on the breakout, then prices should continue higher.
- A runaway gap is often found in the middle of a significant move. It is considered a good point to add to your position because the runaway gap confirms the move and implies additional profits.
An exhaustion gap is best traded as it occurs and, even at that stage, it is highly risky. Sell during the move upward, placing a stop above the previous high of the move. If this pattern fails, prices could move higher in an explosive pattern. If you are successful, profits could be large.
\section*{Bulkowski on Gaps}
Bulkowski includes an extensive study of breakaway, continuation, and exhaustion gaps. The statistics developed for these three cases are shown in Table 3.1. We expect a breakaway gap, one that occurs when prices move out of a sideways range, to mark the beginning of a new trend, and the exhaustion gap (which actually can't be seen until it reverses) to be the end of a trend. The continuation gap is somewhere in between and is only defined within the context of an existing trend.
\section*{TABLE 3.1 Percentage of time gaps are closed within 1 week, based on a sample of 100 stocks.}
\begin{tabular}{|l|l|l|}
\hline Gap Type & Uptrends (\%) & Downtrends (\%) \\
\hline Breakaway & \(\mathbf{1}\) & 6 \\
\hline Continuation & \(\mathbf{1 1}\) & \(\mathbf{1 0}\) \\
\hline Exhaustion & 58 & 72 \\
\hline
\end{tabular}
The results show that the breakaway gap often continues in the trend direction because prices rarely fill the gap.
Strategies that take advantage of this are the \(N\)-day breakout, swing trading, and pivot point breakouts, providing the observation period is greater than 40 days, the minimum considered to be a macrotrend.
\section*{Kaufman on Gaps}
In a study of 275 stocks, from 2012 through 2017, the upward gaps, greater than \(1 \%\), consistently pulled back during the trading day, about 40\% from the highs. In addition, stocks that gapped up tended to finish the day near the high. In Table 3.2 the size of the gap opening is along the top, the percentage of occurrences on the first row, the downward reversal from the gap open is in the second row, and the close compared to the previous day, in the last row.
Downward gaps were different and reflect the upward bias of stocks. The pullbacks from the low were larger and the close was consistently higher than the opening gap, shown in the last row of Table 3.3.
Note that most of the trading opportunities occur in the
first part of the day, when traders and investors are active, reacting to overnight news and economic reports.
\section*{TABLE 3.2 Average upward gaps, pullbacks, and close for 275 active stocks.}
\begin{tabular}{|l|c|c|c|c|c|}
\hline \begin{tabular}{l}
Higher \\
Open
\end{tabular} & \(\mathbf{1 - 3 \%}\) & \(\mathbf{3 - 5 \%}\) & \(\mathbf{5 - 7 \%}\) & \(\mathbf{7 - 9 \% \%}\) & \(\mathbf{9 - 1 1 \%}\) \\
\hline \%Events & \(31.26 \%\), & \(.3 .06 \%\), & \(0.99 \%\), & \(.0 .63 \%\), & \(.0 .59 \%\), \\
\hline \%Pullback & \(-1.45 \%\). & \(-2.50 \%\). & \(-2.73 \%\), & \(-2.99 \%\), & \(-3.51 \%\), \\
\hline \%Close & \(.0 .01 \%\). & \(-0.50 \%\). & \(-0.24 \%\). & \(-0.14 \%\). & \(-0.08 \%\). \\
\hline
\end{tabular}
TABLE 3.3 Average downward gaps, pullbacks, and close for 275 active stocks.
\begin{tabular}{|c|c|c|c|c|c|c|}
\hline ( & 3\% & 3-5\% & 5-7\% & \begin{tabular}{c}
7\%\%
\end{tabular} & 9- & \(>1\) \\
\hline & & & & 0.59\%. & 47\% & \\
\hline & & & & \%. & & 90 \\
\hline & & & & \% & & \\
\hline
\end{tabular}
\section*{Spikes}
Aspike is a single, highly volatile day where the price moves much higher or lower than it has in the recent past. An upward spike can only be recognized one day later because trading range of the following day must be much lower. The opposite is true for downward spikes. It is easiest to show spikes in markets, such as U.S. 30-year Treasury bonds, that react to frequent economic reports. In Figure 3.14 there is a series of three spikes about four weeks apart.
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0260.jpg?height=849&width=1328&top_left_y=64&top_left_x=67)
FIGURE 3.14 A series of spikes in bonds. From June through October 2002, U.S. bonds show three spikes that represent local tops. The spikes represent clear resistance levels that cause a unique pattern in the upward move.
An upward spike, as shown in Figure 3.14, is always a local top because a spike is a day with above-average volatility and must be bracketed by two lower days. This can also be called a pivot point. In all three cases shown, the spike represented the high price for at least one week. Because the spike is a clear top, when prices begin to rise again they usually meet resistance at the top of the spike. Chartists draw a horizontal resistance line using the high price of the spike, which encourages selling at that level. After each spike the chart is marked with "failed test," showing the price level where resistance, based on the previous spike, slowed the
advance.
\section*{Quantifying Spikes}
A spike has only one dominant feature: a high or low much higher or lower than recent prices. It must therefore also have high volatility. The easiest way to identify an upside spike is to compare the trading range on the day of the spike to previous ranges and to the subsequent day. This can be programmed in
TradeStation by using the true range function and satisfying the conditions that the high on the day of the spike, high[1], is greater than the previous and subsequent highs by the amount of \(k \times\) average true range over \(n\) days.
\[
\begin{aligned}
& \text { Spike = high[1]-highest(high, } n \text { ) } \\
& \left.[2]>k^{*} \text { average(truerange, } n\right)[2] \text { and } \\
& \quad \text { high[1]-high>k*average(truerange, } n)[2]
\end{aligned}
\]
In this code, spike is a logical variable (true-false), and we are testing if the spike occurred yesterday. The notation [1] indicates yesterday and [2] two days ago. We test to see that the high of yesterday is greater than the high of the previous \(n\) days, greater than the average true range of the same \(n\) days by a factor of \(k\), and also greater than the high of today by the same factor \(k\). Note that the use of [2] ends the true range calculation on the day before the spike. The value of \(k\) should be greater than 0.75. Spikes satisfying \(k>1\) are more desirable but less frequent.
In Excel, the true range is:
\[
\mathrm{TR}_{n}=\operatorname{Max}\left(\mathrm{H}_{n}-\mathrm{L}_{n}, \mathrm{H}_{n}-\mathrm{C}_{n-1}, \mathrm{C}_{n-1}-\mathrm{L}_{n}\right)
\]
where \(n\) is the current row, \(n-1\) is the previous row, and the high, low, and close ( \(H, L\), can \(C\) ) are in columns B, C , and D .
\section*{Island Reversals}
An island reversal or an island top is a single price bar, or group of bars, sitting at the top of a price move and isolated by a gap before and after the island formation. Combined with high volatility, this formation has the reputation of being a major turning point. The gap on the right side of the island top is an exhaustion gap. In Figure 3.15, showing AMR during the first part of 2003, there is one island reversal in mid-April. This single, volatile day has a low that is higher than both the previous day and the following day. It remains the high for the next week but eventually gives way to another volatile price rise. Island bottoms also occur, but are less frequent.
\section*{Pivot Point Reversals and Swings}
A pivot point is a trading day, or price bar, that is higher or lower than the bars that come before and after. If the entire bar is above the previous day and the following day, the pivot point reversal is the same as the island reversal. If it is a very volatile upward day but the low price is not above the high of the surrounding bars, then it is a spike. If you were plotting swing highs and lows, the high of an upward pivot point reversal day would become the swing high. It is common to locate a swing high by comparing the high of any day with two or more
days before and after. The patterns of the days on either side of the high bar are not important as long as the middle bar has the highest high. When more days are used to identify pivot points, these reversals become more significant; however, they take longer to identify.
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0263.jpg?height=847&width=1331&top_left_y=396&top_left_x=61)
FIGURE 3.15 AMR in early 2003, showing a classic island reversal with examples of other 1-day patterns.
Colby \({ }^{11}\) tested a Pivot Point Reverse Trading System, using the following rules:
- Buy (and close out short positions) when a pivot point bottom occurs and the close is higher than the previous close.
- Sell (and close out long positions) when a pivot point top occurs and the close is lower than the previous close.
Applying these reversal rules to the Dow Jones Industrials (DJIA) for 101 years ending December 2000 showed nearly 7,000 trades ( 70 per year) with significant profits. Other tests of pivot points can be found in Chapter 4.
\section*{Cups and Caps}
Another name given to the pivot point reversals are cups and caps, each determined by only three price bars, although another formation with the same name, cup with handle, is similar to a longer-term rounded bottom followed by a sideways or slight downward trend and a breakout to the upside. These two short-term formations are associated with trading rules that are identical to pivot point channels applied to the shortest time frame. Although some literature uses these formations backward, a cap formation identifies a sell signal when the trend is up, while a cup is a setup for a buy signal in a downtrend.
Once an uptrend is clear, a cap formation is found using either the daily closes or daily lows. For any three consecutive days, the middle day must have the highest close or the highest low. In a cup pattern, the middle day must have the lowest low or the lowest close of the 3-day cluster. In both cases, the positioning of the highs and lows of the other two days are not important as long as the middle day is lower for the cup and higher for the cap.
The cup will generate a buy signal if:
- The cup formation is the lowest point of the
\section*{downtrend;}
■ The buy signal (an upward breakout) occurs within three days of the cup formation; and
The current price closes above the highest high (middle bar) of the cup formation.
The buy signal is false if prices reverse and close below the low of the cup formation, resuming the previous downtrend. This pattern is only expected to forecast an upward price move of two days; however, every change of direction must start somewhere and this formation could offer an edge. A cap formation is traded with the opposite rules.
\section*{Reversal Days and Key Reversal Days}
A day in which there is a new high followed by a lower close is a downward reversal day. An upward reversal day is a new low followed by a higher close. A reversal day is a common formation, as seen in Figure 3.16, the Russell 2000 futures. Some of these days are identified; however, you can find other examples in Figures 3.13 through 3.16 . There have been many studies to determine the importance of reversal days for trading, but these are inconclusive. In Chapter 15 there is a detailed study of reversal days, indicating the likelihood of a subsequent price move based on this reversal pattern and other combinations. A reversal day by itself is not significant unless it can be put into context with a larger price pattern, such as a clear trend with sharply increasing volatility, or a reversal that occurs at the highest or lowest price of the past few weeks.
\section*{Key Reversals}
A key reversal day is a more selective pattern and has been endowed with great forecasting power. It is also called an outside reversal day and is a weaker form of an island reversal. A bearish key reversal is formed in one day by first making a new high in an upward trend, reversing to make a low that is lower than the previous low, and then closing below the previous close. It should be associated with higher volatility. Examples of key reversal days can be seen in Figures 3.14 and 3.15. It is considered more reliable when the trend is wellestablished.
As with reversal days, studies have shown mixed results using the key reversal as a sole trading indicator. The
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0266.jpg?height=72&width=1259&top_left_y=965&top_left_x=65)
that the performance was "strikingly unimpressive." Even though tests have not proved its importance, traders still pay close attention to key reversals, and consider them important. The job of a system developer is to find the environment in which this pattern becomes reliable. A comprehensive study of reversal days and other patterns can be found in Chapter 15.
Figure 3.16 shows a number of reversal days during the rapid drop of the Russell in January 2002. Three patterns of particular interest are the reversal days at the two extreme lows in July and October 2002, and the high in between, during August. Although there are many other reversal days embedded within other parts of the price move, the reversals off the lows are clearly at higher volatility than most other days, and follow very
sharp, accelerating price drops. The reversal day that ends the intermediate high during August does not share these attributes; however, it tops a pattern that is not the dominant trend, but an upward reaction within a previous sustained downtrend. If we focus on the characteristics of those reversal days that mark price extremes, rather than all reversal days, we should expect successful results.
\section*{Programming Key Reversal Days}
A key reversal day can be easily tested. In TradeStation's EasyLanguage the instructions for downward key reversal are:
KeyReversalDown = close[1] > average(close[2],n) and high >= highest(high[1],n) and low < low[1] and close < close[1];
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0267.jpg?height=853&width=1331&top_left_y=1081&top_left_x=61)
FIGURE 3.16 Russell 2000 during the last half of 2002 showing reversal days, key reversal days, inside days, and outside day.
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0268.jpg?height=140&width=167&top_left_y=273&top_left_x=60)
where KeyReversalDown is true or false and the first term tests for an uptrend over \(n\)-days prior to the reversal day, the second term tests that the current day is the highest price of the same \(n\)-days, the third term verifies that a lower low has occurred, and the last term tests for a lower close. This can be done in Excel by using the max and min functions instead of highest and lowest. A TradeStation function to identify key reversals is TSM Key Reversals and can be found on the
Companion Website along with an Excel spreadsheet of the same name.
Adding a volatility factor so that the key reversal day has noticeably higher volatility than the previous days seems to select more significant patterns. In the spreadsheet, which uses heating oil from 2005 through 2011, the basic rules gave marginal gains, but a filter that took only trades where today's true range was greater than \(1.5 \times\) average2o-day true range was much better.
\section*{2-Bar Reversal Patterns}
Martin Pring \({ }^{13}\) has called attention to a special 2-bar reversal pattern that frequently precedes a strong directional change. This pattern consists of two days that are essentially the mirror image of one another. Consider a market in which prices have been moving steadily higher. The first day of the pattern shows a volatile
upward move, with prices opening near the lows and closing near the highs. On the following day, prices open where they had closed, trade slightly higher (nearly matching the previous day's highs), then fall sharply to close near the lows, giving back all of the previous day's move.
Following the 2-bar reversal to the downside, the next few days should not trade above the midpoint of the 2bar reversal pattern. The smaller the retracement, the more likely there will be a good sell-off.
It is easy to explain the psychology of this pattern. The first bar represents the strong bullish feeling of the buyers while the second bar is seen as complete discouragement at the inability to follow through to make new highs. It will take some days before traders are willing to test the highs again. More traders may view this as a potential reversal. High volume can confirm the reversal. The nature of the move to follow depends on the extent of the previous trend and the volatility. Four key factors in predicting a strong reversal are:
1. Stronger preceding trend
2. Wider, more volatile 2-bar pattern
3. Greater volume than in previous days
4. Smaller retracements following the 2-bar pattern
\section*{Wide-Ranging Days, Inside Days, and Outside Days}
A wide-ranging day is a day of much higher volatility
than recent days, but no requirement that it is higher or lower than other days. An outside day must have both a higher high and lower low than the previous day. Inside days having lower highs and higher lows than the previous day are an example of volatility compression. All three patterns are very common but indicate that something special has happened. Examples of these patterns are shown in Figure 3.17, a 1-year, active trading period for Tyco ending in July 2000, before any accounting scandal surfaced.
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0270.jpg?height=851&width=1339&top_left_y=693&top_left_x=61)
FIGURE 3.17 Wide-ranging days, outside days, and inside days for Tyco.
\section*{Wide-Ranging Days}
A wide-ranging day is likely to be the result of a price shock, unexpected news, or a breakout in which many
orders trigger one another, causing a large increase in volatility. A wide-ranging day could turn out to be a spike or an island reversal. Because very high volatility cannot be sustained, we can expect that a wide-ranging day will be followed by a reversal, or at least a pause. When a wide-ranging day occurs, the direction of the close (if the close is near the high or low) is a strong indication of the continued direction.
A wide-ranging day is easily seen on a chart because it has at least twice or three times the volatility of the previous trading days. There is no requirement that it makes a new high or low relative to a recent move, or that it closes higher or lower. It is simply a very volatile day.
\section*{Outside Days}
An outside day often precedes a reversal. An outside day can also be a wide-ranging day if the volatility is high, but when volatility is low and the size of the bar is slightly longer than the previous bar, it is a weak signal. As with so many other chart patterns, if one day has an unusually small trading range, followed by an outside day of normal volatility, there is very little information in the pattern. Selection is important.
\section*{Inside Days}
An inside day is one where the high is lower than the previous high and the low is higher than the previous low. An inside day represents consolidation and lower volatility. In turn, lower volatility is most often associated with the end of a price move. After a burst of
activity and a surge of upward direction, prices have reached a point where the buyers are already in and the price has moved too far to attract more buyers. Volume drops, volatility drops, and we get an inside day. An inside day is often followed by a change of direction, but we really only know that the event that drove prices up is now over. If more news surfaces to ignite prices, the next move could just as easily be up as down.
In Figure 3.17 there are two inside days at the price peak on the top left of the Tyco chart. The first inside day is followed by a small move lower, then a small move higher, followed by another inside day. This last inside day precedes a major sell-off. On the right top of the chart there are two inside days immediately before another sharp drop.
Some analysts believe that a breakout from low volatility is more reliable than one following high volatility. For those readers interested in these patterns, a quantitative study of wide-ranging, inside days, and outside days can be found in Chapter 4.
\section*{CONTINUATION PATTERNS}
Continuation patterns occur during a trend and help to explain the stage of development of that trend. \(A\) continuation pattern that occurs within a long-term trend is expected to be resolved by continuing in the direction of the trend. If prices fail to move in the direction of the trend following a major continuation pattern, then the trend is considered over. The primary continuation patterns are triangles, flags, pennants, and
wedges. The larger formations of these patterns are more important than the smaller ones.
\section*{Symmetric, Descending, and Ascending Triangles}
Triangles tend to be larger formations that occur throughout a trend. A symmetric triangle is most likely to occur at the beginning of a trend when there is greater uncertainty about direction. A symmetric triangle is formed by a price consolidation, where uncertainty of buyers and sellers results in decreasing volatility in such a way that prices narrow to the center of the previous trading range. In Figure 3.18 the symmetric triangle is formed at about the level of the previous support. The breakout from a symmetric triangle often marks the beginning of a longer-term trend.
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0273.jpg?height=830&width=1329&top_left_y=1091&top_left_x=62)
FIGURE 3.18 Symmetric and descending triangles and a developing bear market in gold futures.
\section*{Formation of a Descending Triangle}
Even during a clear downward trend, prices will rally. Because the trend is clear, sellers are anxious to step in and sell these upward moves, looking for the trend to continue. The top of this mid-trend rally is likely to be the last support point where prices broke out of a previous pattern. In Figure 3.18 the top of the first descending triangle comes very close to the breakout level of the symmetric triangle, and the larger descending triangle toward the lower right of the chart has its high point at the breakout of another descending triangle.
The recent lows of the new trend form a temporary support level and prices may bounce off that level while short-term traders play for small profits. This action forms a descending triangle. As more traders are convinced that prices are still heading lower, rallies off the support level are sold sooner, causing a narrowing pattern, until prices finally break below support. The descending triangle is complete. In an upward trend an ascending triangle would be formed.
\section*{Size of the Triangles}
A triangle should take no less than two weeks to form; however, they can span a much longer period, occasionally up to three months. Larger formations represent periods of greater uncertainty. They may be
followed by another symmetric triangle, again indicating that traders are undecided about direction. If the symmetric triangle is resolved in the current trend direction, the trend is in full force, and a large price move is expected.
Triangles can be consistent indicators of investor confidence. Because they reflect human behavior, they are not always perfect in appearance and not always consistent in pattern. Experience will help identify the formation in a timely manner.
\section*{Flags}
A flag is a smaller pattern than a triangle, generally less than two weeks, and is formed by a correction in a bull market or a rally in a bear market. A flag is a congestion area that leans away from the direction of the trend and typically can be isolated by drawing parallel lines across the top and bottom of the formation. At the beginning of a trend the flags may not lean away from the direction of the new trend as clearly as during a well-established trend. If the first flag after an upward breakout leans down, it confirms the new upward trend.
Figure 3.19 shows an assortment of triangles, flags, and pennants. There are two small flags, one in the middle of the chart and one in the lower right, each leaning upward as expected in a downtrend. A larger flag slightly below center lasting nearly two months could also have been a symmetric triangle. Both patterns are resolved by a continuation of the trend.
\section*{Pennants}
Pennants are irregular triangles normally leaning toward the trend, similar to a descending triangle in a downtrend but without a horizontal support line. A typical pennant can be seen in the middle of Figure 3.19. During a sustained trend, triangles are large, clear formations with horizontal support or resistance lines while pennants are consolidation formations requiring only that the lines converge. A larger pennant should lean in the direction of the trend in a manner similar to a descending triangle; however, a small pennant may serve the same purpose as a flag and lean away from the trend.
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0276.jpg?height=849&width=1333&top_left_y=847&top_left_x=60)
FIGURE 3.19 An assortment of continuation patterns. These patterns are all resolved by prices moving lower. A downward pennant can be found in the middle of the chart.
\section*{Wedges}
A pattern that looks as if it is a large pennant, with both sides angling in the same direction but not coming to a point, is a wedge. In an upward-trending market the wedge should be rising as shown on the right side of the General Electric chart, Figure 3.20, near the end of 1999. The earlier wedge has nearly a horizontal upper line, bridging the pattern between a wedge and a rising triangle. A rising wedge is formed in the same way as an ascending triangle. Investors, convinced that the share price will rise, will buy smaller and smaller reversals even as prices make new highs. In the end, prices continue in the direction of the trend. In a typical rising wedge, the lower line has a steeper angle than the upper line.
The angle of the wedge should be steeper as the trend becomes clear. The earlier wedge formation shown in Figure 3.20 is nearly symmetric. If we study the bigger picture, we can see that the uncertainty at the beginning of the trend is reflected in the symmetric formation while the rising wedge occurs after the trend is well established and investors anticipate a continuation.
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0278.jpg?height=480&width=1321&top_left_y=430&top_left_x=70)
FIGURE 3.20 Wedge. A weaker wedge formation is followed by a strong rising wedge near the end of 1999 in this chart of General Electric.
\section*{Run Days}
Triangles, flags, pennants, and wedges represent the best of the continuation patterns. They can be identified clearly while they are still being formed and the direction of the breakout can be anticipated and traded. Other formations, such as run days, are not as timely. A run day occurs when the low of that day is higher than the previous \(n\) days, and the high of the day is lower than the subsequent \(n\) highs. When it occurs, this pattern confirms that a trend is in effect. The more days used to define the run day, the stronger the pattern. Therefore, a 5 -day run day requires 11 days to identify, 5 before the run day and 5 after. Unlike the other continuation
patterns, which have a breakout level that can be used as a trading signal, entering a long position after 11 days of a strong upward move is not likely to be a good entry point. There are no trading rules or trading action associated with run days. They simply confirm what you have already seen on charts - that prices have been trending.
\section*{BASIC CONCEPTS IN CHART TRADING}
Having covered the fundamental chart patterns, there are some additional concepts that should be discussed in order to keep the proper perspective. Charting involves a great deal of subjective pattern identification; therefore, there may be a choice of patterns within the same time interval. There are also many cases where prices nearly form a pattern, but the shape does not fit perfectly into the classic definition.
\section*{Major and Minor Formations}
In the study of charting, the same patterns will appear in short- as well as long-term charts. An upward trendline can be drawn across the bottom of a price move that only began last week, or it can identify a sustained 3-year trend in the financial markets, or a 6-month move in Amazon. In general, formations that occur over longer time intervals are more significant. All-time highs and lows, well-defined trading ranges, trendlines based on weekly charts, and head-and-shoulder formations are carefully watched by traders. Obscure patterns and new formations are not of interest to most chartists, and
cannot be resolved consistently. Charting is most successful when formations are easy to see; therefore, the most obvious buy and sell points are likely to attract a large number of orders.
\section*{Market Noise}
All markets have a normal level of price noise. The stock index markets have the greatest amount of irregular movement due their extensive participation, the high level of anticipation built into the prices, the uncertain way in which economic reports and news will impact prices, and because it is an index. This is contrasted to short-term interest rates, such as Eurodollars, which have large participation but little anticipation because it has strong ties to the underlying cash market, governed by the central bank. The normal level of noise can be seen in the consistency of the daily or weekly trading range on a chart of the Dow or S\&P. When volatility declines below the normal level of noise, the market is experiencing short-term inactivity. An increase in volatility back to normal levels of noise should not be confused with a breakout.
This same situation can be applied to a triangular formation, which has traditionally been interpreted as a consolidation, or a pause, within a trend. This pattern often follows a fast price change and represents a short period of declining volatility. If volatility declines in a consistent fashion, it appears as a triangle; however, if the point of the triangle is smaller than the normal level of market noise, then a breakout from this point is likely to restore price movement to a range typical of noise,
resulting in a flag or pennant formation. Both of these latter patterns have uniform height that can include a normal level of noise, but they would not be reliable buy or sell signals.
\section*{ACCUMULATION AND DISTRIBUTION: BOTTOMS AND TOPS}
Most of the effort in charting, and the largest payout in trading, goes into the identification of tops and bottoms. For long-term traders, those trying to take advantage of major bull and bear markets, these formations can unfold over fairly long periods. These prolonged phases, which represent the cyclic movement in the economy, are called accumulation when prices are low and investors slowly buy into their position, and distribution at the top, where the invested positions are sold off.
The same formations can occur over shorter periods and are very popular among all traders; however, they are not as reliable. There are many top and bottom formations that are easily recognized. In order of increasing complexity, they are the \(V\)-top or \(V\)-bottom, the double or triple top or bottom, the common rounded top or bottom, the broadening top or bottom, the headand-shoulders formation, and the complex top or bottom.
\section*{\(\boldsymbol{V}\)-Tops and \(\boldsymbol{V}\)-Bottoms}
The \(V\)-top (actually an inverted "V"), which may also have a spike on the final day, is the easiest pattern to see
afterward, but a difficult top formation to anticipate and trade. There have been times, such as in 1974, 1980, and 2000, when the frequency of \(V\)-tops was deceiving. \(V\) tops are often preceded by critical shortage or extreme demand and magnified by constant news coverage. In 1974, it was a combination of domestic crop failure, severe pressure on the U.S. dollar abroad, and foreign purchases of U.S. grain that combined to draw public attention to a potential shortage in wheat. The news was so well publicized that novice commodity traders withdrew their funds from their declining stock portfolios and bought any commodity available as a hedge against inflation.
It could not continue for long. When the top came in soybeans, silver, and most other commodities, there was no trading for days in locked-limit markets; paper profits dwindled faster than they were made, and the latecomers found their investments unrecoverable. The news is not a good source for timing your trade. The most dramatic of all price moves was the technology bubble of the 1990s, ending with a peak in the NASDAQ index during March 2000. As you can see in Figure 3.21, prices accelerated near the end of the bull market, then collapsed just as quickly.
Since then, there have been runs in many commodities. The seasonal nature of cotton has shown price spikes every few years, but nothing as extreme as the \(V\)-top in 2011 (see Figure 3.22). Flooding in both Pakistan and Egypt greatly reduced the cotton supply in 2011, causing prices to soar, then decline just as fast. Shortages in agricultural products are usually resolved by the
following year if the new crop looks good, or by substitution. Consumers can switch from cotton to synthetics.
Cotton also shows a consistent resistance level at about \(\$ 0.80\) per pound. It can be seen in the 12 years prior to the 2011 spike, with prices reverting to the same pattern afterward.
In some way, every \(V\)-top shares a similarity with the examples in Mackay's Extraordinary Popular Delusions and the Madness of Crowds. It is where a large number of people chase a smaller supply. However, when prices get high enough, four phenomena occur:
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0283.jpg?height=950&width=1331&top_left_y=861&top_left_x=61)
FIGURE 3.21 A \(V\)-top in the NASDAQ index, March 2000.
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0284.jpg?height=603&width=1327&top_left_y=62&top_left_x=63)
FIGURE 3.22 Cotton has frequent \(V\)-tops but nothing as extreme as in 2011.
1. Previously higher-priced substitutes become practical (synthetics for cotton, reclaimed silver, solar power).
2. Competition becomes more feasible (corn sweetener as a sugar substitute, wind generation and solar energy, biofuel and electric cars).
3. Inactive operations start up (Southwest goldmines, marginal production of oil and shale).
4. Consumers avoid the products (beef, bacon, silver, cotton) and drive less.
Consequently, the demand suddenly disappears. Announcements of additional production, more acreage, new products, boycotts, and a cancellation of orders all coming at once cause highly inflated prices to reverse sharply. These factors form a \(V\)-top that can't be anticipated with any accuracy. There is a natural reluctance to cash in on profits from long positions while
they are increasing every day. The situation becomes even more perilous at the end of the move when more investors join the party. These latecomers, who entered their most recent positions near the top, will show a loss immediately and will need to get out of the trade first; they cannot afford a continued drawdown.
Once a reversal day is recognized, there is a mad rush to liquidate. The large number of investors and speculators trying to exit at the same time causes the sharpness in the \(V\)-top and extends the drop in prices. There is a liquidity void at many points during the decline where there are no buyers and a long line of sellers. A \(V\)-top or \(V\)-bottom is always accompanied by high volatility and usually high volume. When the \(V\)-top is particularly extreme it is commonly called a blow-off. A true \(V\)-top or \(V\)-bottom will become an important medium- or longterm high or low for that market.
\section*{\(V\)-Bottoms}
\(V\)-bottoms are much less common than their upside counterparts. They occur more often in commodity markets where supply and demand can change dramatically and leverage causes surges of buying and selling. Both \(V\)-tops and \(V\)-bottoms should be read as a sign that prices have gone too far, too fast. Both buyers and sellers need time to reevaluate the fundamentals to decide where prices should be. \(V\)-bottoms are usually followed by a rebound and then a period of sideways movement. Two good examples can be found in the crude oil chart, Figure 3.23, and in the stock market crash of October 1987
\section*{Double and Triple Tops and Bottoms}
The experienced trader is most successful when prices are testing a major support or resistance level, especially an all-time high in a stock, or a seasonal high or low in an agricultural market. The more often those levels are tested, the clearer they become and the less likely prices will break through to a new level without additional fuel. This fuel comes in the form of higher earnings or a change in the fundamental supply-and-demand factors.
A double top is a price peak followed, a few days or weeks later, by another peak, and stopping very close to the same level. A double bottom, more common than a double top, occurs when two price valleys show lows at nearly the same level. Because prices are more likely to settle for a while at a lower price than a high one, prices often test a previous support level, causing a double bottom.
Tops and bottoms occur at the same level because traders will bet that the same reason that caused prices to fail to go higher the first time will be the reason they fail the second time. The exceptionally high or low prices are the result of extreme speculation rather than fundamentals. In the same way that some stocks will trade at price/earnings ratios far above any rational assessment of business prospects in the near future, commodity prices can be pushed to extremes by crowd psychology without regard to value. Traders, looking for a place to sell an unreasonably high price, target the previous point where prices failed. Although a classic double top is thought to peak at exactly the same price,
selling in anticipation of the test of the top may cause the second peak to be lower than the first. Figure 3.24 shows one type of double top in crude oil. While some double tops are two sharp peaks, this one looks as though it was gathering strength. It penetrated slightly above the previous high, but could not sustain higher prices.
Double tops are rarely perfect.
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0287.jpg?height=853&width=1329&top_left_y=514&top_left_x=62)
FIGURE 3.23 Two \(V\)-bottoms in crude oil, backadjusted futures.
\section*{Double and Triple Bottoms}
Bottoms are more orderly than tops, but can still be irregular. They should be quiet rather than volatile. They are caused by prices reaching a level that is low enough for the normal investor to recognize that there is little additional downside potential. Economists might call
this the point of equilibrium. Neither buyers nor sellers are convinced that prices will continue to move lower. They wait for further news.
Double bottoms in commodities will often test the same price level because large position traders and commercial users accumulate more physical inventory, or increase their futures position, each time the price falls to their target level. Once prices are low there is less chance of absolute loss. Selling a double top can be very risky. The greatest risk when buying a double bottom is that your timing is wrong. If prices do not rally soon, you have used your capital poorly.
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0288.jpg?height=833&width=1329&top_left_y=839&top_left_x=62)
FIGURE 3.24 A double top in crude oil.
Bank of America (BAC) shows a classic triple bottom (Figure 3.25), with the third test slightly higher than the previous two, a situation that happens when traders
expect the bottom to hold and start buying in advance. The same chart has a test of the top and a breakout of an extended bottom formation.
Goldman Sachs (GS) shows a less regular triple bottom at the lowest prices (Figure 3.26), and two double bottoms at higher levels. On the second test of the lows in 2003, volatility declines. The third test is a spike down. The chart also shows a volatile double top in 2007 just ahead of the financial crisis.
Traders will start to buy a double bottom when prices slow near previous low levels, as happened in 2003. They will also look for declining volume or confirmation in the stock price of another related company or a related sector ETF. Traders chose the small double top at the end of 2002 to signal a breakout.
\section*{Bank of America (BAC)}
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0289.jpg?height=719&width=1323&top_left_y=1118&top_left_x=65)
FIGURE 3.25 Triple bottom in Bank of America (BAC).
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0290.jpg?height=623&width=1329&top_left_y=64&top_left_x=64)
FIGURE 3.26 A triple bottom and two double bottoms in Goldman-Sachs (GS).
\section*{Triple Tops and Bottoms}
Triple tops are considerably less common than double tops; however multiple bottoms can be found more readily, as in Figure 3.26. Figure 3.27 shows a classic triple top in natural gas. A triple top can be formed from a \(V\)-top, but in this case, the first peak is an island reversal, the second is a spike, and the third an extended top that ends the move.
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0291.jpg?height=857&width=1331&top_left_y=56&top_left_x=61)
FIGURE 3.27 Natural gas shows a classic triple top.
If we did not have the advantage of seeing the triple top afterward, each of the individual tops would look as if it were the end of the move. After the first island reversal prices dropped \(\$ 2\), nearly \(20 \%\); after the second peak there was another large gap down and a 1-day loss of more than \(\$ 1\). High volatility is normally associated with an extreme top. By waiting for a confirmation of a decline after the single or double top, the trade would have been entered \(\$ 1.50\) to \(\$ 2.50\) below the top, and that position would be held while prices reversed to test the highs. Selling tops is risky business. In this case, persistence payed off.
A triple bottom that offers a trading opportunity is most likely to occur at low prices and low volatility, much the same as a double bottom. It shows an inability to go
lower because investors are willing to build a position at a good value. For commodities it is a good place for a processor to accumulate inventory.
\section*{The Danger of Trading Double and Triple Tops}
There are many examples of double tops and a smaller number of triple tops. Ideally, there is a lot of money to be made by selling tops at the right place. However, the likelihood of this good fortune happening is less than it appears. Consider why a triple top is so rare. It is
because prices continue higher and the potential triple top disappears into a strong bull market pattern.
This happens even more often with double tops. Every time a price pulls back from new highs, then starts moving up again, there is a potential double top. In a prolonged bull market, most double tops disappear in the move higher. To improve your chance of success, traders add declining volume or volatility, support and resistance, and often a confirmation of a price reversal. It is better to capture less of the move and have a greater chance of success. These confirming indicators are discussed throughout this book. Until then, it is important to recognize the difficulty of deciding whether the current pattern will be a single, double, or triple top, or simply a pause in a bull market.
\section*{Extended Rectangle Bottom}
The extended rectangular bottom presents one of the best opportunities for large profits. In his book The Professional Commodity Trader, Stanley Kroll discussed
"The Copper Caper: How We're Going to Make a Million." He identified an extended rectangular at low prices with low volatility, accumulated a position whenever prices tested the low of the range, then captured huge profits when prices finally broke out to the upside.
However, success involves a great deal of luck. The problems not stated are:
1. How many times do you buy at the lows if you don't know how long it will be before a breakout? How do you allocate your capital?
2. While you may not lose much by buying lows, you can be wasting capital if nothing happens, or miss a better opportunity in another market.
Instead of accumulating a position on lows, the safer choice is to buy the breakout. Typically, a good trade will be confirmed by increased volume on the breakout. Figure 3.28 shows Yahoo (AABA) forming a \(11 / 2\) year bottom in 2001 and 2002 after the dramatic decline in tech stocks. A breakout at about \(\$ 11\) took prices to \(\$ 40\). A longer extended bottom from 2009 through 2012 was also followed by a rally to \(\$ 40\) and eventually higher. Again, buying the breakout would have been a better use of capital.
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0294.jpg?height=605&width=1327&top_left_y=61&top_left_x=63)
FIGURE 3.28 Two cases of a breakout of an extended bottom in Yahoo (AABA).
The only pattern that allows for the accumulation of a large short position is the rounded top, discussed in the next section. Consolidation areas for commodities at low levels have a number of factors working in your favor that do not exist for equities: the underlying demand for a product, the cost of production, government price support (for agricultural products), and low volatility itself. Opportunities are always there.
\section*{Rounded Tops and Bottoms}
When prices change direction over a longer time period, they can create a rounded top or bottom pattern. A rounded top reflects a gradual change in market forces from buyers to sellers. In the stock market it is also called distribution. It is a sign that any attempt to move prices higher has been abandoned. Rounded tops often lead to faster and faster price drops as more investors liquidate their long positions or initiate shorts.
In Figure 3.29 we see two classic rounded tops in the German DAX futures. The first is an example of gathering downside momentum as more investors become aware of the decline. Prices drop faster after a break of the double bottom. The rounded top offers an opportunity to accumulate a short position with relatively low volatility.
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0295.jpg?height=855&width=1339&top_left_y=513&top_left_x=61)
FIGURE 3.29 Two rounded tops in the German DAX stock index.
\section*{Rounded Bottom}
A rounded bottom, similar to a rounded top, is an extended formation where prices gradually turn from down to up. In Figure 3.30 we see a rounded bottom in the Japanese yen followed by a breakaway gap. The rounded bottom offers traders an opportunity to
accumulate a long position without much risk. In this case, the sharp rally as prices move through the high of the rounded bottom, followed by a runaway gap, clearly marks the end of the rounded bottom. A breakout, whether in stocks or futures, indicates that something new has entered the picture.
\section*{Wedge Top and Bottom Patterns}
We have seen a wedge formation as a continuation pattern in Figure 3.20, but a large ascending wedge can mark the top of a move and a large descending wedge the bottom. The dominant characteristic of the wedge is that volatility is declining toward the end, especially in a descending pattern. In Figure 3.31 there is a declining wedge in the Japanese yen. Volatility compresses until a breakout is inevitable. If the breakout had been to the downside, this wedge would have been interpreted as a continuation pattern. In this example, a breakout in the opposite direction is a strong indicator of a major reversal.
\section*{Head-and-Shoulders Formation}
A classic top and bottom formation is the head and shoulders, accepted as a major reversal indicator. This pattern, well known to chartists, appears as a left shoulder, a head, and a right shoulder, as seen in Figure 3.32. The head-and-shoulders top is developed with the following five characteristics:
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0297.jpg?height=1691&width=1339&top_left_y=59&top_left_x=61)
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0298.jpg?height=1727&width=1333&top_left_y=61&top_left_x=60)
FIGURE 3.31 A large declining wedge followed by a upside breakout in the Japanese yen.
1. A strong upward breakout reaching new highs on increasing volume. The pattern appears to be the continuation of a long-term bull move.
2. A consolidation area formed with declining volume. This can look much like a descending flag predicting an upward breakout, or a descending triangle indicating a downward breakout.
3. Another upward breakout on continued reduced volume forms the head. This is the key point of the formation. The new high is not confirmed by increased volume, and prices drop quickly.
4. Another descending flag or triangle is formed on further reduced volume, followed by a minor breakout without increased volume. This last move forms the right shoulder and is the third attempt at new highs for the move. The right shoulder is often lower than the left shoulder.
5. The lowest points of the two flags, pennants, or triangles become the neckline of the formation. A short sale is indicated when this neckline is broken.
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0300.jpg?height=1049&width=1339&top_left_y=59&top_left_x=61)
FIGURE 3.32 Head-and-shoulders top pattern in the Japanese Nikkei index.
\section*{Trading Rules for Head and Shoulders}
There are three approaches to trading a head-andshoulders top formation involving increasing degrees of anticipation and risk:
1. Wait for a confirmation.
a. Sell when the final dip of the right shoulder penetrates the neckline. This represents the completion of the head-and-shoulders
formation. Place a stop-loss just above the entry
if the trade is to be held only for a fast profit, or
place the stop-loss above the right shoulder or above the head in order to liquidate on new strength, allowing a longer holding period.
b. Sell on the first rally after the neckline is
broken. This approach can give a better price or completely miss the trade if there is no rally. Use the same stops as in step la.
2. Anticipation of the final shoulder.
a. Sell when the right shoulder is being formed. A likely place would be when prices have retraced their way half the distance to the head. A stoploss can be placed above the top of the head.
b. Wait until the top of the right shoulder is formed and prices appear to be declining. Sell and place a stop either above the high of the right shoulder or above the high of the head. Both steps 2 a and 2 b allow positions to be taken well in advance of the neckline penetration with logical stop-loss points. Using the high of the head for the stop allows the integrity of the pattern to be tested before the position is exited.
3. Early anticipation of the head.
Sell when the right part of the head is forming, on the downward price move, with a stop-loss at about the high of the move. Although this represents a small risk, it has less chance of success and much larger potential profits. This approach is for traders who prefer to anticipate
tops and are willing to suffer frequent small losses to do it. A confirmation of lower volume or price compression would help select better opportunities.
Volume was part of the classic definition of the headand-shoulders formation that appeared in Edwards and Magee's Technical Analysis of Stock Trends, published in 1948. This is no longer considered as important. There are many examples of successful head-and-shoulders formations that do not satisfy the volume criteria. Nevertheless, declining volume on the head or the right shoulder of a top formation must be seen as a strong confirmation of a failing upward move, and is consistent with the normal interpretation of volume.
\section*{EPISODIC PATTERNS}
There is little argument that all prices change quickly in response to unexpected news. The transition from one major level to another is termed an episodic pattern; when these transitions are violent, they are called price shocks. Until the late 1990 os there were very few price shocks in the stock market; the greatest one is terrorist attacks of September 11, 2001. Otherwise, price shocks can be caused by a surprising election result, the unexpected action by the Federal Reserve, the devaluation of a currency (e.g., Switzerland), a natural disaster, or an assassination (or what we now call a geopolitical event). While price shocks are most common in futures markets, all markets are continually adjusting to new price levels and all experience
occasional surprises. Each news article, government economic release, or earnings report can be considered a mini-shock. A common price shock occurs when a pharmaceutical company's application for a new drug is unexpectedly rejected by the USDA.
The pattern that results from episodic movement is exactly what one might expect. Following the sharp price move, volatility declines from its highs, narrowing until a normal volatility level is found, then remaining at that level. In the Raytheon reaction to \(9 / 11\), the upward price shock, shown in Figure 3.33, is followed by a volatile, unstable few days and then a steady decline in volatility as some level of equilibrium is found. The Raytheon price reacted opposite to most other stocks because it is a defense contractor, and a terrorist attack implies an increased amount of business from the government.
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0303.jpg?height=710&width=1327&top_left_y=1078&top_left_x=63)
FIGURE 3.33 On the left, an episodic pattern shown in an upward price shock In Raytheon following 9/11/2001.
On the right, a typical downward price shock.
Unless the news that caused the price shock was an error, in which case prices immediately move back to levels prior to the news, prices will settle in a new trading range near the extreme highs or lows. It will take time for the market to absorb the consequences of the news, and many traders will find the risk too high to participate.
Price shocks have become the focus of much analytic work. Because a price shock is an unpredictable event, it cannot be forecast. This has a critical effect on the way in which systems are developed, especially with regard to the testing procedures. We understand at the time of the price shock that the event was entirely unexpected. However, years later, when the same prices are analyzed using a computer program, you might find that a trend or charting pattern benefited from this move. The analysis records the profits as though they were predictable and you are now basing your conclusions on the false premise that you can profit from price shocks. These important issues are covered in other parts of this book under the topics "Price Shocks," "Robustness," and "Optimization," found in Chapters 21 and 22.
\section*{PRICE OBJECTIVES FOR BAR}
\section*{CHARTING}
Most traders set price objectives and stops and use them to assess the risk and reward of a potential trade.
Objectives are most reasonable for short-term trading
and successful objectives are based on straightforward concepts and not complex calculations. There is a noticeable similarity between the price objectives for different chart patterns. Many of these can be easily calculated in a spreadsheet.
For a chartist, the most common price objective is a major support or resistance level. When entering a long position, look at the most well-defined resistance levels above the entry point. These have been discussed in previous sections of this chapter. When those prior levels are tested, there is generally a pause or a reversal. The more well-established the support or resistance level, the more likely prices will stop. In the case of a strong upward move, volatility often causes a small penetration before the setback occurs. A penetration of support or resistance, followed by a return to the previous trading range, is considered a confirmation of the old range and a false breakout. Placing the price objective for a long position below the nearest major resistance level will always be safe. The downside objective can be identified in a similar manner: Find the major support level and exit just above it.
When trading with chart patterns it pays to be flexible. Regardless of which method you use to identify a profit target, be prepared to take profits sooner if the market changes. For example, you have entered a long in IBM at \(\$ 160\) and set your profit objective at \(\$ 180\). Prices move as predicted and reach \(\$ 175\) when volume starts to drop and the price pattern seems to move sideways. An experienced trader will say "close enough" and take the profit. Profit objectives are not perfect, only good
guidelines. If you have set a single price target for a long position, and it falls slightly above a resistance level, then the lower resistance level should be used as the price objective.
One practical solution that will be discussed in Chapter 22 is using multiple profit-targets. Rather than rely on a single point, traders will fan out their target points around the most likely objective, dividing their goal into three or five levels. As each profit-target is reached the risk of the current trade is reduced as is the likelihood of turning a profit into a loss.
While waiting for prices to reach the upside objective, remember to watch for a violation of the current trend; trend changes take priority over profit objectives. After you have successfully taken profits, watch for a new pattern. If prices decline, then reverse upward again, and break through the new high, the position can be reentered on the breakout and a new price objective calculated.
\section*{Common Elements of Profit Objectives}
Most chart formations have a price objective associated with them. The common element in all of them is volatility. Each chart pattern is larger or smaller because of the current price volatility; therefore, the price targets derived from these formations are also based on volatility. In general, the price objective reflects the same volatility as the chart formation and is measured from the point where prices break out of the pattern.
Calculations for volatility objectives can be found in the
sections "Using Volatility for Profit Targets and StopLoss Orders" in Chapter 20 and "Taking Profits" in Chapter 23.
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0308.jpg?height=954&width=1331&top_left_y=60&top_left_x=57)
(a)
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0308.jpg?height=822&width=1138&top_left_y=1111&top_left_x=174)
(b)
FIGURE 3.34 Price objectives for consolidation patterns and channels. (a) Two objectives for consolidation patterns. (b) Price objective for a channel.
\section*{Profit Targets for Consolidation Areas and Channels}
The most basic of all formations is the horizontal consolidation area, bounded on the top and bottom by a horizontal resistance and support lines. There are two possible profit targets, shown in Figure 3.34.
1. For any horizontal consolidation pattern, the target is above the breakout of the resistance line at a point equal to the height of the consolidation area (the resistance level minus the support level added to the resistance level). That makes the expected move equal to the extreme volatility of the consolidation area (see Figure 3.34a).
2. With extended rectangular formations, the upward profit target is calculated as the width of the entire consolidation pattern added to the support level. This implies that the longer the consolidation period, the larger the breakout. After some time, this becomes unrealistic, and your first objective should be the height of the consolidation area added to the resistance level.
A third objective is more conservative but even more practical:
3. Use the average volatility of the consolidation formation added to the resistance level, or reduce
the target in (1) above by \(20 \%\) to remove the extremes from influencing the objectives. A closer price target will be reached more often.
The price objective for a channel is the same as the traditional objective for a horizontal consolidation pattern (Figure 3.3b). Because the channel is at an angle, it is necessary to measure the width of the channel as perpendicular to the support and resistance channel lines, then project that width upward from the point of breakout. The length of the channel does not change the profit target. Again, you may want to make the target slightly smaller than the original channel.
\section*{Changing Price Objectives Using Channels}
Price objectives must be recalculated as trends change and new channels are formed. Figure 3.35 shows the change from an upward to a downward trend. Once a breakout of an upward channel has occurred (marked "First point of reversal"), we wait until the low is reached at \(a\), followed by the reaction back up to \(b\). A resistance line, \(1 R\), can then be drawn from the prior high \(h\) to the top of the latest move \(b\). A line, \(1 S\), can be constructed parallel to \(1 R\) passing through point \(a\), forming the initial downward channel. Price objective 1 is on line \(1 S\) of the new channel and is used once the top at point \(b\) is determined. Price objective 1 cannot be expected to be too precise due to the early development of the channel. If prices continue down to point \(c\) and then rally to \(d\), a more reasonable channel can now be defined using trendlines \(2 R\) and \(2 S\). The support line will again become the point where the new price objective is placed. The
upper and lower trendlines can be further refined as new high and low reactions occur. The primary trendline is always drawn first, then the new price objective becomes a point on the parallel trendline.
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0311.jpg?height=800&width=1327&top_left_y=335&top_left_x=63)
FIGURE 3.35 Forming new channels to determine objectives.
\section*{Targeting Profits after Tops and Bottoms}
Because profit targets are based on the volatility of the underlying pattern, the profit targets for all top formations will be farther away than those for bottom formations. Looking back at Figure 3.27, natural gas, there is a triple top formation. Between each top is a reversal marking a short-term support level. The first pullback after the island reversal brought prices to 8.20, followed by a test of the top that formed the second peak. The second retracement stopped at 9.00 and was
followed by the third peak. When prices finally drop through the highest support level at 9.00 we can treat it as a breakout and sell short.
Breaking this support level at 9.00 indicates that the topping formation is complete. For this triple top, we can use the distance between the high of 11.50 and the low of 9.00 as the size of the profit target, measured from the breakout. That gives 6.50 as the target, an ambitious number. Had we been trading it, when prices went sideways between 7.00 and 7.50 , we would have been looking to exit.
\section*{Calculating the Profit Target for a Top Formation}
The profit target is found by measuring the height of the top formation and projecting it downward from the point where the top is confirmed, that is, the break of the support level. If we look at crude oil futures, Figure 3.36, a major top was formed from July 2011 to July 2014. During this interval there were three attempts to break the high of 112.47. After the first top, prices dropped to 77.09, rallied to 106.77, then dropped to 79.11. We'll only calculate the profit targets for these two.
1. For the first profit target, subtract the low of 77.09 from the high of 112.47 , a difference of 35.38 . Subtract that from the low of 77.09 to get the major target of 41.71. The low was at 26.42 .
\section*{Crude oil triple top}
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0313.jpg?height=673&width=1228&top_left_y=124&top_left_x=173)
FIGURE 3.36 Two profit targets following a top formation in back-adjusted crude oil futures.
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0314.jpg?height=1277&width=1240&top_left_y=60&top_left_x=161)
FIGURE 3.37 Head-and-shoulders top price objective.
2. Based on the second peak at 106.77 and the drop to 79.11, we subtract that difference and subtract it from 79.11 to get another profit target at 51.45 . That turns out to be the first significant support level after the breakout.
Some chartists would prefer to measure the profit target from the breakout of the upward slanting support line,
but horizontal support lines tend to be stronger because they can often be associated with structural shifts in price.
\section*{Profit Targets after a Bottom Formation}
The same principle can be applied to calculate the profit target for bottom formations. The profit target for a consolidation area was discussed in a previous section, but shorter, more volatile patterns forming bottoms are calculated in the same way as with tops. The distance from the lowest price of the bottom to the resistance level is projected upward from the breakout. This method can be applied to any type of bottom formation. In Figure 3.26, the double bottom in Cisco spanned the price range from about 5.00 to 6.25 . The volatility of the bottom pattern, 1.25 , is projected upward from the breakout at 6.25 to get the target of 7.50 . Because volatility should increase as prices rise, this volatility calculation should be conservative.
\section*{The Head-and-Shoulders Price Objective}
In keeping with other price targets, the head-andshoulders top has a downside objective that is also based on its volatility. This objective is equal to the distance from the top of the head to the neckline and measured downward from the point where the right shoulder penetrates the neckline (Figure 3.37).
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0316.jpg?height=608&width=441&top_left_y=261&top_left_x=62)
(a)
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0316.jpg?height=557&width=554&top_left_y=319&top_left_x=837)
(b)
FIGURE 3.38 Triangle and flag objectives. (a) Triangle objective is based on the width of the initial side, \(s\). (b) Flag objective is equal to the move prior to the flag formation.
\section*{Triangles and Flags}
Triangles and flags also have objectives based on volatility. The triangle objective is equal in size to the initial reaction that formed the largest end of the triangle (Figure 3.38a), measured from the support line. It may also be viewed as a developing channel rather than a triangle, with the ascending leg of the triangle forming the primary bullish trendline. The price objective then becomes the same as those used for channels.
The flag is assumed to occur at some point during a price move; therefore, the objective of a new breakout must be
equal to the size of the move preceding the flag (Figure 3.38b). This avoids problems associated with the decreasing volatility of the triangular formation.
Subsequent profit targets for flags are measured starting from the breakout of the previous formation.
Note that an alternative profit target for a triangle could be measured in the same way, based on the move from a prior breakout to the high of the first peak in the triangle.
\section*{The Rule of Seven}
Another measurement of price objectives, the Rule of Seven, is credited to Arthur Sklarew. \({ }^{14}\) It is based on the volatility of the prior consolidation formation and computes three successive price objectives in proportion to one another. The Rule of Seven is not symmetric for both uptrends and downtrends. Sklarew believes that, after the initial leg of a move, the downtrend reactions are closer together than the reactions in a rising market. Because the downside of a major bear market is limited, it is usually characterized by consolidation. Major bull markets tend to expand as they develop.
To calculate the objectives using the Rule of Seven, first measure the length \(L\) of the initial leg of a price move (from the previous high or low, the most extreme point before the first pullback). The objectives are:
1. In an uptrend:
\section*{Upwards objective \(1=\) prior low \(+(L \times 7 / 4)\)}
Upwards objective \(2=\) prior low \(+(L \times 7 / 3)\)
Upwards objective \(3=\) prior low \(+(L \times 7 / 2)\)
2. In a downtrend:
\[
\begin{aligned}
& \text { Downwards objective } 1=\text { prior high }-(L \times 7 / 5) \\
& \text { Downwards objective } 2=\text { prior high }-(L \times 7 / 4) \\
& \text { Downwards objective } 3=\text { prior high }-(L \times 7 / 3)
\end{aligned}
\]
The three objectives apply most clearly to major moves. During minor price swings it is likely that the first two objectives will be bypassed. In Sklarew's experience, regardless of whether any one objective is missed, the others still remain valid.
\section*{IMPLIED STRATEGIES IN CANDLESTICK CHARTS}
For a technique that has been used as early as the mid160os, Japanese candle charts were slow to find their way into the Western method of analysis. Candle charts are similar to bar charts but offer additional visual interpretation. The candles are created simply by shading the piece of the bar between the opening and closing prices: white if the close is higher than the open and black if the close is lower than the open. The shaded area is called the body and the extended lines above and
below the body are the shadows. With this simple change, we get an entirely new way of looking at and interpreting charts. The patterns become much clearer than the Western style of line chart.
Although many candlestick patterns have equivalent bar chart formations, there is an implied strategy in many of them. The following summary uses the traditional candlestick names representing the significance of the formation (see Figure 3.39):
Doji, in which the opening and closing prices are the same. This represents indecision, a temporary balancing point. It is neither bullish nor bearish. A double doji, where two dojis occur successively, implies that a significant breakout will follow.
DOJI
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0320.jpg?height=316&width=589&top_left_y=125&top_left_x=194)
(a)
HANGING MAN
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0320.jpg?height=280&width=439&top_left_y=595&top_left_x=271)
(c)
BULLISH ENGULFING PATTERN
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0320.jpg?height=116&width=71&top_left_y=1089&top_left_x=461)
(e)
BULLISH MORNING STAR
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0320.jpg?height=147&width=98&top_left_y=1398&top_left_x=450)
\(\square\)
(g)
BULLISH PIERCING LINE
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0320.jpg?height=136&width=59&top_left_y=1805&top_left_x=461)
(i)
HAMMER
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0320.jpg?height=275&width=281&top_left_y=143&top_left_x=1014)
(b)
SHOOTING STAR
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0320.jpg?height=282&width=399&top_left_y=594&top_left_x=959)
(d)
\section*{BEARISH ENGULFING} PATTERN
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0320.jpg?height=110&width=71&top_left_y=1051&top_left_x=1109)
(f)
BEARISH EVENING STAR
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0320.jpg?height=179&width=104&top_left_y=1388&top_left_x=1111)
(h)
BEARISH DARK CLOUD COVER
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0320.jpg?height=132&width=76&top_left_y=1807&top_left_x=1123)
(j)
\section*{FIGURE \(3.39(\mathrm{a}-\mathrm{j})\) Popular candle formations.}
Engulfing patterns seem at first to be the same as outside days in bar charting, but the pattern only refers to the part of the bar between the opening and closing prices. Engulfing patterns are considered exceptionally strong signals of price change. A bullish engulfing pattern has a black candle followed by a white, indicating a wide range with a higher close. The bearish engulfing pattern is white followed by black, showing a lower close on the engulfing day.
Morning star and evening star are 3-day patterns that are more specific than an island reversal. In the morning star, a bullish reversal pattern, the first day has a lower close than the open, the second day (called the star, similar to the island bottom) has a higher close, and the final reversal day has an even higher close. The bearish reversal is just the opposite, with two higher closes followed by a reversal day with a lower close. If the star is also a doji, then the pattern has more significance.
Piercing line and dark cloud cover are bullish and bearish reversals. The piercing line, a bullish reversal, begins with a black candle (a lower close) and is followed by a white candle in which the open is below the previous day's low and the close is above the midpoint of the previous day's body (the open-close range). The dark cloud cover is a bearish formation, the opposite of the piercing line.
- Hammer, a bullish reversal signal, showing the bottom of a swing, where the body is at the top of the candle, indicating an upward change of direction, and the shadow is below the body. The body may be black or white.
- Hanging man, a bearish reversal pattern where the body of the candle represents the high of a swing, and the shadow lies below in the direction of the reversal. The body may be black or white.
Shooting star, a bearish signal, occurs at the top of a swing and has its body at the bottom of the candle with the shadow above. The body may be black or white.
Although these patterns are similar to Western bar chart formations, none of them are exactly the same. The hammer, hanging man, and shooting star are reversal patterns but can only be compared to the simple pivot point where the middle day is higher or lower than the bars on either side. None of the candle formations is exactly the same as a key reversal day or island reversal. The engulfing pattern is stronger than the typical outside day because the spanning of the prior day's range must be done only by the current day's open-close range.
The analysis of candle charts is a skill involving the understanding of many complex and interrelated patterns. For full coverage, Thomas Bulkowski's, Encyclopedia of Candlestick Charts is recommended, because it includes an extensive analysis of these patterns. Some of his conclusions are given in a following section, "The Best of Candles."
\section*{Quantifying Candle Formations}
The preciseness of the candle formations allows some patterns to be tested. The popular engulfing patterns can be defined exactly for a computer program as:
Bullish engulfing pattern \(=O_{t-1}>C_{t-1}\) and \(O_{t}<C_{t-1}\) and \(C_{t}>O_{t-1}\) Bearish engulfing patter \(=C_{t-1}>O_{t-1}\) and \(O_{t}>C_{t-1}\) and \(C_{t}<O_{t-1}\)
Another technique uses the shadows as confirmation of direction. We can interpret an increase in the size of the upper shadows as strengthening resistance (prices are closing lower each day); an increase in the size of the lower shadows represents more support. One way to look at this is by defining:
Upper shadow \((\) white \()=H_{t}-C_{t}\) Lower shadow \((\) white \()=O_{t}-L_{t}\)
Upper shadow \((\) black \()=H_{t}-O_{t}\) Lower shadow \((\) black \()=C_{t}-L_{t}\)
The sequences of upper and lower shadows can be smoothed separately using a moving average to find out whether they are rising or falling. \({ }^{15}\)
A method for determining whether black or white candles dominate recent price movement is to use only the body of the candle, \(B=C_{t}-O_{t}\), and apply a momentum calculation:
\section*{Body momentum \\ up \\ \(B_{\text {up }}+B_{\text {down }}\)}
where
\(B_{u p} \quad=\) the sum of the days where \(B>0\) (body is white)
\(B \quad=\) the sum of the days where \(B<0\) (body is
down black)
14 = the recommended number of days
When the body momentum is greater than 70 the whites dominate; when the value is below 20 the blacks dominate. These thresholds indicate an upward bias.
\section*{Morning Star and Evening Star}
Two formations that are easily programmed are the morning star (a bullish signal) and evening star (a bearish signal). Using the morning star as an example, the rules call for a long downward (black) candle followed by a lower, less volatile white candle (the open of the next bar less than the close of the previous long bar), and finally an upward thrust shown as a gap up body with the close higher than the open (another white candle).
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0324.jpg?height=130&width=146&top_left_y=1647&top_left_x=62)
When programmed (see TSM Morning Star and TSM Evening Star in the Companion Website), there were very few signals if we put minimum size restrictions on the bodies of the three candles. Instead, we only
required that the body of the first day is greater than the 20-day average body, the second day less, and the third day greater. While there are still only a modest number of trades, the S\&P performs well on the day following both patterns.
\section*{Qstick}
As a way of quantifying the Candle formations, Tuschar Chande \({ }^{16}\) created Qstick, a moving average of the body of the candle. While it is intended to be an aid to interpreting the charts, it also has simple trading rules.
If Body \(y_{t}=C_{t}-O_{t}\)
\(Q_{1}=\operatorname{average}(\) periodl, body), where periodl is suggested as 8 days
\(\operatorname{Avg} Q_{t}=\operatorname{average}(\operatorname{period} 2, Q)\), where period 2 is also 8 days then the trading rules are:
\section*{Buy when \(Q_{t}\) crosses above \(\operatorname{Avg} Q_{t}\)}
\section*{Sell when \(Q_{t}\) crosses below \(\operatorname{Avg} Q_{t}\)}
\section*{Pivot Points and Candle Charts}
John Person suggests that the strategies inherent in candle formations can be combined with support and resistance levels derived from pivot points. \({ }^{17} \mathrm{He}\) uses the following calculations:
1. Pivot point, \(P_{t}=\left(H_{t}+L_{t}+C_{t}\right) / 3\)
2. First resistance level, \(R 1=\left(P_{t} \times 2\right)-L_{t}\)
3. Second resistance level, \(R 2=P_{t}+H_{t}-L_{t}\)
4. First support level, \(S 1=\left(P_{t}+2\right)-H_{t}\)
5. Second support level, \(S 2=P_{t}-H_{t}+L_{t}\)
Once a key formation for a top or bottom is recognized using candle charts, support and resistance levels calculated based on pivot points can be a strong indication of the extent of the following price move. Person used Dow futures to support his study.
\section*{The Best of the Candles}
Bulkowski has summarized his own research on the success of various candles \({ }^{18}\) as:
- The best-performing candles had closing prices within \(1 / 3\) of the bar low, followed by the middle and high, respectively.
- Candle patterns in a bear market outperform other markets, regardless of the breakout direction.
Most candles perform best on days with higher volume.
- Candles with unusually long wicks outperform.
- Unusually tall candles outperform.
\section*{Trends Are Easier to See in Retrospect}
As important as it is to identify the direction of price movement, it is much easier to see the trend afterward than at the moment it is needed. There is no doubt that all stocks and futures markets have short-term swings and longer-term bull and bear markets. Unfortunately, at the time you are ready to trade, it is not going to be clear whether the current price trend is a short-term pattern that is about to change, or a long-term persistent trend experiencing a temporary reversal.
The ease of seeing charts on a screen has made the past patterns clear. It seems natural to expect prices to trend in the future as clearly as they appear on a chart; however, it is not easy to recognize the best trend in a timely fashion. The eye has a remarkable way of simplifying the chart patterns. The purpose of drawing a trendline is to add objectivity to your analysis, even when prices are volatile. A new trend signal to buy or sell always occurs as the trend is changing; therefore, it is at the point of greatest uncertainty.
Success in systematic trading, whether using charts or mathematics, relies on consistency. In the long run it comes down to probabilities. In a typical trend-following system, because individual profits are much larger than losses, it is only necessary to be correct \(30 \%\) of the time. Accepting losing trades 70\% of the time can be a challenging psychological hurdle.
\section*{Long-Term Trends Are More Reliable Than Short-Term Trends}
Charting is not precise and the construction of the trendlines, other geometric formations, and their interpretation can be performed with some liberties. When using the simplest trendline analysis, it often happens that there is a small penetration of the channel or trendline followed by a movement back into the channel. Some think that this inaccuracy with respect to the rules makes charting useless; however, many experienced analysts interpret this action as confirmation of the trend. The trendline is not redrawn so that the penetration becomes the new high or low of the trend; it is left in its original position.
We must always step back and look for the underlying purpose in each method of analysis, whether interpretive or fully systematic. The trendline is an attempt to identify the direction of prices over some time period. Chartists can use a simple straight line to visualize the direction; they draw the uptrend by connecting the lowest prices in a rising market even though each point used may represent varying levels of volatility and unique conditions. The chance of these points aligning perfectly, or forecasting the exact support level, is small. A trendline is simply a guide; it may be too conservative at one time and too aggressive at another; and you won't know until after the trade is completed. Applied rigorously, charting rules should produce many incorrect signals but be profitable in the most important cases. The challenge for the chartist is to interpret the pattern of prices in context with the bigger picture.
Many price moves are called trends, but the most important and sustained trends are those resulting from
government policy, in particular those that affect interest rates. Therefore, the most reliable trends are long-term phenomena because government policy develops slowly and often over years. During a period of recession, as we saw in 2001 and 2002, the Federal Reserve continued to lower interest rates incrementally, causing a major bull market in all fixed-income maturities. It is easiest to see this trend by looking at a weekly chart of the 10-year Treasury note, rather than a daily chart. The more detail there is, the more difficult it is to see the long-term trend. Following the financial crisis of 2008 the Fed and other central banks decided to lower rates to the absolute minimum and keep them there as long as necessary to stimulate the economy. This resulted in a protracted bull market in both interest rates and equities.
\section*{Confirming Signals}
Some of the impreciseness of charting can be offset with confirming signals. A simultaneous breakout of a shortterm trendline and a long-term trendline is a much stronger signal than either one occurring at different times. The break of a head-and-shoulders neckline that corresponds to a previous channel support line is likely to receive much attention. Whenever there are multiple signals converging at, or near, a single price, whether based on moving averages, Gann lines, cycles, or phases of the moon, that point gains significance. You should also watch when a single stock meets support or resistance at the same place as the S\&P. In chart analysis, the occurrence of multiple signals at one point can compensate for the quality of the interpretation.
\section*{Pattern Failures}
The failure to adhere to a pattern is equally as important as conforming to that pattern. Although a trader might anticipate a reversal as prices near a major support line, a break of that line is significant in continuing the downward move. A failure to stop at the support line should result in setting short positions and abandoning plans for higher prices.
A head-and-shoulders formation that breaks the neckline, declines for a day or two, then reverses and moves above the neckline is another pattern failure. Postpattern activity must confirm the pattern. Failure to do so means that the market refused to follow through; therefore, it should be traded in the opposite direction. This is not a case of identifying the wrong pattern; instead, price action actively opposed the completion of the pattern. Wyckoff calls this "effort and results," referring to the effort expended by the market to produce a pattern that explains the price direction. If this pattern is not followed by results that confirm the effort, the opposite position is the best option.
\section*{Change of Character}
Thompson \({ }^{19}\) discusses the completion of a pattern or price trend by identifying a change of character in the movement. As a trend develops, the reactions, or pullbacks, tend to become smaller. Traders looking to enter the trend wait for reactions to place their orders; as the move becomes more obvious, these reactions get smaller and the increments of trend movement become
larger. When the reaction suddenly is larger, the move is ending; the change in the character of the move signals a prudent exit, regardless of how prices move afterward.
A similar example occurs in the way prices react to economic reports or government action. The first time the Federal Reserve acts to raise rates after a prolonged decline, the market is not prepared and interest rate prices react sharply lower. Before the next meeting of the Fed the market may be more apprehensive, but is likely to be neutral with regard to expectation of policy. However, once there is a pattern of increasing rates following signs of inflation, the market begins to anticipate the action of the Fed. A sharp move in the opposite direction occurs when the government fails to take the expected action.
\section*{Bull and Bear Traps}
While it is not much of a consolation to those who have gotten caught, a failed downside breakout is called a bear trap, and a failed upward breakout is a bull trap. For example, a bear trap occurs when prices fall below a clear support line, generating sell signals. After a few days, prices move back above the support line, often accelerating upward. In both cases, prices appear to be continuing in the trend direction, but the final picture is a reversal. Although there is no advice on how to avoid bull and bear traps, the failed reversal should be recognized as soon as possible and the position should be reversed. Bull and bear traps often precede significant price reversals.
As with other top and bottom patterns, a confirmation of the bear trap is complete when prices move above the next higher resistance level. In the case of a failed flag formation in a downward trend, prices break lower as expected, then reverse. The confirmation occurs when prices move above the top of the failed flag pattern. The same principle would be true of other failed chart formations; the failure is confirmed when prices retrace the entire pattern. 20
\section*{Testing Your Skill}
Recognizing a pattern is both an art and a discipline. Not everyone has an eye for patterns; others see formations where no one else does. The first decision may be the most important: How much of the chart do you use? It is perfectly normal for different time intervals to show different pictures. In some cases, arbitrarily cutting the chart at some previous date might cause an important trend to disappear.
The timeliness of the pattern identification is the most serious problem. Can the formation be interpreted in time to act on a breakout, or is the pattern only seen afterward? At different stages of development, the lines may appear to form different patterns. Before using your charting skills to trade, practice simulating the day-today development of prices using the following steps:
1. Have someone give you a chart ending at least a year earlier.
2. Analyze the formations.
3. Determine what trades you will make based on your interpretation. Be specific. You will need to hold these trades for a week.
4. Get the next week of prices.
5. Record any orders that would have been filled based on the prior analysis. Don't cheat.
6. Determine whether the new week's prices would have altered your interpretation. Record your new trades.
7. Return to step 4 until finished.
This simple exercise might save a lot of money. At first, results may be bad, but with practice you will become better at finding and using formations. Weekly data is better than daily because it forces you to have a wider view of the market. Keep it simple at first, using only trendlines, then graduate to more complex formations. Every trader should have practiced forecasting from charts. They are also the basis of many good systematic programs.
\section*{EVOLUTION IN PRICE PATTERNS}
A change has occurred in the stock market because of the S\&P 500 index, SPDRs, and other index markets. If you think that stock prices are about to fall because of a pending interest rate hike by the Fed, you can protect your portfolio by selling an equivalent amount of S\&P futures. Afterward, when you have decided that prices have stabilized, you can lift your hedge and profit from
rising prices. It is an easy and inexpensive way to get portfolio insurance and, at the same time, keep any capital gains in your stock positions. When institutions and traders buy or sell large quantities of S\&P futures, the futures price will drift away from the S\&P cash index. Program trading is the process that keeps the price of futures and ETFs aligned with the cash index. But buying or selling all the stocks in the S\&P at the same time has changed the patterns of individual stocks that are part of the S\&P index. Under massive buying, an individual stock may reverse a downtrend and form a support level that has nothing to do with its own fundamentals. It may not matter that IBM is fundamentally stronger than GE, or that Micron is at a resistance level and Ford is at support, or even if a company is under investigation. When program traders buy S\&P stocks, they buy all of the stocks at the same time. Today's technical trader must keep one eye on the individual stock and the other eye on the index.
Figure 3.40 shows the S\&P 500 index, GE, and Exxon over the same period from October 1999 through December 2000. Fundamentally, these three markets have little in common; however, the overall pattern of the three markets is remarkably similar, with most tops and bottoms occurring at nearly the same time. Because it is unlikely that the fundamentals of each company would result in such a similar price pattern, we can conclude that the S\&P futures, combined with program trading, forces the patterns to be materially the same. This change in the way stocks are traded reduces the ability to get diversification by trading across sectors. At
the same time, it increases risk.
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0335.jpg?height=853&width=1329&top_left_y=151&top_left_x=62)
FIGURE 3.40 Similar patterns in the S\&P, GE, and Exxon.
\section*{Globalization: The Similarity of Asian Markets}
There has been a noticeable shift in Asian markets price patterns as well. Their largest economies, China and India, have been creating a consumer middle-class. Although not all of the Asian stock markets are open to foreign investors, globalization has not passed them by. Figure 3.41 shows the equity index markets for Hong Kong (HSI), Singapore (SSG), Taiwan (STW), the Philippines (PHI), and Malaysia (KLI) adjusted to 100 on January 28, 2005.
The five series look remarkably the same. It is understandable that, as trading partners, these countries
are dependent upon one another, yet the similarity is surprisingly strong. One explanation would be that, if traders believe that a poor economic signal in one country means that others will also share in bad times, then they sell the equity index markets, or individual stocks, in each country. That would be similar to Hewlett-Packard announcing worse than expected earnings and having traders sell ACER and microchip companies, expecting the same downturn. In volatile markets, the movement of money can be more important than the fundamentals. This was clearly the case for the financial crisis in September 2008, when all markets moved the same way as investors withdrew their funds as quickly as possible.
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0336.jpg?height=641&width=1327&top_left_y=935&top_left_x=63)
FIGURE 3.41 Asian equity index markets adjusted to the same volatility level and started at the value 100.
\section*{NOTES}
1 William L. Jiler, "How Charts Are Used in Commodity
Price Forecasting," Commodity Research Publications (New York, 1977).
\(\underline{2}\) Thomas N. Bulkowski, Encyclopedia of Chart Pattern, 2nd ed. (Hoboken, NJ: John Wiley \& Sons, 2005). Results of Bulkowski's studies are included in Chapter 4, the section "A Study of Charting Patterns." A similar approach can be found in Bulkowski's Encyclopedia of Candlestick Charts (Hoboken, NJ: John Wiley \& Sons, 2008).
3 Reprinted in 1995 by John Wiley \& Sons, Inc.
4 R.W. Schabacker, "Stock Market Theory and Practice," Forbes (New York, 1930, pp. 595-600).
5 Robert D. Edwards and John Magee, Technical Analysis of Stock Trends (Springfield, MA: Stock Trend Service, 1948, Chapter 16).
6 Richard D. Wyckoff, Stock Market Technique, Number One (New York, 1933), p. 105.
\({ }^{7}\) Robert Rhea, Dow Theory (Binghamton, NY: VailBallou, 1932).
\(\underline{8}\) The rules of the Dow Theory in this section are based on a fine article by Ralph Acampora and Rosemarie Pavlick, "A Dow Theory Update," originally published in the MTA Journal (January 1978, reprinted in the MTA Journal, Fall-Winter 2001). Other parts of this section are drawn from Kaufman, \(A\) Short Course in Technical Trading (Hoboken, NJ: John Wiley\& Sons, 2003).
9 Adapted from James Maccaro, "The Early Chartists: Schabacker, Edwards, Magee," Technical Analysis of Stocks \& Commodities (November 2002).
10 In Carol Oster, "Support for Resistance: Technical Analysis and Intraday Exchange Rates," FRBNY Economic Policy Review, July 2000, the author shows that support and resistance levels specified by six trading firms over 3 years were successful in predicting intraday price interruptions. In addition, these levels were valid for about 5 days after they were noted.
11 Robert W. Colby, The Encyclopedia of Technical Market Indicators (McGraw-Hill, 2003), pp. 510514 .
12 Eric Evans, "Why You Can't Rely on ‘Key Reversal Days," Futures (March 1985).
13 Martin Pring, "Twice as Nice: The Two-Bar Reversal Pattern," Active Trader (March 2003).
14 Arthur Sklarew, Techniques of a Professional Commodity Chart Analyst (Commodity Research Bureau, 1980).
15 Both "shadow trends" and "body momentum" are adapted from Tushar Chande and Stanley Kroll, The New Technical Trader (John Wiley \& Sons, 1994).
16 Tushar Chande and Stanley Kroll, The New Technical Trader (Hoboken, NJ: John Wiley \& Sons, 1994).
17 John L. Person, "Pivot Points and Candles," Futures (February 2003).
18 Thomas Bulkowski, "What You Don't Know About Candlesticks," Technical Analysis of Stocks \& Commodities (March 2011).
19 Jesse H. Thompson, "What Textbooks Never Tell You," Technical Analysis of Stocks \& Commodities (November-December 1983).
20 See Christopher Narcouzi, "Winning with Failures," Technical Analysis of Stocks \& Commodities (November 2001).
\section*{CHAPTER 4}
\section*{Charting Systems}
The automation of charting techniques can be seen on most quote equipment. With a single click, you can change a line chart into a candlestick or a point-andfigure chart. More sophisticated programs can identify Elliott Waves and Gann angles and projections. Granted, there will always be analysts who disagree with the positioning of these points and lines, but they make charting simpler and bring standardization to what was considered a combination of art and skill.
The systems and techniques included in this chapter are those that might be used by traditional chartists. Many of them are classic methods by famous analysts. In some of these charting systems, the time that it takes for a price to move from one level to the next is not important; it is only the extent of the move that is used. The common ground in this chapter is that the methods can be automated. At the end of the chapter is a summary of Bulkowski's work, a study and ranking of most popular chart patterns.
We begin with a review of a few of the earliest attempts at systematic trading. Of course, we have come much further in the 70 years since Dunnigan, and markets have expanded and changed. Yet they are still driven by investors with the same objectives. Given our wide range of techniques, tools, and technology, deciding on the
most profitable path may be difficult. These first developers struggled with basic concepts and, in many ways, they are the same concepts that we try to resolve now. What appears to be a less sophisticated solution may actually be the key to the best solution. Lest we forget Occam's razor,
One should not increase, beyond what is necessary, the number of entities required to explain anything.
\section*{DUNNIGAN AND THE THRUST METHOD}
William Dunnigan's work in the early 1950s is based on chart formations and is purely technical. Although an admirer of others' ability to perform fundamental analysis, his practical approach is contained in this statement:
"If the economists are interested in the price of beans, they should, first of all, learn all they can about the price of beans." Then, by supporting their observations with the fundamental elements of supply and demand they will be "certain that the bean prices will reflect these things." \({ }^{\prime 1}\)
Dunnigan did extensive research before his major publications in 1954. A follower of the Dow Theory, he originally created a breakaway system of trading stocks and commodities but was forced to drop this approach because of long strings of losses. The net results of his system, however, were profitable. He was also disappointed when his " \(23 / 8\) Swing Method" failed after its publication in A Study in Wheat Trading. But good
often comes from failure and Dunnigan had realized that different measurements should be applied to each market at different price levels. His next system, the Percentage Wheat Method, combined a \(2^{1 / 2} \%\) penetration and a 3 -day swing, introducing the time element into his work and perhaps the first notion of thrust, a substantial move within a predefined time interval. With the \(2^{1 / 2} \%, 3\)-day swing, a buy signal was generated if the price of wheat came within \(2 \%\) of the lows, then reversed and moved up at least an additional \(2^{1 / 2} \%\) over a period of no less than three days.
For Dunnigan, the swing method of charting \({ }^{2}\) represented a breakthrough; it allowed each market to develop its natural pattern of moves, and its own volatility. He had a difficult time trying to find one criterion for his charts that satisfied all markets, or even all grains, but established a \(\$ 2\) swing for stocks where Rhea's Dow Theory used only \(\$ 1\) moves. It could be that higher prices since Rhea's work justified larger swings. His studies of percentage swings were of no help even though we now find a percentage swing is a better solution.
\section*{The Thrust Method}
Dunnigan's final Thrust Method combined percentage measurements with the interpretation of chart patterns, later modified with some mathematical price objectives. He defines a downswing as a decline in which the current day's high and low are both lower than the corresponding high and low of the highest day of the prior upswing. If currently in an upswing, a higher high
or higher low will continue that move. The reverse effect of having both a higher high and higher low would result in a change from a downswing to an upswing. The top and bottom of a swing are the highest high of an upswing and the lowest low of a downswing, respectively. An outside or inside day, in which the highs and lows are both greater or both contained within any previous day of the same swing, has no effect on the direction.
In addition to the swings, Dunnigan defines the five key buy patterns:
1. Test of the bottom, where prices come within a predetermined percentage of a prior low
2. Closing-price reversal, a new low for the swing followed by a higher close than the prior day
3. Narrow range, where the current day's range is less than half of the largest range for the swing
4. Inside range, where both the high and low fall within the prior range, now called an inside day
5. Penetration of the top by any amount, what we now call a breakout
These conditions are reversed for sell patterns. A new buy signal was generated by combining the patterns indicating a preliminary buy, with a thrust the next day confirming the move. The thrust was defined as a price gain that varied with the price level of the market (for 1954 wheat, this was from \(1 / 2\) to \(1^{1 / 2}(\) ). Dunnigan's system attempted to enter a long position near a bottom and short near a top, an improvement on the Dow Theory. Because of the risks, the market was asked to
give evidence of a change of direction by satisfying two of the first four patterns followed by a thrust on the next day; otherwise, no trade was entered.
The same buy and sell signals apply to changes in direction that did not occur at prior tops and bottoms but somewhere within the previous trading range. If all the conditions were not satisfied and prices penetrated either the top or bottom, the fifth pattern satisfied the preliminary signal and a thrust could occur on any day. This was not restricted to the day following the penetration. If nothing else happened, Dunnigan followed the rules of the Dow Theory to ensure that a major move would not be missed.
\section*{Repeat Signals and Double Thrusts}
Followers of Dunnigan's method say that his repeat signals are the strongest part of his system; even Dunnigan states that they are more reliable, although they limit the size of the profit by not taking full advantage of the trend from its start. Repeat signals use relaxed rules not requiring a new thrust because the trend has already been identified. Two key conditions for repeat buy signals are:
1. A test of the bottom followed by an inside day (interpreted as market indecision)
2. A closing price reversal followed by an inside day
Adouble thrust occurs when the first thrust is followed immediately by a second thrust; or, after the first thrust, a congestion area develops, followed by a second thrust in the same direction as the first. Although Dunnigan
used a fixed number of points to define his "thrust," today's traders may find that comparing today's price move to the average true range would be a more flexible rule based on volatility, and more practical for identifying thrusts.
\section*{One-Way Formula}
Dunnigan worked on what he hoped would be a generalized version of his successful Thrust Method and called it the One-Way Formula. Based on his conclusions that the Thrust Method was too sensitive, causing more false signals than he was prepared to accept, he modified the confirmation aspect of the signal and made the thrust into the preliminary signal. He also emphasized longer price trends that smooth performance and reduce trading signals.
With the upswing and downswing rules remaining the same, Dunnigan modified the thrust, requiring its entire range to be outside the range of the prior day, what we call and outside day. This is a much stronger condition than his original thrust, yet only constitutes a
preliminary buy. (It is likely that lower liquidity during the 1950 allowed for more gaps than we have now.) The confirmation requires an additional upthrust after the formation of, or test of, a previous bottom. There must be a double bottom or ascending bottom followed by a thrust to get a buy signal near the lows. If the confirmation does not occur after the first bottom of an adjustment, it may still be valid on subsequent tests of the bottom.
For the One-Way Formula, repeat signals are identical to original signals. Each one occurs on a pullback and test of a previous bottom, or ascending bottom, followed by an upthrust. Both the initial and repeat signals allow the trader to enter after a reaction to the main trend. The Dow approach to penetration is still allowed in the event that all else fails. The refinement of the original Thrust Method satisfied Dunnigan's problem of getting in too soon.
\section*{Updated Trend and One-Way Formula}
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0346.jpg?height=137&width=148&top_left_y=743&top_left_x=63)
Ruggiero has interpreted Dunnigan's trend and updated the One-Way Formula \({ }^{3}\) so that it can be programmed. An uptrend requires two consecutive days where the highs and lows are both higher, confirmed by prices moving above the high of the current downtrend. Results are good and similar to more complex methods. A program to test this method is TSM Dunnigan Trend, available on the Companion Website.
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0346.jpg?height=128&width=150&top_left_y=1325&top_left_x=62)
The One-Way Formula is considerably more involved and requires identifying a double bottom, then takes advantage of a short-term uptrend or bounce that follows. A program to test this is TSM Dunnigan OneWay Formula, available on the Companion Website.
\section*{The Square Root Theory}
The two previous methods show a concentration of entry techniques and an absence of exit rules. Although
positions are reversed when an opposite entry condition appears, Dunnigan spends great effort in portfolio management \({ }^{4}\) and risk-reward conditions that were linked to exits. By his own definition, his technique would be considered "trap forecasting," taking a quick or calculated profit rather than letting the trend run its course (the latter was called continuous forecasting).
Dunnigan measured risk and set profit objectives using the Square Root Theory. He strongly supported this method, thinking of it as the "golden" 5 key and claiming support of numerous sources, such as the Journal of the American Statistical Association, the Analyst's Journal, and Econometrica. The theory claims that prices move in a square root relationship. For example, a market trading at 81 ( or \(9^{2}\) ) would move to \(64\left(8^{2}\right)\) or \(100\left(10^{2}\right)\); either would be one unit up or down based on the square root. The rule also states that a price may move to a level that is a multiple of its square root. A similar concept can be found greatly expanded in the works of Gann (Chapter 14). Both are methods that take advantage of increasing volatility as prices increase.
\section*{NOFRI'S CONGESTION-PHASE SYSTEM}
Markets spend the greater part of their time in nontrending motion, moving up and down within a range determined by near-stable equilibrium of supply and demand. Most trend followers complain about the poor performance during these sideways periods. Eugene Nofri's system, presented by Jeanette Nofri
Steinberg,, 6 is used during the long periods of congestion, returning steady but small profits. The user of the Congestion-Phase System should wait for a well-defined congestion area before beginning a trading sequence.
The basis of the system is a 3 -day reversal. If prices are within a congestion range and have closed in the same direction for two consecutive days, take the opposite position on the close of day two, anticipating a reversal. If this is correct, take the profits on the close of trading the next (third) day. The concept is that, during a sideways period, sustained runs, either up or down, are unlikely. The Congestion-Phase System is only applied to markets within a trading range specifically defined by Nofri. Users are cautioned not to be too anxious to trade in a newly formed range until enough time has elapsed or a test of the support and resistance has failed. Readers will find that these rules are part of the Taylor Trading Technique, published much earlier, and discussed in Chapter 15, but without defining a congestion area.
Thetop of the congestion area is defined as a high, which is immediately followed by two consecutive days of lower closing prices; the bottom of the congestion area is a low price followed by two higher days. A new high or low price cancels the congestion area. Any two consecutive days with prices closing almost unchanged are considered as one day for the purposes of the system. In cases where the top or bottom has been formed following a major breakout or price run, a waiting period of 10 additional days is needed to ensure the integrity of the congestion area and limit the risk during more volatile periods. A congestion area is not formed until both a top
and bottom can be identified. Penetration of a previous top and formation of a new top redefine the range without altering the bottom point; the opposite case can occur for new bottoms. If a false breakout occurs lasting two or three days, safety suggests a waiting period of seven days. Logical stops can be placed at the top and bottom of the current congestion area, but closer stops could be formulated based on price volatility.
\section*{Implementing the Congestion-Phase System}
When programming the Congestion-Phase System, and many older strategies, you often find that the rules are not clearly defined. Some innovations and decisions need to be made. For this method, the greatest uncertainty was defining a "large move," after which we would wait 10 days before looking for a new signal. We defined the "large move" as any net price change over a 10-day interval that was at least two times larger than the average net change over 10 days for all past data. Our definition of a "false breakout" is any move above or below the congestion levels that reverted back into the congestion zone within two days.
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0349.jpg?height=122&width=146&top_left_y=1437&top_left_x=64)
For simplicity, no stop losses were used because trades are held for only one day. However, if we enter a new long position after two days down and the next day is also lower, then we close out the current trade with a loss but simultaneously reenter a new long at the same time because the " 2 - day down" rule continues to apply. Once you enter a long (or short), you continue to hold it until you have a 1-day profit or the price moves out of the
congestion zone. Because this strategy is applied only to sideways markets, there should not be too many "piggybacked" signals before an exit. The TradeStation program, TSM Nofri Congestion Phase, can be found on the Companion Website.
Figure 4.1 shows the signals from the program applied to wheat, which was chosen because it would have been a popular market when the strategy was first developed. Note that there were no signals during the rally in late September 2006 due to the "large move" rule. Performance was good for a surprisingly long period, although some markets showed large losses during the 2008 financial crisis. It may be necessary to add a highvolatility filter to avoid extremes in recent years.
The advantages of the Congestion-Phase System, even after more than fifty years, is the unique way it defines a sideways range, and that it is not based on trend following; therefore, it may complement other systems in a portfolio.
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0350.jpg?height=556&width=1328&top_left_y=1290&top_left_x=63)
FIGURE 4.1 Nofri's Congestion-Phase System applied to wheat, as programmed on TradeStation.
\section*{OUTSIDE DAYS AND INSIDE DAYS}
There are numerous chart patterns that can be profitable if they are properly identified and traded consistently. Unfortunately, any one pattern may not appear very often and traders may become impatient waiting for the opportunities. For others who feel that overall trading success is a combination of small victories, the outside day with an outside close (Figure 4.2c) is a good place to start.
\section*{Outside Days}
An outside day (Figure 4.2b) has the high and low outside the range of the previous day; that is, the high is higher and the low is lower. An outside close is an outside day with the closing price higher or lower than the prior day's high or low, respectively. This pattern represents a volatile day, often triggered by news, and is clearly resolved in one direction. If the close was in the direction opposite to a recent price move, it is also a key reversal day; \({ }^{:}\)however, this method does not attempt to find the current trend. A brief study by Arnold \({ }^{8}\) in 1984 showed that this pattern proved profitable for a small sample of currencies, metals, and financials using the following rules:
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0352.jpg?height=958&width=1341&top_left_y=64&top_left_x=64)
FIGURE 4.2 Four daily patterns.
1. Buy on the close of an outside day if the close is above the prior high; sell if the close is below the prior low.
2. If buying, place a stop-loss just below the low of the outside day; if selling, place the stop just above the high.
3. Close out the position on the close three days after entry (the result of testing from one to five days).
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0352.jpg?height=138&width=146&top_left_y=1695&top_left_x=66)
Times have changed and markets are generally noisier and often more volatile. In the 1970s and perhaps into the early 1980 os, this pattern was likely to work, but
not since the mid-198os. However, if you reverse the rules and sell when today's price closes above the previous high on a volatile day, your results are much better. A conditional exit, which includes profit-taking, is likely to improve results. The program TSM Outside Day with an Outside Close is available on the Companion Website. It allows you to test the number of days that the trade is held plus profit-taking based on the average true range. Results might be improved by removing trades during periods of low volatility because a wide-ranging day that follows a very narrow range may prove to have no forecasting value.
\section*{Inside Days}
Inside days (Figure 4.2a) can also be a predictor of direction. Prathap \({ }^{9}\) has identified the setup pattern
1. An upward day, \(C_{t-2}>C_{t-3}\)
2. Followed by an inside day, \(H_{t-1}<H_{t-2}\) and \(L_{t-1}>L_{t-2}\)
3. Followed by another upward day, \(C_{t}>C_{t-1}\)
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0353.jpg?height=126&width=146&top_left_y=1463&top_left_x=66)
as a short-term indicator of a continued upward move, especially for gold, silver, and crude oil. The reverse is true for downward moves. A program to test this is TSM 3-Bar Inside Day, available on the Companion Website.
\section*{Compression}
An extension of the inside day is compression, multiple days when the daily range is less than the range three or four days before. Figure 4.2d shows a 3 -day compression. Note that the compression days do not need to be inside the larger range day, only that the high-low ranges are smaller. Studies show that breakout signals following a few days of compression are more reliable.
Compression days are used as a filter for signals and do not constitute a system of its own. We will look at how compression performs later in this book, including Chapter 16, "Day Trading."
There is always the risk that a short period of compression is just an anomaly. When the price range expands, it may just be returning to normal volatility and not starting a new move. However, tests show that compression is a valuable pattern used in combination with short-term breakouts.
\section*{PIVOT POINTS}
A pivot point was defined in the previous chapter as the highest high price or a lowest low in the center of a number of days. Most often there are one to three days on either side of the pivot day. A pivot point can be used in the same way as a swing high or low, except that there is no minimum retracement needed, which adds a greater degree of flexibility to the patterns. It is also more restrictive than the swing high; therefore, the pivot point that requires more than three total days introduces a lag as a trade-off for confirmation.
1 The best application for pivot points is trend following, buying on an upward move through the previous pivot high and selling on a break through the previous pivot low. Although most uses of pivots points will focus on one to three days on each side of the pivot point, using longer periods, for example, 10 or 20 days, will give the performance the same appearance as a macrotrend program. A TradeStation program that generates trend signals, TSM Pivot Point Breakout, is available on the Companion Website along with an indicator, TSM Pivot Point, that plots the pivot points on a price chart, as seen in Figure 4.3.
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0355.jpg?height=608&width=1328&top_left_y=879&top_left_x=63)
FIGURE 4.3 U.S. 30-year T-bond prices showing pivot points above and below the price and buy and sell signals when there is a penetration of the previous pivot points, based on 5 days on either side of the pivot point.
\section*{ACTION AND REACTION}
Fundamentals may be the reason for the ultimate rise
and fall of prices, but human behavior creates the patterns that occur as prices find their level of equilibrium. Each move is a series of overreactions and adjustments. Elliott's Wave Principle is the clearest and most well-known of the theories founded entirely on this notion. Frank Tubbs. Stock Market Correspondence Course (written in the 1930s) is the first to define the magnitude of these reactions in his Law of Proportion; and, in 1975, the Trident System was based on both the patterns and the size of the action and reaction.
Retracement of a major bull move is the most familiar of the market reactions and the one to which almost every theory applies. Most analysts agree that a 100\% retracement, where prices return to the beginning of the move, is the most important support level. The \(100 \%\) figure itself is called unity, referring to its behavioral significance. The next most accepted retracement level is \(50 \%\), strongly supported by Gann. The other significant levels vary according to different theories:
Schabacker recognized an adjustment of \(1 / 3\) or \(1 / 2\), considering anything larger to be a trend reversal.
Angas anticipated 25\% reactions for intermediate trends.
Dunnigan and Tubbs looked at the larger \(1 / 2,2 / 3\), or \(3 / 4\) adjustments.
Gann took inverse powers of 2 as behaviorally significant: \(1 / 2,1 / 4,1 / 8, \ldots\)
Elliott based his projections on the Fibonacci ratio and its complement ( 0.618 and 0.382 ).
Predicting advances to higher or lower prices is based on the size of prior moves. Gann believed in multiples of the lowest historic price as well as even numbers; prices would find natural resistance at \(\$ 2, \$ 3, \ldots\), at intermediate levels of \(\$ 2.50, \$ 3.50, \ldots\), or at two to three times the base price level. Elliott looked at moves of \(1.618 \%\) based on a Fibonacci ratio, and a function of the previous price move.
\section*{Fibonacci Ratios}
Along with the most common \(1,1 / 2,1 / 3\), and \(1 / 4\) retracement values, Fibonacci ratios have the greatest following. Fibonacci ratios are found by dividing one number in the Fibonacci summation series:
\[
1,1,2,3,5,8,13,34,55,89,144,233
\]
by the preceding or following value. The series is formed beginning with the values 1,1 and adding the last two numbers in the series together to get the next value. The numbers in the series, especially those up to the value 21, are often found in nature's symmetry; however, the most important aspect of the Fibonacci sequence is the ratio of one value to the next. Called the golden ratio, this value \(F_{n} / F_{n+1}\) approaches 1.618 as \(n\) gets large. An unusual quality is that the inverse \(F_{n+1} / F_{n}=0.618\).
The golden ratio has a long history. The great pyramid of Giza, the Mexican pyramids, many Greek structures, and works of art have been constructed in the proportions of the golden ratio. These and other examples are given in
Chapter 14, where they are also shown in context with trading systems. In this section we recognize that many analysts who consider human behavior as the primary reason for the size of a price move and their retracements use the Fibonacci ratio 0.618 (also 1.618) or, less often, its reciprocal \(1-0.618=0.382\), as very likely targets.
Elliott is the most well-known advocate, and applications of his Wave Theory are filled with these ratios.
Retracement rules have not been proved scientifically but they are accepted by most traders. In general terms, the retracement theories, or revelation methods, can be categorized as either proportional retracements or time-distance goals. Proportional retracement states that prices will return to a level that is clearly related, by proportion or ratio, to the length of the prior price move. The larger the move, the clearer the retracement. The percentages and ratios expected to be successful are those that are most obvious: \(100 \%, 50 \%, 33 \%\), and so on, in addition to the Fibonacci ratio 1.618 and its inverse
0.618 . The time-distance rule is popularized in the works of Gann (also found in Chapter 14). Gann's retracement objectives can best be thought of as forming an arc of a circle, with the center at the recent price peak. The goal is satisfied when prices that follow touch any point on the circle.
Practically speaking, it is unrealistic to expect retracement levels to be reached exactly; therefore, when making this fully systematic it is better to allow for the targets to be slightly closer or use multiple targets to avoid depending on a single number.
\section*{Tubbs' Law of Proportion}
The technical part of Frank Tubbs' course in stock market trading is intense chart interpretation. The Law of Proportion presented in Lesson 9 is a well-defined action-and-reaction law. In cases where the nearby highs or lows of a swing were not broken, Tubbs claims four out of five successful predictions with his principle. The law states:
Aggregates and individual stocks tend to run on half, two-thirds, three-fourths of previous moves. First in relation to the next preceding move which was made. Then in relation to the move preceding that.
Applied to a stock trading at \(\$ 20\), an initial move from \(\$ 20\) to \(\$ 26\) would react \(1 / 2\) to \(\$ 23,2 / 3\) to \(\$ 22\), or \(3 / 4\) to \(\$ 21.50\). Tubbs does allow for traditional price support as a major obstacle to the proportional price retracement, and so unity (a \(100 \%\) retracement) may be added to the three targets. Figure 4.4 shows subsequent reactions to the stock move just described; the second reversal could be any of three values (or back to major support at \(\$ 20.00\) ), ending at \(\$ 21.50\), a \(3 / 4\) reversal. Reversals 3,4 , and 5 are shown with their possible objectives. The last reversal, 5 , becomes so small that the major support levels (horizontal broken lines) are considered as having primary significance, along with proportions of moves 1 and 2. Major support at \(\$ 20.00\) coincides with \(1 / 2\) of move 1 and \(2 / 3\) of move 2 . This would normally be sufficient to nominate that point as the most likely to succeed. Tubbs indicates that these points rarely occur
with exactness, but proportions serve as a valuable guideline. The principle is one of reaction in relationship to an obvious preceding action.
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0360.jpg?height=990&width=1333&top_left_y=276&top_left_x=58)
FIGURE 4.4 Tubbs' Law of Proportion.
\section*{Trident}
The Trident Commodity Trading System received its fair share of publicity when it was introduced at the beginning of 1975. 10 The object of the system is to trade in the direction of the main trend but take advantage of the reactions (or waves) to get favorable entry and exit points. These same entry concepts were discussed as early as 1942 by W. D. Gann and in the preceding section by Tubbs. As with Gann, the goal is to predict where the
reactions will occur and what profit objective to set for each trade.
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0361.jpg?height=729&width=1323&top_left_y=215&top_left_x=69)
\section*{FIGURE 4.5 Trident entry-exit.}
Trident's approach is easy to understand: Each wave in the direction of the main trend will be equal in length to the previous wave in the same direction. The target is calculated by adding this distance to the highest or lowest point of the completed reaction. Forecasting the tops and bottoms of the waves is dependent on the time period used; the complex form of primary and intermediate waves, as in Elliott's principle, would hold true with Trident (see Figure 4.5).
Because there are inaccuracies in the measurement of behavioral phenomena, Trident emphasizes the practical side of its theory by offering flexibility in its choice of entry and exit points. By entering after \(25 \%\) of the anticipated move has occurred and exiting \(25 \%\) before the target, there is ample time to determine that the
downward reaction has ended before your long position is entered, and enough leeway to exit well before the next reaction. A critical point in each main trend is midway between the start of the move and the target. If the midpoint is not reached, main trend and the reactions are reevaluated. A change in the direction of the trend is finalized if a reversal equal in size to \(25 \%\) of the last reaction occurs during what was expected to be an extension of the main trend. That \(25 \%\) value becomes the trailing stop-loss on any trade in the event the objective is not reached.
This discussion is only intended to be a brief description of Trident's essential ideas. The actual system has other rules for target selection, major and minor trends, and corrective moves, and includes points to reverse positions based on the trailing stop. However, the main premise must hold up if the strategy is to be successful.
A later bulletin to Trident users suggested changes to their money management approach. Using a technique similar to Martingale, each loss is followed by an increase in the size of the next position. The trader only has to continue to increase his positions and stay with the system until he wins. A comprehensive version of this classic gambling approach can be found in the sections "Martingales and Anti-Martingales" and "Theory of Runs," both in Chapter 22. The unique concept for Trident is capturing the middle \(50 \%\) of the trend. The idea of increasing your position size following each loss will eventually result in ruin.
\section*{An Overview of Percentage Retracements}
The last few sections have discussed specific retracement levels advocated by past market analysts. This section takes a more general approach to percentage retracements, applying these levels to soybeans and the \(\mathrm{S} \& \mathrm{P} 500\).
\section*{Retracements Less than 100\%}
There is a significant difference between a full retracement (100\%) and a partial retracement. A full retracement negates the underlying reason for the previous move. But what is the significance of a \(50 \%\) retracement? Retracements are a common occurrence. They have been compared to the ebb and flow of the tides. Investors buy until they have bought too much, then the sellers come in to correct the overbought situation until the price is back to a level that attracts more buying.
The previous sections have discussed retracements of \(50 \%, 33 \%, 25 \%\), and \(12.5 \%\), as well as \(61.8 \%\) and \(38.2 \%\). The obvious problem is that, if there are so many possible retracement levels, then the price is likely to stop at one of them, even if by chance. Without other information, the most successful retracements are most likely to be the larger ones. Then \(100 \%\) is the most important and \(50 \%\) is the next most likely. After that there is \(33 \%\) and \(25 \%\), each of less importance, with \(12.5 \%\) too small to consider seriously. Fibonacci ratios are an exception; there seems to be evidence for expecting mass behavior to be reflected in these ratios.
Including Fibonacci, the most important retracements
are \(100 \%, 50 \%\), and \(61.8 \%\). Figure 4.6 shows one of each primary retracement on a weekly soybean chart during a 4-year period from 1976 to 1980. Markets that have high volume are most likely to conform to standard retracements. This means that index markets, such as the S\&P 500, would also show 50\% and 61.8\% pullbacks, but individual stocks may not. Broad participation is a requirement.
\section*{S\&P Retracement Levels}
S\&P futures, and now the sector SPDR SPY, have excellent liquidity; therefore, we would expect retracement levels to conform to the rule of large numbers. Unlike an agricultural product, or a stock with a strong seasonality, the \(S \& P\) is not likely to retrace \(100 \%\) of a longer-term move. We expect that the core inflation rate, added to the investment bias that exists in the United States, will cause a steady rise in the overall price of stocks. Figure 4.7 shows the first part of the bear market that began in 2000. The swing highs and lows are marked with letters beginning with \(A\) and \(C\) at the top, with \(B\) the low between them. The breakdown of the support line drawn horizontally from \(B\) results in prices reaching \(D\), a decline of \(100 \%\) of the range from \(A\) to \(B\), followed by a retracement of \(50 \%\) back to \(E\) (support becomes resistance). Throughout the decline we can find numerous examples of retracement that conform to the expectations of \(100 \%, 50 \%\), and less important, \(62 \%\).
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0365.jpg?height=847&width=1327&top_left_y=63&top_left_x=63)
FIGURE 4.6 Soybean retracements in the late 1970s.
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0365.jpg?height=847&width=1331&top_left_y=1026&top_left_x=61)
FIGURE 4.7 S\&P retracement levels.
Each retracement level is a trading opportunity. If a rally is expected to stop at a \(50 \%\) retracement, a short sale could be entered at that price. But anticipating a top and selling into a rising market has a high degree of risk. Price movement is not so precise that you can anticipate a target with a great degree of confidence. Targeting a profit level and exiting a trade is considered safe and sensible, because you are removing risk, but buying into a new position when prices are falling quickly is comparable to stepping in front of a moving train. Entering a new trade on a retracement is considered best when there is a confirmation that prices have stopped at that retracement level. This may manifest itself as slowing price movement, declining volatility, or declining volume occurring at a point very close to your expected retracement level. If prices don't stop, but continue with increasing volume, then you quickly close out the trade and try again later. Common sense is needed in addition to a retracement target.
Interesting observations were made by Tom DeMark \({ }^{11}\) about identifying the price move that serves as the basis for measuring retracements. If the market is currently at a low, rather than judging the distance of this drop from the most recent swing high, he chooses to look for the highest point that has occurred since the last time the market traded at this low level, thereby eliminating obsolete data. He then finds the most likely retracement points using the Fibonacci ratios o.618 and 1.618, plus Fibonacci "alternative" ratios \(0.382,0.50,1.382,2.236\), and 2.618 applied to the difference between the high and low, added to the current low price.
\section*{Trading at Even Numbers}
It is said that prices advance and decline to even numbers. A stock is more likely to stall at \(\$ 10\) than at \(\$ 9.25\); the price of gold resisted moving below \(\$ 1,000\), but once it had traded lower, it struggled to go back above \(\$ 1,000\). A study by the New York Federal Reserve confirms the increase in trader activity around even numbers.
It makes sense that investors are more likely to place orders at even numbers. Active traders and longer-term investors do not usually tell a broker to buy IBM at \(\$ 153.20\) but would more likely buy at \(\$ 152\) or \(\$ 153\). Even more investors would choose \(\$ 150\) or \(\$ 155\). When Martha Stewart placed her now well-known order to sell ImClone stock, it was at \$60, not at an odd value.
A trader can take advantage of this obvious bias for placing orders by avoiding even numbers and looking for free exposure when prices move through those levels. Moves through even numbers can be thought of as minor breakouts. If you want to sell short ImClone on a break below \(\$ 60\), place your sell order at \(\$ 60.25\) to be ahead of the crowd and take advantage of a fast drop caused by the bunching of orders at even numbers.
\section*{PROGRAMMING THE CHANNEL BREAKOUT}
The classic upward channel is formed by drawing a straight line along the bottom points of an upward trend, then constructing a parallel line that touches the extreme
high price of that same time interval, forming an envelope, or channel, around a price move. This construction was shown in Chapter 3 (see Figure 3.11). For a downward channel the trendline is first drawn through the high points of the declining price pattern, then a parallel line is drawn across the lowest low price of that interval. It is easy to do this with a chart and a ruler, and easy with drawing tools on a screen, but not as simple to transfer this concept to a computer program. Because a channel breakout is a basic trading strategy, an automated version may prove useful for identifying key market turning points.
1. Put the date in column A , a sequential number 1,2, \(3, \ldots\) in column B (call that value \(X\) ), and the closing price in column C.
2. Select a starting date on which you think prices are beginning a new direction, or a date that indicates the start of an existing trend. A new swing high above the previous swing high or swing low below the previous swing low might indicate that direction. A more general approach would be to use a rolling \(n\)-day period and test that the slope of the regression is angled enough to indicate a trend or that the "goodness of fit" is satisfied.
3. Using the regression tool in Excel, located in the Data menu, assign the closing prices (column C) to \(Y\) (the dependent variable), and the sequential numbers in column B to \(X\) (the independent variable) ending at the most recent data and starting at your selected date or \(n\) days ago. We can't use the
date for X because it has gaps due to weekends, which would cause an incorrect answer. Solve for \(a\) and \(b\), the slope and \(y\)-intercept. Once you have the \(a\) and \(b\) values, any point \(y\) on the regression line can be found using:
Straight line values, \(y=a \times X+b\), where \(X\) is the sequential number
4. Find the maximum and minimum residuals. For each closing price, subtract the corresponding value of \(y\). Save the maximum and minimum values as Rmax and Rmin.
5. Calculate the most recent value of the upper and lower bands, \(U=y(n)+\mathrm{Rmax}\) and \(L=y(n)-\mathrm{Rmin}\)
6. Project the bands one period ahead. In order to know whether tomorrow's price has broken through the channel, indicating a change of trend, we project the channel one period ahead using the slope value, \(a\),
\section*{Projected upper channel band at \(n+1=U+a\) Projected lower channel band at \(n+1=L-a\)}
Figure 4.8 shows a clear downward channel with the regression line through the center, the resistance line parallel to the regression line touching the highest residual, and the support line also parallel, touching the lowest residual.
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0370.jpg?height=1067&width=1329&top_left_y=60&top_left_x=62)
FIGURE 4.8 Trading a declining channel.
Decide if you are using the low or the close to signal a downward break of an upward trendline (slope \(a>0\) ). The close is more conservative, but the low will give a signal sooner. If the trend is up and the next close is below the projected lower band, then the trend has turned down. If the trend is down \((a<0)\) and the next close (or high) is greater than the projected upper band, then the trend has turned up. When the slope, \(a\), is very near zero, we have a sideways channel, but the same rules still apply.
\section*{Trading the Channel}
Because a major channel is considered a strong chart formation, prices that approach the channel, but have not penetrated the band, would be candidates for a countertrend entry. For example, if the trend is down and prices come within \(15 \%\) of the upper band (based on the channel width), we would enter a new short position (see Figure 4.8) or add to existing short sales. We do not necessarily want to cover those existing shorts at the bottom of the channel, especially if the downtrend is severe, because prices may continue lower; however, this technique offers a clear and safe way to scale into a trade with more than one entry point. The trade is closed out if the price breaks above the upper channel line in a downtrend or the lower channel line in an uptrend. If the trend is sideways (the slope is near zero), then exiting shorts and reversing to a long position is the preferred strategy. One note of caution: All trends turn sideways as they reverse direction. For a sideways market, the rate of change of the price should also be small.
\section*{MOVING CHANNELS}
Channels are frequently constructed as moving bands around prices. Some of these, such as those using a standard deviation, can claim statistical significance (see "Bollinger Bands" in Chapter 8). A simple mathematical way of representing a moving channel \((M)\) uses the average of the high, low, and close to designate the center of daily prices; the upper and lower bands are constructed using the average daily range (or true range), \(R\). The moving midpoint \(M\) and range \(R\) can be calculated for each day \(i\) over the past \(n\) days as:
\[
\begin{aligned}
& M_{t}=\frac{1}{3 n} \sum_{i=t-n+1}^{t}\left(H_{i}+L_{i}+C_{i}\right) \\
& R_{t}=\frac{1}{n} \times \sum_{i=t-n+1}^{t}\left(H_{i}-L_{i}\right)
\end{aligned}
\]
Then the upper and lower channel bands are formed by adding and subtracting \(1 / 2 R\) to the midpoint \(M\), and the forecast for the next day will project the path of the midpoint and apply a multiple of the range ( \(f\) ) for scaling:
\[
\begin{aligned}
U_{t+1} & =M_{t}+\left(M_{t}-M_{t-1}\right)+f \times \frac{R_{t}}{2} \\
L_{t+1} & =M_{t}+\left(M_{t}-M_{t-1}\right)-f \times \frac{R_{t}}{2}
\end{aligned}
\]
A long position is entered when the new price \(p_{t+1}>U_{t+1}\); a short is entered when \(p_{t+1}<L_{t+1}\). If a profit objective is needed, it can be calculated at a point equal in distance to the channel width from the channel breakout as follows:
Long objective (upper band), \(U O_{t+1}=U_{t+1}+f \times \frac{R_{t}}{2}\)
\[
\text { Short objective (lower band), } L O_{t+1}=L_{t+1}-f \times \frac{R_{t}}{2}
\]
The objective should remain fixed at the price level determined on the day of the breakout, or preferably, the point of breakout remains fixed but the distance to the profit target will change based on the current average true range (Figure 4.9). In that way, it would adjust to changing price volatility. More examples can be found in Chapter 20.
An alternative way of defining a channel would be to forecast one day ahead using the slope of a regression analysis and use the standard deviation of the price changes times a factor, to define the band. The other rules would remain the same. \({ }^{12}\)
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0374.jpg?height=1178&width=1323&top_left_y=63&top_left_x=63)
Day \(t\)
FIGURE 4.9 Channel calculation.
\section*{COMMODITY CHANNEL INDEX}
TheCommodity Channel Index (CCI) isn't necessarily for commodities and uses a channel only in the broadest sense. Instead, it is a measure of the deviation of the current price from the average of the previous \(n\) days. It is considered best for mean reversion trading. First, find the average of the daily high, low, and close, \(M\). Find the average of \(M\) over the past \(n\) days (call it \(A D P\) ):
\[
\begin{aligned}
M_{t} & =\frac{H_{t}+L_{t}+C_{t}}{3} \\
A D P_{t} & =\frac{\sum_{t=-n+1}^{t} M_{t}}{n}
\end{aligned}
\]
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0375.jpg?height=44&width=51&top_left_y=431&top_left_x=807)
Then calculate the average deviation ( \(A v g D e v)\) over the same \(n\)-day interval:
\[
A v g D e v_{t}=\frac{\sum_{i=t-n+1}^{t}\left|M_{i}-A D P_{i}\right|}{n}
\]
Then \(C C I_{t}\) is the ratio of today's deviation divided by a fraction of the average deviation:
\[
C C I_{t}=\frac{\left(M_{t}-A D P_{t}\right)}{0.015 \times A v g D e v_{t}}
\]
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0375.jpg?height=121&width=150&top_left_y=1318&top_left_x=64)
This can be easily done in a spreadsheet and plotted with the underlying price. The full spreadsheet, TSM Commodity Channel Index HPQ, can be found on the Companion Website.
The CCI is essentially a variation on a standard deviation channel. When price becomes overbought during a strong upward move (price above the channel), it can stay that way for weeks at a time. Simple rules for buying and selling oversold and overbought prices will give
frequent small profits and an occasional very large loss.
\section*{WYCKOFF'S COMBINED TECHNIQUES}
Richard D. Wyckoff, popular in the early 1930s and still discussed today, relied solely on charts to determine the motives behind price behavior. He combined the three most popular methods - bar charting, point charts (the predecessor of point-and-figure charts), and waves - to identify the direction, the extent, and the timing of price behavior, respectively. 13
To Wyckoff, the bar chart combined price and volume to show the direction of the price movement. In general terms, it shows the trading ranges in which supply and demand are balanced. The volume complemented this by giving the intensity of trading, which relates to the quality of the long or short position. Wyckoff used group charts, or indices, in the manner of Charles Dow, to select sets of stocks with the most potential, rather than looking only at individual stock price movement. This assures that the move is based on the broader nature of business health, rather than on individual company dynamics. In today's market we can use the S\&P 500 or sector ETFs to accomplish the same objective.
Point-and-figure charts are used to condense price action. If prices move from lower to higher levels due to events, the time it takes to reach the new level is unimportant. Point-and-figure charts record events, not time. As long as prices rise without a significant reversal, the chart uses only one column; when prices change direction, a new column is started (see the point-and-
figure and the swing trading sections in Chapter 5). Price objectives can be determined from formations in a pointand-figure chart and are usually related to the length of the sideways periods, or horizontal formations. Wyckoff preferred these objectives to the comparable bar chart formations.
The wave chart, similar to Elliott's theories (discussed in Chapter 14), represents the behavior of investors and the natural rhythm of the market. Wyckoff uses these waves to determine the points of buying and selling within the limitations defined by both the bar chart and point-andfigure charts. He considered it essential to use the wave charts as a leading indicator of price movement.
Wyckoff used many technical tools but none rigidly. He did not believe in unconfirmed fundamentals but insisted that the market action was all you needed - the market's primary forces of supply and demand could be found in charts. He did not use triangles, flags, and other formations, which he considered to be a type of Rorschach test, but limited his analysis to the most basic patterns, favoring horizontal formations or congestion areas. He used time-based and event-based charts to find the direction and forecast price movement, then relied on human behavior (in the form of waves) for timing. His trading was successful, and his principles have survived.
\section*{COMPLEX PATTERNS}
Most charting systems involve a few simple rules, trying to model a price pattern that seems to have repeatedly
resulted in a profitable move. The most popular systems are trend breakouts, either a horizontal pattern or a trend channel. Over the years these approaches have proved to be steady performers. Another group of traders might argue that is it better to be more selective about each trade and increase the expectation of a larger profit than it is to trade frequently in order to win "in the long term" - that is, playing a statistical numbers game.
\section*{DeMark's Sequential \({ }^{\text {TM }}\)}
Tom DeMark created a strategy, called a sequential, that finds a very overextended price move, one that is likely to change direction, and takes a countertrend position. \({ }^{14}\) His selling objective is to identify the place where the last buyer has bought. His rules use counting and retracements rather than mathematical formulas and trendlines. To get a buy signal, the following three steps are applied to daily data:
1. Setup. To begin, there must be a decline of at least nine or more consecutive closes that are strictly lower than the corresponding closes four days earlier \(\left(\right.\) close \(_{t}<\) close \(_{t-4}\) ). If any day fails, the setup must begin again.
2. Intersection. To assure that prices are declining in an orderly fashion, rather than plunging, the high of any day on or after the eighth day of the setup must be greater than the low of any day three or more days earlier. Note that there can be a delay before the intersection occurs provided that the pattern is not negated by the rules in step 3 .
3. Countdown. Once the setup and intersection have been satisfied, count the number of days in which the close was lower than the close two days ago \(\left(\right.\) close \(_{t}<\) close \(\left._{t-2}\right)\). The days that satisfy this countdown requirement do not need to be continuous. When the countdown reaches 13 , we get a buy signal unless one of the following conditions occurs:
a. There is a close that exceeds the highest intraday high that occurred during the setup stage.
b. A sell setup occurs (nine consecutive closes above the corresponding closes four days earlier).
c. Another buy setup occurs before the buy countdown is complete. In this case the rules begin again at step 2. This condition is called recycling.
A sequential buy signal is shown in Figure 4.10 for the Deutsche mark (now the euro). The sell signal is the reverse of the buy. Traders should expect that the development of the entire formation will take no less than 21 days, but typically 24 to 39 days.
Deutsche Mark
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0380.jpg?height=1157&width=1331&top_left_y=124&top_left_x=61)
FIGURE 4.10 A sequential buy signal in the Deutsche mark.
Source: Data from Logical Information Machines, Inc. (LIM), Chicago, IL.
\section*{Entering the Sequential}
Once the buy signal occurs there are three choices for entering the market. The first is to enter on the close of the day on which the countdown is completed; however, this risks a new setup situation which will extend the conditions for an entry. The second requires a
confirmation of price direction, the close greater than the close four days ago, but it avoids the possibility of recycling. The third is to enter a long when the close is greater than the high two days earlier, a compromise between the first two techniques.
\section*{Exiting the Sequential}
A number of exit conditions provide the trader with clear rules to liquidate the current trade. First, the current buy setup is complete and the lowest price recorded does not exceed the furthest price recorded by the recent inactive setup (normally the previous sell setup). If, however, any price recorded in the current buy setup exceeds the furthest price of the previous sell setup, then the position is held until a reverse signal occurs.
Two stop-losses are recommended. For a buy signal, the true range of the lowest range day of the combined setup and countdown period is subtracted from the low of that lowest day to create a stop-loss. Alternatively, the difference between the close and the low of the lowest day is subtracted from the low of the lowest day for a closer stop-loss.
\section*{Thinking about Complex Patterns}
There is an extreme contrast between the simplicity of a horizontal breakout and the very complex set of rules that produce a signal for DeMark's sequential. The basic breakout system can be tested for robustness by comparing the performance of slightly longer and shorter calculation periods. As the calculation period
becomes larger, there are fewer trades, the profits per trade become larger, and the overall performance profile improves. In the case of DeMark's sequential, there is no way to measure robustness in the same terms. For the sequential, there is only one count of 13 days and 1 pattern. Only time will decide whether this pattern, or any other complex set of rules, produces a better set of trades.
\section*{COMPUTER RECOGNITION OF CHART PATTERNS}
A credible attempt to quantify charting patterns and assess their value was published by Lo, Mamaysky, and Wang. \({ }^{15}\) The authors applied kernel regression as a smoothing technique, then defined 10 charting formations in the context of the smoothed price series. For example, a head-and-shoulders top formation is defined in terms of the most recent five local maxima and minima in the smoothed series, \(E_{1}, E_{2}, E_{3}, E_{4}\), and \(E_{5}\). In the definitions of the tops, which follow, \(E_{1}\), \(E_{3}\), and \(E_{5}\) are maxima and \(E_{2}\) and \(E_{3}\) are minima; for the bottom formations, which are not shown, \(E_{1}, E_{3}\), and \(E_{5}\) would be minima and \(E_{2}\) and \(E_{3}\) the maxima.
\section*{Head-and-Shoulders Top:}
\(E_{3}>E_{1}, E_{3}>E_{5}\) (the middle maxima is greater than the left and right)
\(E_{1}\) and \(E_{5}\) are within \(1.5 \%\) of their average (the highs are not more than \(3 \%\) apart)
\(E_{2}\) and \(E_{4}\) are within \(1.5 \%\) of their average (the lows are within \(3 \%\) )
\section*{Broadening Top:}
\[
\begin{gathered}
E_{1}<E_{3}<E_{5} \\
E_{2}>E_{4}
\end{gathered}
\]
\section*{Triangular Top:}
\[
E_{1}>E_{3}>E_{5}
\]
\[
E_{2}<E_{4}
\]
\section*{Rectangular Top:}
1. Tops are within \(0.75 \%\) of their average
2. Bottoms are within \(0.75 \%\) of their average
3. Lowest top > highest bottom
\section*{Double Top:}
\(E_{1}\) and \(E_{b}\) are within \(1.5 \%\) of their average, where \(E_{1}\) is a maxima
\section*{\(t_{a}^{*}-t_{1}^{*}>22\)}
The identification of formations used a rolling window of 38 trading days; the notation \(t_{1}\) represents the first day of the current window, 37 days back. We interpret the notation \(t_{a}^{*}-t_{1}^{*}>22\) to mean that the two extrema \(E_{1}\) and \(E_{b}\) must be separated by more than 22 days. In the triangular formations, the key points used to identify the pattern did not align to form classic straight-line sides; however, the consolidating formation that was recognized is itself a good candidate for analysis.
Although the definitions are logical, the authors accept the differences between a mathematical definition of a charting formation and the visual, cognitive approach taken by a technical analyst. The human brain can assimilate and recognize more complex and subtle formations than the simple definitions presented in the paper. Then, on the one hand we have a somewhat limiting definition of chart patterns, and on the other we have the way in which humans select which patterns they choose to trade. It is far from certain which approach will yield the best returns.
The success of the formation was measured by the returns over the three days immediately following identification. In addition, the formations were conditioned on the trend of volume; that is, returns were separated into formations that develop with increasing or decreasing volume.
\section*{Results of the Study}
Tests were performed on several hundred U.S. stocks traded on both the NYSE and NASDAQ, from 1962 through 1996. The most common formations, the double top and double bottom, showed more than 2,000 occurrences of each. The next most frequent were the head-and-shoulders top and bottom, with over 1,600 appearances each. As a control, a random, synthetically created price series was also tested and showed only \(1 / 3\) the number of head-and-shoulders formations. It argues that charting patterns are formed by the actions of the participants rather than by random events. Based on the number of stocks tested, the head-and-shoulders formation appeared about once each year for each stock.
All but one of the chart formations (the triangular top) showed positive returns for the three days following the identification of the formation. Of these, five were rated as statistically significant: the head-and-shoulders top, the broadening bottom, the rectangular top, the rectangular bottom, and the double top.
When formations were conditioned on rising or declining volume, the results changed for some of the patterns. In general, rising volume improved results. Falling volume was better for the head-and-shoulders top, and the rectangular top and bottom. Most analysts would expect rising volume to favor a breakout of bottom formations and declining volume to improve most top formations.
On the whole, technical analysts would not be disappointed with the conclusions of this study. Although the chart patterns may not meet the strict
definition set by an experienced technician, they did capture the spirit of the formation and showed that positive returns followed. Confirmation is gratifying; any other conclusion would have been ignored.
For those not as mathematically gifted, but adept at computer programming, many of these formations can be created using the highs and lows generated from a swing chart, which is easily automated (a program is provided in Chapter 2). A trendline can be found using a least-squares regression through a series of swing highs or lows, qualified by a minimum variance. A triangle would be alternating swing highs and lows that get closer together. It is all within our reach and new programs continue to improve.
\section*{Bulkowski's Chart Pattern Rankings}
A particularly helpful section in Bulkowski's Encyclopedia of Chart Patterns is the summary at the end, where he ranks all the chart patterns by their success in forecasting price moves. The best five bullish formations are:
1. Upward breakout of a rectangular top
2. Upward breakout from a falling wedge
3. Upward breakout from an ascending triangle
4. Upward breakout from a double bottom
5. Upward breakout of a symmetric triangle after a downward move
For clarity, a rectangular top has multiple tests of a
resistance level before the breakout, and a double bottom breaks out when the price goes above the highest price that occurred between the two lows making up the double bottom. The breakout of a symmetric triangle formed during a downtrend is typically down and is said to confirm the existing trend. Bulkowski's study shows that it performs the opposite way, and with high reliability.
The best five bearish patterns are:
1. Descending scallops
2. Downward breakout of a symmetric triangle in a downtrend
3. Downward breakout of a broadening top
4. Downward breakout of a right-angled, descending, broadening formation
5. Downward breakout of a broadening bottom
Unlike the bullish formation, these seem dominated by broadening formations. For those unfamiliar with the descending scallop, an obscure formation, the scallop looks like a fishhook with the long stem to the left and the hook to the right. Attached to the end of the hook is another hook, also facing to the right, so that there is a series of longer declines and a shorter rounded recovery before another longer decline and rounded recovery.
A broadening top shows alternating swings getting larger, and is interpreted as a sideways pause during an uptrend. With a right-angled, descending, broadening formation there is a somewhat horizontal top (the right-
angle) to the swing highs and a broadening bottom before the downward break. A broadening bottom is similar to a broadening top but occurs during a downward price trend.
It is interesting that the broadening formations are more reliable when they break out to the downside. On the other hand, the symmetric triangle is the most dependable chart pattern because it forecasts a reliable price move whether it breaks to the upside or downside.
\section*{Testing the Candlestick Patterns}
Bulkowski followed his standard chart analysis with tests of candlestick patterns. \(\frac{16}{}\) He evaluated 412 combinations of 101 candle patterns, of which 100 , or \(24 \%\), qualified as being successful at least \(60 \%\) of the time. When those patterns were filtered for at least 51 occurrences, the number of successful patterns dropped to 10\%. Our normal reaction is that the successful patterns should also be simple. They are shown in Figure 4.11.
1. Above the stomach. A reversal pattern following at least two black candles, where the white candle opens within the previous black candle and closes above the high of the previous black candle.
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0389.jpg?height=800&width=478&top_left_y=56&top_left_x=542)
Figure 4.11a Above the stomach.
2. Belt hold, bearish and bullish. A reversal pattern. In the bullish formation the last black candle is followed by a tall white candle, with the high of the candle below the low of the previous low candle. Similar to a key reversal day. It performed well as a reversal.
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0390.jpg?height=732&width=827&top_left_y=54&top_left_x=370)
Figure 4.11b Bullish belt hold.
3. Deliberation. After an upward move, two white candles followed by a smaller white candle in which the body is fully above the body of the previous white candle. It is intended to be a reversal pattern but instead, it forecasted a continuous upward move \(75 \%\) of the time.
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0391.jpg?height=660&width=478&top_left_y=189&top_left_x=544)
Figure 4.11c Deliberation.
4. Doji star, bearish. An intended reversal pattern following a series of white candles, the low of the bar is above the last candle and the open and close are at the same price, showing a horizontal bar for the body. While it appears that the move has faltered, tests showed that prices continued higher \(69 \%\) of the time. The trend wins.
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0392.jpg?height=647&width=1246&top_left_y=98&top_left_x=156)
Figure 4.11d Morning doji star and evening doji star.
5. Engulfing, bearish. A common reversal pattern where a black candle is an outside day following a white candle and a series of higher candles. While reliable, the reversal is often small.
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0393.jpg?height=1590&width=617&top_left_y=57&top_left_x=479)
Figure 4.11e Bearish engulfing.
6. Last engulfing bottom and top. Both of these formations are intended to be a reversal pattern. For the bottom, where a black candle engulfs a previous
white candle (an outside day), tests show that it is a reliable indicator of a continued downtrend. The top formation strongly favored a continuation higher.
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0394.jpg?height=431&width=310&top_left_y=267&top_left_x=628)
Figure 4.11f Last engulfing top.
7. Three outside up and down. The up formation is a gap down after a price decline, forming a black candle fully below the previous candle. This is followed by an engulfing white candle, then another white candle. Both patterns performed well as reversals, but downward breakouts were best.
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0394.jpg?height=604&width=467&top_left_y=1188&top_left_x=550)
Figure 4.11g Three outside up.
8. Two black gapping candles. A downward move followed by a gap, then two black candles. This pattern performed well as a bullish reversal.
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0395.jpg?height=546&width=310&top_left_y=270&top_left_x=628)
Figure 4.11h Two black gapping.
9. Rising and falling windows. Similar to a running gap, where the rising window has a black candle following a rising pattern, and the body is fully above the previous candle high, then followed by a gapping black candle. Both rising and falling windows performed well as continuation patterns.
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0395.jpg?height=620&width=568&top_left_y=1313&top_left_x=499)
Figure 4.11i Rising window.
While these patterns were ranked as frequently successful, they give no indication of the length or success of the price move that followed.
\section*{NOTES}
1 William Dunnigan, Selected Studies in Speculation (San Francisco: Dunnigan, 1954), p. 7.
2 W. D. Gann, How to Make Profits in Commodities (Pomeroy, WA: Lambert-Gann, 1976). This book devotes a large section to swing charts and includes many examples of markets prior to Dunnigan's work.
3 Murray Ruggiero, "Dunnigan's Way," Futures, November 1998.
4 Each of his writings on systems contained examples of multiple-fund management of varied risk.
5 Refers to the Greek description of Fibonacci ratios.
6 A republication of Nofri's method (2010) is available on www.successincommodities.com.
\({ }_{7}\) See the discussion of key reversals in Chapter 3.
\(\underline{8}\) Curtis Arnold, "Your Computer Can Take You Beyond Charting," Futures (May 1984).
9 Johnan Prathap, "Three-Bar Inside Bar Pattern," Technical Analysis of Stocks \& Commodities (March 2011).
10 Charles L. Lindsay, Trident: A Trading Strategy (Windsor Books, 1976; Trident Systems Publications, 1991).
11 Thomas R. DeMark, "Retracing Your Steps," Futures (November 1995). Also see Chapter 2 of DeMark, The New Science of Technical Analysis (New York: John Wiley \& Sons, 1994).
12 For a further discussion of channels, see Donald Lambert, "Commodity Channel Index," Technical Analysis of Stocks \& Commodities (October 1980), and John F. Ehlers, "Trading Channels," Technical Analysis of Stocks \& Commodities (April 1986).
13 Jack K. Hutson, "Elements of Charting," Technical Analysis of Stocks \& Commodities (March 1986).
14 Thomas R. DeMark, The New Science of Technical Analysis (New York: John Wiley \& Sons, 1994).
15 Andrew W. Lo, Harry Mamaysky, and Jiang Wang, "Foundations of Technical Analysis: Computational Algorithms, Statistical Inference, and Empirical Implementation," Journal of Finance (August 2000).
16 Thomas Bulkowski, The Encyclopedia of Candlestick Charts (Hoboken: John Wiley \& Sons, 2008), Chapter 1.
\section*{CHAPTER 5}
\section*{Event-Driven Trends}
Trends are sustained moves in one direction. In the previous chapters, an upward trend was identified by drawing an upward angling line under the lows of a rising price formation. Time is an important factor. The price for each week, each day, or each bar is plotted to the right of the last price. Like the ticking of a clock, prices must continue to move. If they stop, the trend is over. But there are methods of recognizing the trend that ignore time. This chapter will look at those methods.
A price trend can be thought of as an accumulation of reactions to news and economic reports - that is, a series of large and small jumps in price. In between, traders anticipate that the trend direction will continue. For some systems, it is only when the accumulation of positive or negative news drives prices to new highs or lows that is important. Anything in between is ignored. These methods include the breakout, point-and-future, and swing trading. The shorter the period of observation, the more sensitive the system and the more frequent the trades.
There is no math required, simply the idea that, if prices moved to a new high or new low, then something important has happened. This approach appeals to our common sense and has proved to be a successful strategy. As you progress through this book and become
familiar with more complex and mathematically intricate techniques, continually ask yourself to what degree the newer methods have improved on the older, simpler ways of recognizing a trend.
\section*{SWING TRADING}
A price swing is a price movement up or down by a preset minimum size (the swing filter). A new upward swing starts when prices reverse from the lows by the filter size. New highs are recorded until prices turn down from the swing high by the swing filter amount. Once the direction is down, new lows are recorded until the price turns up from the swing low by the swing filter amount. The distance from any swing high to the next swing low is no smaller than the swing filter. With a large filter, you can choose to plot only the major price moves, or, using a small filter you can fill the chart with frequent price reversals. The swing filter can be expressed in cents, dollars, or as a percentage of the current stock or commodity price.
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0399.jpg?height=588&width=1328&top_left_y=1357&top_left_x=65)
FIGURE 5.1 Gold futures with \(2.5 \%\) swing points marked.
Figure 5.1 shows a bar chart of gold futures with points above and below the bars representing the swing highs and lows based on a \(2.5 \%\) swing filter. At the high of \(\$ 1,380,2.5 \%\) is a minimum swing of \(\$ 34\). A percentage swing filter is determined at the point of the last swing high or swing low, so it will vary slightly from swing to swing. A bar at the top right of the figure shows the filter equal to a \(\$ 34\) move.
\section*{Constructing a Classic Swing Chart}
You may plot the swing high and low points on a bar chart, or create a classic swing chart that looks like Figure 5.2, the result of using the gold swings in Figure 5.1. You can change the frequency of the data and size of the swing to satisfy your personal trading preference. If you don't want to do this manually, the indicator TSM Swing plots the points on a chart for you. It can be programmed to print each swing high and low to a file.
1. For convenience, assume we start on the gold chart at HIGH\#1. We can actually start at any point, but the first swing may not be accurate. Record the high of the bar as the last swing high, SH. Following this swing high, we are in a downswing. Record the low of the day as the low of the current swing, CL.
2. On the next day, first test if the downswing continues. If the Low \(<\mathrm{CL}\), then \(\mathrm{CL}=\) Low.
3. Now test if the downswing reverses. If the High - CL
> swing filter, then we have a new upswing. Let the new swing low \(\mathrm{SL}=\mathrm{CL}\) and set \(\mathrm{CH}=\) High.
\section*{2.5\% Gold swings}
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0401.jpg?height=645&width=1218&top_left_y=279&top_left_x=170)
FIGURE 5.2 Corresponding swing chart of gold using a \(2.5 \%\) swing filter.
4. On the next day, test if the upswing continues. If the High \(>\mathrm{CH}\), then \(\mathrm{CH}=\) High.
5. Now test if the upswing reverses. If the CH - Low \(>\) swing filter, then we have a new downswing.
6. Go to step 2.
Traders will find that these rules are very similar to the point-and-figure rules later in this chapter. The swing chart that is created from the rules has only the swing high and swing low points in alternating columns. It simplifies the picture by skipping all the intermediate moves, as shown in Figure 5.2. It has removed time from the picture.
A different view of a swing chart construction is given in
Figure 5.3. In this chart the boxes are filled with the date on which the price moved into that box, adding a little more information. Using this form of recording swing makes it possible to see the origins of point-and-figure charting, which will be explained in the next section.
\section*{Percentage Swings}
The swing filter, which determines the minimum swing size, can be most robust if it is expressed as a percentage of price rather than as a fixed dollar per share or point value. Many markets have doubled in value - or halved or both - over the past ten years. Using a fixed value for finding the swing highs and lows will cause the swing chart to be insensitive to price movement at low prices and show frequent changes in swings at higher prices. The swing filter, expressed as a percentage \(p\), avoids this problem.
\[
\% \text { Swing filter }_{t}=p \times \text { Price }_{t}
\]
This variable swing filter helps to keep the sensitivity of the swings the same over a long period, which is very helpful for back-testing of results and for more consistent trading signals. The only complication is that the minimum swing value may change daily. To avoid that, recalculate the swing filter only when a new swing high or swing low is formed.
\begin{tabular}{|l|rrrrr|}
\cline { 2 - 6 } \multicolumn{1}{c|}{} & \multicolumn{4}{c|}{ Price swings } \\
\hline Price & Up & Down & Up & Down & Up \\
\hline 1220 & & & & & 25 \\
1215 & & & & & 25 \\
1210 & & & & & 25 \\
1205 & & & & & 25 \\
1200 & & & & & 25 \\
1195 & & & 17 & 19 & 22 \\
1190 & & & 17 & 19 & 22 \\
1185 & 12 & 13 & 15 & 19 & 22 \\
1180 & 8 & 13 & 14 & 19 & 22 \\
1175 & 8 & 13 & 14 & 19 & 22 \\
1170 & 8 & 13 & 14 & & \\
1165 & 6 & 13 & 14 & & \\
1160 & 3 & 13 & 14 & & \\
1155 & 3 & & & & \\
1150 & 1 & & & & \\
1145 & 1 & & & & \\
1140 & 1 & & & & \\
1135 & 1 & & & & \\
1130 & & & & & \\
\hline
\end{tabular}
FIGURE 5.3 Recording swings by putting the dates in the first box penetrated by the price.
\section*{Rules for Swing Trading}
Each swing represents a price trend. There are two sets of rules commonly used to enter positions in the trend direction:
1. (Conservative) Buy when the high of the current upswing exceeds the high of the previous upswing (two columns back). Sell when the low of the current downswing falls below the low of the previous downswing.
2. (Aggressive) Buy as soon as a new upswing is recognized. Sell when a new downswing is recognized. Both of these occur the first time there is a reversal greater than the swing filter.
The sideways market in gold (Figure 5.2) is not a good example for trends, but the last leg down, on the far right of the chart, would generate a sell signal on a break of the previous swing low, at about 1325. In that market, the aggressive approach would have been better.
\section*{The Swing Philosophy}
The primary advantage of a swing method, and most event-driven trend systems, is that no action occurs if prices move sideways. We will see in the next two chapters that a trend recalculated on each bar, such as a moving average, has an agenda. That is, prices must continue to advance if the trend is to remain intact. In a
swing philosophy, prices can move sideways or stand still within a trend. Prices can move up and down in any pattern as long as they do not violate the previous swing highs (if in a downtrend) or swing lows (if in an uptrend). This characteristic of event-driven systems makes them very robust at a cost of higher risk. Risk is measured as the difference between the entry point of a trade (the price at which the old swing high or low was penetrated) and the price at which an exit or reverse trade would be signaled. This risk can be as small as the swing filter or much larger if there was a sustained price move.
Another benefit of the swing method is that it can signal a new trade at the moment of a significant event - that is, without a lag. If the news is a surprise to the market and prices move out of their current trading levels to new highs or new lows, the swing method will signal a new trade. This immediate response is a very positive feature for most traders, who want to act in a timely manner. It is very different from trend systems that use moving average or other time series calculations, which have lags.
\section*{The Livermore System}
Known as the greatest trader on Wall Street, Jesse Livermore was associated with every major move in both stocks and commodities during the 30-year period from 1910 to 1940. Livermore began his career as a board boy, marking prices on the high slate boards that surrounded the New York Stock Exchange floor. During this time, he began to notice the distinct patterns in the price
movement that appeared in the columns of numbers. \({ }^{1}\) As Livermore developed his trading skills, he continued the habit of writing prices in columns headed Secondary Rally, Natural Rally, Up Trend, Down Trend, Natural Reaction, and Secondary Reaction. This may be the basis for a number of systematic charting methods.
Livermore's approach to swing trading required two filters, a larger swing filter and a penetration filter, believed to be one-half the size of the swing filter. Penetrations were significant at price levels he called pivot points. A pivot point is defined in retrospect as the top and bottom of each new swing and are marked with letters in Figure 5.4.․․ Pivot points remain a popular way of identifying relative highs and lows.
Livermore took positions only in the direction of the major trend. A major uptrend is defined by confirming higher highs and higher lows, and a major downtrend by lower lows and lower highs, and where the penetration filter is not broken in the reverse direction. That is, an uptrend is still intact as long as prices do not decline below the previous pivot point by as much as the amount of the penetration filter (seen in Figure 5.4). Once the trend is identified, positions are added each time a new penetration occurs, confirming the trend direction. A stop-loss is placed at the point of penetration beyond the prior pivot point. Livermore's rules are not clear about the penetration filter being one-half the swing filter; it may have been as small as \(20 \%\) of the current swing size.
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0407.jpg?height=962&width=1339&top_left_y=58&top_left_x=61)
FIGURE 5.4 Livermore's trend change rules.
\section*{Failed Reversal}
In the Livermore system, the first penetration of the stop-loss (a new swing high for a short or swing low for a long position) calls for liquidation of the current position. A second penetration is necessary to confirm the new trend. If the second penetration fails (at point \(K\) in Figure 5.5), it is considered a secondary reaction within the old trend. The downtrend may be reentered at a distance of the swing filter below \(K\), guaranteeing that point \(K\) is defined, and again on the next swing, following pivot point \(M\), when prices reach the penetration level below pivot point \(L\). It is easier to reenter an old trend than to establish a position in a new
one.
\section*{Programming the Swing High and Low Points}
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0408.jpg?height=124&width=146&top_left_y=271&top_left_x=66)
The swing method can be programmed in strategy development software or Excel. The good part about specialized software is that the points can be shown on a price chart to give visual confirmation, as seen in Figure 5.1. The indicator TSM Swing can be found on the Companion Website along with the Excel spreadsheet that does the same calculations. Note that the spreadsheet tests for a reversal first before it tests for a continuation of the trend.
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0408.jpg?height=921&width=1327&top_left_y=900&top_left_x=63)
FIGURE 5.5 Failed reversal in the Livermore method.
\section*{Keltner's Minor Trend Rule}
TheMinor Trend Rule was published by Keltner in his book, How to Make Money in Commodities. For many years it was followed closely by a large part of the agricultural community and is relevant for its simplicity and potential impact on markets. In today's high-tech environment, it is important to remember that many trading decisions are still made using simple tools.
Keltner defines an upward trend by the failure to make new lows (comparing today's low with the prior day) and a downtrend by the absence of new highs. This notion is consistent with chart interpretation of trendlines by measuring upward moves along the bottom and downward moves along the tops. The rule states that the minor trend turns up when the daily trend (which we interpret as price) trades above its most recent high; the minor trend stays up until the daily trend trades below its most recent low, when it is considered to have turned down. In order to trade using the Minor Trend Rule, buy when the minor trend turns up and sell when the minor trend turns down; always reverse the position.
The Minor Trend Rule is a simple short-term trading tool, buying on new highs and selling on new lows with risk varying according to volatility. It differs from the filtered swing method because there is no minimum requirement for a reversal. It will also produce many more swings.
\section*{Pivot Points}
A pivot point, discussed in Chapter 3 and later in
Chapter 7, is the high or low point of a reversal, but a much weaker condition than a swing high or low. It could be the center point of three trading days, five days, or more. A 5-day pivot point means that there are two days on each side of the local high or low price. For example, a 5-day pivot point has a 2-day lag because you cannot identify it until the close of the second day following the high or low point. Unlike a swing filter, a pivot point does not have a minimum size.
\section*{Wilder's Swing Index}
Although Wilder called this the Swing Index, it is a combination of daily range measurements with trading signals generated using pivot points. However, it is clearly an event-driven method. It was presented with trading rules in Wilder's Swing Index System. \({ }^{3}\) Wilder believed that the five most important positive patterns in an uptrend are:
1. Today's close is higher than the prior close.
2. Today's close is higher than today's open.
3. Today's high is greater than the prior close.
4. Today's low is greater than the prior close.
5. The prior close was above the prior open.
In a downtrend, these patterns are reversed.
The Swing Index, SI, combines these five factors, then scales the resulting value to fall between +1 and -1 .
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0411.jpg?height=233&width=1345&top_left_y=57&top_left_x=54)
where
\(\mathrm{K}=\) the largest of \(\left|H_{t}-C_{t-1}\right|\) and \(\left|L_{t}-C_{t-1}\right|\)
\(M=\) the value of a limit move (more about this below)
\(T R=\) the weighted true range
True range is calculated from the following two steps (note that this is the same true range as commonly used; however, step 2 requires that you know which of the three combinations was largest):
1. First, determine which is the largest of:
\[
\begin{aligned}
& \text { a. }\left|H_{t}-C_{t-1}\right| \\
& \text { b. }\left|L_{t}-C_{t-1}\right| \\
& \text { c. }\left|H_{t}-L_{t}\right|
\end{aligned}
\]
2. Calculate \(T R\) according to the corresponding formula, using (a) if the largest in step 1 was (a), use (b) or (c) if one of those was the largest in step 1.
a. \(T R=\left|H_{t}-C_{t-1}\right|-0.50 \times\left|L_{t}-C_{t-1}\right|+0.25 \times\left|C_{t-1}-O_{t-1}\right|\)
b. \(T R=\left|L_{t}-C_{t-1}\right|-0.50 \times\left|H_{t}-C_{t-1}\right|+0.25 \times\left|C_{t-1}-O_{t-1}\right|\)
c. \(T R=\left|H_{t}-L_{t}\right|+0.25 \times\left|C_{t-1}-O_{t-1}\right|\)
The SI calculation uses three price relationships: the net price direction (close-to-close), the strength of today's
trading (open-to-close), and the memory of yesterday's strength (prior open-to-prior close). It then uses the additional factor of volatility as a percentage of the maximum possible move \((K / M)\). The rest of the formula simply scales the results to within the range of +1 to -1 .
\section*{Updating the Swing Index}
In today's market, \(M\), the limit move, doesn't exist. When Wilder developed this method, all markets had limit moves; that is, trading halted when prices moved to a maximum daily price change as determined by the exchange. That is no longer the case. With some markets, trading is temporarily halted when prices move to a preset limit, but after a few minutes trading begins again. For those markets, there is no clear value for \(M\); however, that is easily resolved. \(M\) is used only to scale the index into the range +1 to -1 . If we choose an
arbitrary value, larger than the normal daily move, the results will be fine. Because the trading rules use only the relative highs and lows of the index, rather than thresholds such as 0.90, the results will be the same regardless of the choice of \(M\). In these examples,
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0412.jpg?height=219&width=314&top_left_y=1404&top_left_x=61)
Figure 5.6 shows the daily prices for Eurobund futures along with the values of the Swing Index for the last few months of 2010 and the beginning of 2011. SI switches from a positive bias at the beginning of the chart to a negative one as prices turn from bullish to bearish. These calculations are given in the spreadsheet, TSM Wilder Swing Index, found on the
Companion Website. The Swing Index is in the TradeStation library of indicators and functions; however, those programs require that the limit move be preset with each market. Instead, TSM Wilder Swing Index is provided on the Companion Website that allows you to input that value as, for example, 100.
\section*{Trading Rules}
The daily \(S I_{t}\) values are added together to form an Accumulated Swing Index (ASI),
\[
A S I_{t}=A S I_{t-1}+S I_{t}
\]
which is substituted for the price and used to generate trading signals, allowing the identification of the significant highs and lows as well as clear application of Wilder's trading rules. The terms used in the trading rules are:
HSP, High swing point: Any day on which the ASI is higher than both the previous and the following day.
\(L S P\), Low swing point: Any day on which the \(A S I\) is lower than both the previous and the following day.
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0414.jpg?height=524&width=1222&top_left_y=61&top_left_x=172)
FIGURE 5.6 Wilder's Swing Index applied to Eurobund back-adjusted futures, using TradeStation modified code.
SAR, Stop and reverse points (three types) - Index SAR points generated by the \(A S I\) calculation, SAR points applied to a specific price, and Trailing Index \(S A R\), which lags 60 ASI points behind the best \(A S I\) value during a trade.
\section*{The Swing Index System rules are:}
1. Initial entry:
a. Enter a new long position when \(A S I_{t}\) crosses above \(H S P_{t-2}\).
b. Enter a new short position when \(A S I_{t}\) crosses below \(L S P_{t-2}\). Note that HSP and LSP cannot be identified until two days after they occur.
2. Setting the \(S A R\) point:
a. On entering a new long trade, the \(S A R\) is the most recent \(L S P\); the \(S A R\) is reset to the first
\(L S P\) following each new HSP. A trailing \(S A R\) is the lowest daily low occurring between the highest \(H S P\) and the close of the day on which the \(A S I\) dropped 60 points or more.
b. On entering a new short trade, the \(S A R\) is the most recent \(H S P\); the \(S A R\) is reset to the first \(H S P\) following each new \(L S P\). The trailing \(S A R\) is the highest daily high occurring between the lowest \(L S P\) and the close of the day on which the \(A S I\) rose by 60 points or more.
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0415.jpg?height=130&width=146&top_left_y=710&top_left_x=64)
The program TSM Accumulated Swing Index can be found on the Companion Website.
\section*{POINT-AND-FIGURE CHARTING}
There does not appear to be any record of which came first, swing charting or point-and-figure charting. Both methods are very similar; however, point-and-figure has developed a greater following. Point-and-figure charting is credited to Charles Dow, who is said to have used it just prior to the turn of the twentieth century. It has three important characteristics:
1. It has simple, well-defined trading rules.
2. It ignores price reversals that are below a minimum price move as determined by the box size.
3. It has no time factor (it is event-driven). As long as prices fail to change direction by the reversal value, the trend is intact.
When point-and-figure charting first appeared, it did not contain the familiar boxes of \(X \mathrm{~s}\) and \(O \mathrm{~s}\). The earliest book containing the subject is reported to be The Game in Wall Street and How to Play It Successfully, written by "Hoyle" (not Edmond Hoyle, the English writer) in 1898. The first definitive work on the subject was by Victor De Villiers, who published The Point and Figure Method of Anticipating Stock Price Movement in 1933. De Villiers worked with Owen Taylor to publish and promote a weekly point-and-figure service, maintaining their own charts; he was impressed by the simple, scientific methodology. As with many of the original technical systems, the application was intended for the stock market, and the rules required the use of every price change appearing on the ticker. It has also been highly popular among futures traders in (what were) the grain and livestock pits of Chicago. The rationale for a purely technical system has been told many times, but an original source is often refreshing. De Villiers said: 4
\section*{The Method takes for granted:}
1. That the price of a stock at any given time is its correct valuation up to the instant of purchase and sales (a) by the consensus of opinion of all buyers and sellers in the world and (b) by the verdict of all the forces governing the laws of supply and demand.
2. That the last price of a stock reflects or crystalizes everything known about or bearing on it from its first sale on the Exchange (or prior), up to that time.
3. That those who know more about it than the observer cannot conceal their future intentions regarding it. Their plans will be revealed in time by the stock's subsequent action.
Who can argue with that? The point-and-figure chart differs from the swing chart in that each column representing an upswing is a series of boxes containing \(X\) s and each downswing is shown as a string of \(O\) s (Figure 5.7), and a new mark is not entered unless a minimum price change (the box size) occurs.
The original figure charts were plotted on graph paper with square boxes, and only dots, or the exact price, were written in each box. The chart evolved to have prices written on the left scale of the paper, where each box represented a minimum price move. Some point-andfigure chartists then used a combination of \(X \mathrm{~s}\) and occasional digits (usually os and 5 s every five boxes) to help keep track of the length of a move. In some cases, the top of an upswing column was connected to the start of a downswing in the next column with a crossbar, and the bottom of a downswing column was connected to the beginning of the next upswing column. This gave the point-and-figure chart an appearance similar to the swing chart. Charts using 1, 3, and 5 points per box were popular. In the 5 -point method, no entry was recorded unless the price change spanned 5 points. It is most likely that a "point" is a minimum move. Floor traders used the charts to show only the short-term price moves and left a lot to the interpretation of patterns.
\section*{Silver}
\begin{tabular}{|l|l|l|l|l|l|l|l|l|l|l|}
854.0 & X & & & & & & & & & \\
\hline 853.0 & X & O & X & & & & & & & \\
\hline 852.0 & X & O & X & O & & & & & & \\
\hline 851.0 & & O & X & O & X & & & & & \\
\hline 850.0 & & O & & O & X & O & & & & \\
\hline 849.0 & & & & O & X & O & & & & \\
\hline 848.0 & & & & O & X & O & & & & \\
\hline 847.0 & & & & O & & & & & & \\
\hline 846.0 & & & & & & & & & & \\
\hline
\end{tabular}
FIGURE 5.7 Point-and-figure chart.
\section*{Plotting Prices Using the Point-and-Figure Method}
To plot prices on a point-and-figure chart, start with a piece of square-box graph paper and mark the left scale with price increments equal to one box. How much is that? In the current market, you should start with a box equal to the 20-day average true range of the market. In late 2017, the box size would have been 15 points for the S\&P, \(\$ 4\) for gold, \(\$ 1.10\) for crude oil, \(\$ 2.75\) for Apple, and \(\$ 1.50\) for Walmart. Increasing or decreasing the box size
will make the chart less or more sensitive to changes in direction, as will be seen in later examples. Therefore, a point-and-figure chartist looking for a long-term price movement will use a larger box size.
Once the graph paper has been scaled and the prices entered along the left side, the chartist can begin. The first box is entered with the current closing price of the market. If the price of soybeans is 852.50 and a
\(1 \phi(1 \phi=1.00)\) box is being used, a mark is placed in the box beside the value 852. An \(X\) or an \(O\) is used to indicate that the current price trend is up or down, respectively. Either an \(X\) or \(O\) may be used to begin after that, it will be determined by the method.
The rules for plotting point-and-figure charts are similar to a swing chart. Preference is given to price movements that continue in the direction of the current trend. Therefore, if the trend is up (represented by a column of \(X s\) ), the new high price is tested first; if the trend is down, the low price is tested first. A reversal is checked only if the new price fails to increase the length of the column in the direction of the current trend. No box is filled unless the price reaches the value associated with that box.
\section*{Starting a New Column}
The traditional point-and-figure method calls for the use of a 3-box reversal, that is, the price must reverse direction by an amount that fills 3 boxes from the most extreme box of the last column before a new column can begin (it actually must fill the fourth box because the
extreme box is left blank). The importance of keeping the 3 -box reversal has long been questioned by traders. It should be noted that the net reversal amount (the box size times the number of boxes in the reversal) is the critical value, and is similar to the swing filter.
For example, a 25-point box for the NASDAQ 100 futures (NQ) with a 3-box reversal means that NQ prices must reverse from the lows of the current downtrend by 75 points to indicate that an uptrend has started. The opposite combination, a 3 -point box and a 25 -box reversal, would signal a new trend after the same 75point reversal. The difference between the two choices is that the smaller box size would recognize a smaller continuation of a price move by filling more boxes. Ultimately the smaller box size will capture more of the price move. The choice of box size and reversal boxes will be considered later in more detail.
\section*{Painless Point-and-Figure Charts}
There are a number of graphic charting and quote systems that allow a simple bar chart to be converted to point-and-figure automatically, just as it can convert to candlesticks. It is still necessary to specify the box and reversal sizes. The reason for showing the construction in detail is that none of these services provide trading signals or performance results based on point-and-figure charting. For that it will be necessary to code the instructions into a spreadsheet or a strategy development platform.
\section*{Point-and-Figure Chart Formations}
It would be impractical for the average speculator to follow the original method of recording every change in price. When applied to stocks, these charts became so lengthy and covered so much paper that they were unwieldy and made interpretation difficult. In 1965, Robert E. Davis published Profit and Profitability, a point-and-figure study that detailed eight unique buy and sell signals. The study covered two stocks for the years 1914-1964, and 1,100 stocks for 1954-1964. The intention was to find specific bull and bear formations that were more reliable than others. The study concluded that the best buy signal was an ascending triple top and the best sell signal was the breakout of a triple bottom, both shown in Figure 5.8 and with the other patterns studied in Figure 5.9.
Futures do not offer the variety of formations available in the stock market. The small number of markets and the high correlation of movement between many of the index and interest rate markets limit the number of unique patterns. Instead, the most basic approach is used, where a buy signal occurs when an \(X\) in the current column is one box above the highest \(X\) in the last column of \(X \mathrm{~s}\), and the simple sell signal is an \(O\) plotted below the lowest \(O\) of the last descending column. The flexibility of the system lies in the size of the box; the smaller the size, the more sensitive the chart will be to price moves.
Ascending Triple Top
Breakout of a Triple Bottom
X X
X \(\leftarrow\) BUY
XOX
XOXOX
XOXO
O
\(\begin{array}{lll}x & x \\ o x & X X O \\ O X O X & 0 \\ 0 & 0 & 0\end{array}\)
\(\mathrm{O} \leftarrow \mathrm{SELL}\)
FIGURE 5.8 Best formations from Davis's study.
(a)
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0423.jpg?height=209&width=402&top_left_y=65&top_left_x=114)
Breakout of a triple top
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0423.jpg?height=272&width=404&top_left_y=306&top_left_x=113)
Upside breakout of a symmetric triangle
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0423.jpg?height=294&width=402&top_left_y=628&top_left_x=114)
Upside breakout of a bearish resistance line
(b)
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0423.jpg?height=215&width=404&top_left_y=1027&top_left_x=111)
Breakout of a triple bottom
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0423.jpg?height=262&width=402&top_left_y=1270&top_left_x=114)
Downside breakout of a symmetric triangle
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0423.jpg?height=286&width=402&top_left_y=1597&top_left_x=114)
Downside breakout of a bullish support line
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0423.jpg?height=209&width=402&top_left_y=65&top_left_x=548)
Ascending triple top
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0423.jpg?height=272&width=402&top_left_y=306&top_left_x=550)
Upside breakout of a bullish resistance line
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0423.jpg?height=288&width=402&top_left_y=633&top_left_x=548)
Upside breakout of an ascending triangle
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0423.jpg?height=211&width=402&top_left_y=1029&top_left_x=550)
Descending triple bottom
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0423.jpg?height=260&width=392&top_left_y=1275&top_left_x=549)
Downside breakout of a bearish support line
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0423.jpg?height=284&width=402&top_left_y=1598&top_left_x=550)
Downside breakout of a
Bearish catapult
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0423.jpg?height=175&width=328&top_left_y=102&top_left_x=1061)
Spread triple top
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0423.jpg?height=619&width=400&top_left_y=306&top_left_x=987)
Bullish catapult
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0423.jpg?height=209&width=400&top_left_y=1026&top_left_x=987)
Spread triple bottom
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0423.jpg?height=611&width=392&top_left_y=1269&top_left_x=995)
descending triangle
\section*{FIGURE 5.9 (a) Compound point-and-figure buy signals. (b) Compound point-and- figure sell signals.}
\section*{Point-and-Figure Trendlines}
Bullish and bearish trendlines are commonly used with point-and-figure charts. The top or bottom box that remains blank when a reversal occurs can form the beginning of a descending or ascending pattern at a \(45^{\circ}\) angle (diagonally through the corners of the boxes, providing the graph paper has square boxes). These \(45^{\circ}\) lines represent the trends of the market. Once a top or bottom has been identified, a \(45^{\circ}\) line can be drawn down and to the right from the upper corner of the top boxes of \(X \mathrm{~s}\), or up and toward the right from the bottom of the lowest box of Os (Figure 5.10). These trendlines are used to confirm the direction of price movement and are often used to filter the basic point-and-figure trading signals so that only long positions are taken when the \(45^{\circ}\) trendline is up and only shorts sales are entered when the trendline is down.
\section*{Finding the Point-and-Figure Box Size}
Just as with the calculation period for a moving average, the box size, given a 3-box reversal, is the key variable to point-and-figure success. There have been many studies that show the best choice, the earliest being Charles C . Thiel, Jr., and Robert E. Davis in 1970. Because of the stronger trends during those years, \(53 \%\) of the trades in their tests were profitable. A few years later, Zieg and Kaufman \({ }^{5}\) performed a computerized study using the same rules but limiting the test period to six months
ending May 1974, an extremely active market period. For the 22 commodities tested, 375 signals showed \(40 \%\) of the trades were profitable; the net profit over all the trades was \(\$ 306\) and the average duration was 12.4 days compared to 50 days in the Davis and Theil tests. Price moves were getting faster.
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0426.jpg?height=1584&width=1339&top_left_y=54&top_left_x=61)
FIGURE 5.10 Point-and-figure trendlines.
History of the Point-and-Figure Box Size
For many years Chartcraft (Investors Intelligence) was the only major service that produced a full set of point-
and-figure charts for the futures markets. A history of their box sizes is shown in Table 5.1.
\section*{TABLE 5.1 Point-and-figure box sizes. \(\underset{\sim}{*}\)}
\begin{tabular}{|c|c|c|c|c|c|c|c|}
\hline \multirow[b]{2}{*}{\begin{tabular}{l}
Futures \\
Market
\end{tabular}} & \multirow[b]{2}{*}{ Units } & \multicolumn{2}{|c|}{\begin{tabular}{c}
Prior to \\
1975 \(\ddagger\)
\end{tabular}} & \multirow{2}{*}{\begin{tabular}{|c|}
1975 \\
\hline Box \\
Bize \\
Size
\end{tabular}} & & & \multirow{2}{*}{\begin{tabular}{c}
1986 \\
\(\ddagger\) \\
Box \\
Size
\end{tabular}} \\
\hline & & Year & \begin{tabular}{l}
Box \\
Size
\end{tabular} & & \begin{tabular}{l}
Box \\
Size
\end{tabular} & \begin{tabular}{l}
Box \\
Size
\end{tabular} & \\
\hline \multicolumn{8}{|c|}{ Grains } \\
\hline Corn & cents & 1971 & \(1 / 2\) & 2 & 2 & 2 & 1 \\
\hline Oats & cents & 1965 & \(1 / 2\) & 1 & 1 & & 1 \\
\hline Soybeans & cents & 1971 & 1 & 10 & 10 & 5 & 5 \\
\hline \begin{tabular}{l}
Soybean \\
meal
\end{tabular} & pts & 1964 & 50 & 500 & 500 & & 100 \\
\hline \begin{tabular}{l}
Soybean \\
oil
\end{tabular} & pts & 1965 & 10 & 20 & 20 & & 10 \\
\hline Wheat & cents & 1964 & 1 & 2 & 2 & 2 & 1 \\
\hline
\end{tabular}
\section*{Livestock and Meats}
\begin{tabular}{|l|c|c|c|c|c|c|c|}
\hline \begin{tabular}{l}
Live \\
cattle
\end{tabular} & pts & 1967 & 20 & 20 & 20 & & 20 \\
\hline Live hogs & pts & 1968 & 20 & 20 & 20 & & 20 \\
\hline \begin{tabular}{l}
Pork \\
bellies
\end{tabular} & pts & 1965 & 20 & 20 & 20 & & 20 \\
\hline
\end{tabular}
\begin{tabular}{|l|c|c|c|c|c|c|r|}
\hline \multicolumn{8}{|c|}{ Other Agricultural Products } \\
\hline CocoaI & pts & 1964 & 20 & 100 & 100 & 50 & 10 \\
\hline Coffee & pts & & \begin{tabular}{c}
\((20)\) \\
\(\pm\)
\end{tabular} & 100 & 100 & 50 & 100 \\
\hline
\end{tabular}
\begin{tabular}{|l|c|c|c|c|c|c|c|}
\hline Cotton & pts & & \begin{tabular}{c}
\((20)\) \\
\(\pm\)
\end{tabular} & 100 & 100 & & 50 \\
\hline Lumber & pts & & \begin{tabular}{c}
\((100)\) \\
\(\pm\)
\end{tabular} & 100 & 100 & & 100 \\
\hline \begin{tabular}{l}
Orange \\
juice
\end{tabular} & pts & 1968 & 20 & 20 & 100 & 20 & 100 \\
\hline Sugar & pts & 1965 & 5 & 20 & 20 & & 10 \\
\hline
\end{tabular}
\section*{Metals}
\begin{tabular}{|l|c|c|c|c|c|c|c|}
\hline Copper & pts & 1964 & .20 & 100 & 100 & 50 & 50 \\
\hline Gold & pts & & & 50 & 100 & & 400 \\
\hline Platinum & pts & 1968 & 200 & 100 & 200 & 200 & 400 \\
\hline Silver & pts & 1971 & 100 & 200 & 200 & 400 & 1000 \\
\hline
\end{tabular}
\({ }^{*}\) All box sizes use a 3 -box reversal and are in points (decimal fractions treated as whole numbers) unless otherwise indicated.
\({ }^{\dagger}\) Cohen (1972); parentheses indicate approximate values.
\({ }^{\ddagger}\) Courtesy of Chartcraft Commodity Service, Chartcraft, Inc., Larchmont, NY.
\({ }^{\S}\) Chart Analysis Limited, Bishopgate, London. Values are for long-term continuation charts.
\({ }^{\text {I }}\) Cocoa contract changed from cents/pound to dollars/ton.
There is a lesson in the way Chartcraft changed its box sizes. First, picture that they always showed the same number of charts per page, say that was 12 , three across and four down. Each chart was a grid of \(20 \times 20\), allowing 20 swings and 20 price boxes. If the S\&P were to have moved 100 points over the 20 swings on the
chart, each box would be assigned 5 points. If soybeans moved \(\$ 2\) over the 20 swings, then each box would be 10 cents. In order to fit the entire price move into the box, the chart automatically adjusted for volatility.
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0429.jpg?height=125&width=148&top_left_y=325&top_left_x=67)
Since the 1970s, every traded commodity has had a major price swing, and the price levels have changed substantially, most often upward. If we perform a test to find the best box size, given a 3 -box reversal, we find that results are inconsistent. Table 5.2 used futures and stock data from 2000 through November 2017 and the program TSM Point \& Figure, available on the Companion Website.
TABLE 5.2 The box size with the best performance of the point-and-figure method, 2000-2017, for a selection of futures markets and stocks.
From January 2000 through November 2017
\begin{tabular}{|l|l|l|l|l|l|l}
\hline & & \begin{tabular}{c}
Best \\
Box
\end{tabular} & \multicolumn{2}{|c|}{\begin{tabular}{c}
Tested \\
Range
\end{tabular}} & \begin{tabular}{c}
No. \\
of
\end{tabular} & Tot \\
\hline Symbol Name & \begin{tabular}{l}
size
\end{tabular} & \multicolumn{2}{|c|}{ From } & To & Tests & Long \\
\hline \multicolumn{3}{|l|}{ Interest rate futures } \\
\hline TU & \begin{tabular}{l}
2-Year \\
Notes
\end{tabular} & 0.24 & 0.005 & 0.325 & 66 & 27406 \\
\hline FV & \begin{tabular}{l}
5-Year \\
Notes
\end{tabular} & 0.955 & 0.005 & 1 & 200 & 60664 \\
\hline US & \begin{tabular}{l}
30-Year \\
Bonds
\end{tabular} & 0.475 & 0.005 & 0.5 & 100 & 92593 \\
\hline
\end{tabular}
\begin{tabular}{|c|c|c|c|c|c|c|}
\hline EBL & \begin{tabular}{l}
Eurobund \\
(10 Year)
\end{tabular} & 0.75 & 0.05 & 1.85 & 31 & 8506c \\
\hline \multicolumn{7}{|c|}{ Index } \\
\hline ES & \begin{tabular}{l}
\(e\) mini \\
S\&P
\end{tabular} & 25.5 & 0.05 & 30 & 60 & 52075 \\
\hline NQ & \begin{tabular}{l}
Nasdaq \\
100
\end{tabular} & 51 & 1 & 100 & 100 & 68545 \\
\hline DAX & DAX & 69 & 1 & 100 & 100 & 19918; \\
\hline \multicolumn{7}{|c|}{ Energy } \\
\hline CL & Crude oil & 2.5 & 0.25 & 4.75 & 20 & 10527 \\
\hline HO & \begin{tabular}{l}
Heating \\
oil
\end{tabular} & 0.1 & 0.005 & 2 & 40 & 10262: \\
\hline \multicolumn{7}{|c|}{ Metals } \\
\hline GC & Gold & 1.5 & 0.5 & 20 & 40 & 11007 \\
\hline HG & Copper & 8 & 0.5 & 20 & 40 & 10098 \\
\hline PA & Palladium & 23 & 1 & 50 & 50 & 57430 \\
\hline \multicolumn{7}{|c|}{ Currency } \\
\hline CU & Euro & 0.0075 & 0.0025 & 0.05 & 20 & 68487 \\
\hline \multicolumn{7}{|c|}{ Stocks } \\
\hline AAPL & Apple & 1.25 & 0.25 & 5 & 20 & 157.9 \\
\hline AMZN & Amazon & 15 & 1 & 20 & 20 & \(916.2 C\) \\
\hline BAC & \begin{tabular}{l}
Bank of \\
America
\end{tabular} & 3 & 0.1 & 3 & 30 & 5.65 \\
\hline WMT & Walmart & 2 & 0.1 & 3 & 30 & 4.42 \\
\hline
\end{tabular}
The results show that, with few exceptions, the best box
size favored large reversals, resulting in long trends and few trades. In all cases we see that the long positions were profitable, particularly obvious for interest rate futures, where the price has been in an uptrend for the better part of 35 years. The far-right column shows the percentage of tests that were profitable, a good indication of robustness. Most markets showed good results, with Bank of America (BAC) and Walmart (WMT) failing that test, BAC because of the 2008 financial crisis and WMT because it has traded in a narrow range for years.
The specific test results of two of the more popular markets, Apple and the emini S\&P, are shown in Figures 5.11 and 5.12 , with the box size along the bottom. AAPL shows good results except at the short and long ends, but the pattern in the center is not as smooth as we would prefer. The S\&P, however, shows the typical improvement from small to large reversals, very similar to the results we see when testing moving average calculation periods.
When testing, the first problem we find is that each market needs its unique box size. For example, bond futures were tested for box sizes from 0.005 to 0.500 in increments of 0.005 while Amazon was tested from 1 cent to 20 cents in steps of 1 cent. There may be a way to specify the range and steps automatically, but we haven't figure that out yet. Percentages don't work for backadjusted futures because old prices can be negative, and volatility can be greater at lower prices. It can be corrected by knowing the full range of price movement over the test period, but that would be cheating.
\section*{The Box Size Dilemma}
The problem with the point-and-figure box size is that a small reversal (box size times the number of boxes for a reversal) is good for low prices and consistent trends while a large reversal is only good for high priced, volatile moves. Using the same reversal criterion, a market that has spanned both low and high price levels is likely to be profitable at one but not both.
\section*{Apple (AAPL) P\&F Tests}
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0432.jpg?height=588&width=1327&top_left_y=675&top_left_x=63)
FIGURE 5.11 Tests of box size for Apple shows smaller is better.
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0433.jpg?height=560&width=1339&top_left_y=190&top_left_x=61)
FIGURE 5.12 Tests of the S\&P futures shows results similar to moving averages, with profits clustered at the larger box sizes, favoring slower trading.
What are the solutions? There are different ways that analysts have tried to solve this over the years.
- Chartcraft kept the number of vertical boxes constant and adjusted the box size to make the total price range fit in that scale. But then the box size and the trading signals might change each week.
Zieg and Kaufman created a variable size box, getting larger at higher prices and smaller at lower prices in order to maintain the same sensitivity. But larger boxes mean fewer trades, and smaller means more trades, which does not necessarily address the profitability, but guarantees greater risk at higher prices.
Using the average true range, a measure of volatility, to adjust the box size is similar to Chartcraft's
method. Box sizes would change as volatility changed, and a long position one day entered on high volatility may turn out to be a short sale if volatility dropped.
Consider this a problem yet to be solved. It could be that increasing box size as a percentage proportional to the price increase will give a result that shows consistency in the length of the trade. Maybe we're creating a problem that doesn't exist. There are many followers of pointand-figure that are satisfied with the way it works.
\section*{Point-and-Figure Trading Techniques}
The basic point-and-figure trading signals are triggered on new highs and new lows:
- Buy when the column of \(X \mathrm{~s}\), the current upswing, rises above the previous column of \(X\) s by one box.
- Sell when the column of \(O\) s, the current downswing, falls below the low of the previous column of \(O\) s by one box.
A point-and-figure signal differs from the swing method because a new high occurs only when a box is filled, while any move above a previous high will trigger a signal on a swing chart. Using these basic rules, you are always in the market, reversing from long to short and from short to long, unless you trade stocks only from the long side.
There are alternative methods for selecting point-andfigure entry and exit points that have become popular. Buying or selling on a pullback after an initial point-and-
figure signal is one of the more common system entries because it can limit risk and still use the reversal signal as a stop-loss. Of course, there are fewer opportunities to trade when only small risk is allowed, and there is a proportionately greater chance that the trade will be stopped out because the entry and exit points are closer together. Three approaches for entering on limited risk are:
1. Wait for a reversal back to within an acceptable risk, then buy or sell immediately with the normal point-and-figure stop. Figure 5.13 shows various levels of risk in IBM with \(\$ 2.00\) boxes. The initial buy signal is at \(\$ 150\), with the simple sell signal for liquidation at \(\$ 134\), giving a risk of \(\$ 16\) per share. Instead of buying as prices reach new highs, wait for a reversal after the buy signal, then buy when the low for the day penetrates the box corresponding to your acceptable level of risk. Three possibilities are shown in Figure 5.13. Buying into a declining market assumes that the support level (at \$134 in this example) will hold, avoiding the next short signal. To increase confidence, the base of the formation should be as broad as possible. The test of a triple bottom or a spread triple bottom after a buy signal is a good place to go long.
It is not advisable to reduce risk by entering on the original buy signal and placing a stop-loss at the point of the first reversal ( 3 boxes below the highs). The advantage of waiting for the pullback is that it uses a logical support level as a stop. A stop-loss placed arbitrarily 3 boxes lower has no logical basis
and can quickly result in a losing trade.
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0436.jpg?height=758&width=1218&top_left_y=158&top_left_x=174)
FIGURE 5.13 Entering IBM on a pullback with limited risk.
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0436.jpg?height=697&width=1199&top_left_y=1097&top_left_x=178)
FIGURE 5.14 Entering on a confirmation of a new trend after a pullback.
2. Enter the market on the second reversal back in the direction of the original signal. As shown in Figure 5.14, the first reversal following a signal may not reach the target risk level. Price movement does not often accommodate our expectations. Instead, you can enter a long position on the second upswing. That is, do not enter a long position on the initial buy signal but wait until a 3-box reversal has caused a downswing. As the downswing continues, place a trailing buy order at the point where the next upswing would begin, at the fourth box above the lowest box of \(O\) s. If the order is executed, then the new position is in the direction of the trend; however, the risk has been limited to the value of four boxes, which is the new trend reversal point.
This technique can reduce risk and avoid false signals. If the pullback that follows the breakout continues in an adverse direction, penetrates the other support or resistance level, and triggers the original system stop-loss, then no entry occurs, saving a substantial whipsaw loss. This method is essentially looking for a confirmation of direction. However, if prices continue upward, without a pullback, the trade may be missed entirely. You can read more on this topic in the section "Individual Trade Risk" in Chapter 23.
Entering on a secondary upswing can also be effective for building positions. It is similar to bar charting, where you wait for a pullback to a bullish support line or a bearish resistance line to add a position with a risk limited. With point-and-figure,
we add on each reversal back in the direction of the trend using the newly formed stop-loss point to exit the entire position (as shown in Figure 5.15).
3. Allowing for irregular patterns. Price patterns are not always orderly, and the price activity at the time of a trend change can be very indecisive. One basic trading principle is to require a confirming new high before buying; the first new high might simply occur during an erratic sideways pattern, or an expanding formation after a period of low volatility. We are demanding that the momentum, or speed of price movement, increase before a position is set. \(\frac{6}{}\) The pattern of higher highs and higher lows is similar to upward acceleration.
This technique, which tends to minimize false breakouts, may be modified to increase the confirmation threshold from two to three or four boxes as market volatility increases.
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0438.jpg?height=535&width=1210&top_left_y=1240&top_left_x=177)
FIGURE 5.15 Three ways to compound positions.
\section*{Point-and-Figure Trading Risk}
I go long or short as close as I can to the danger point, and if the danger becomes real I close out and take a small loss.
-Jesse Livermore to Richard Wyckoff¹
If we look at both a bar chart and a corresponding pointand-figure chart for the same period (Figure 5.16), we see similar horizontal support and resistance lines that define a trading range. In both cases, when the resistance line is penetrated, a long position is entered. This is the same concept used in the swing method. A stop-loss is placed below the resistance line in order to close out the trade in the event of a false breakout. The placement of the stop-loss could have been below the support line, allowing the new upward trend the most latitude to develop.
\section*{A Windfall Profit}
From time to time you find yourself the beneficiary of a substantial price move, a price shock, where there is an uncomfortably large, unrealized profit. It is normal to consider how much of that profit will be lost before the system finally generates an exit signal. At these times, some traders prefer to take the profits. These are decisions that go beyond the area of technical analysis, although they could be rigorously tested.
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0440.jpg?height=742&width=1164&top_left_y=73&top_left_x=78)
Point-and-figure
FIGURE 5.16 Placement of point-and-figure stops.
A trading system should not depend on a single, very large profit to prove its success. It should have profits and losses that vary in size, but nothing exceptional. Occasionally, a price shock gives you a windfall profit that has nothing to do with a well-designed system or astute trading. It is an opportunity to take profits. If you are correct, prices will reverse after you have gotten out, and there will be an opportunity to reenter the trade at a much better level.
You can always justify reducing your position size when volatility is extreme, in order to bring risk under control. To make the process more systematic, wait until prices reverse by the 3-box criteria before exiting all or part of the trade (Figure 5.17a). That gives you a chance to reenter if prices again start up and make a new high (Figure 5.17b). Sometimes you need to reduce the market exposure, whether the current position is a profit or a
loss. A systematic way to maintain a constant level of risk, called volatility stabilization, is discussed in Chapter 23.
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0441.jpg?height=951&width=653&top_left_y=273&top_left_x=75)
(a)
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0441.jpg?height=946&width=618&top_left_y=272&top_left_x=771)
(b)
FIGURE 5.17 Cashing in on profits.
In general, taking small profits does not improve overall profitability because it most often misses the biggest moves. But taking profits on extreme moves is different. Chapter 15 has a number of studies focused on price reversals that might help clarify the choices.
\section*{Alternative Treatment of Reversals}
Traditional point-and-figure charting favors the continuing trend. On highly volatile outside days, it is
possible for both a trend continuation and a 3 -box reversal to occur. Point-and-figure rules require that the trend continuation be recorded and the reversal ignored. Figure 5.18 shows a comparison of the two choices. In the example, prices are in an uptrend when a new 1-box high and a 3 -box reversal both occur on Day 6 , as seen in Figure 5.18a. In part b, the traditional approach is taken, resulting in a continuous upward trend with a stop-loss at 7.90. Taking the reversal first as an alternative rule, part c shows the same trend with a stop-loss now at 8.05, 15 points closer.
Plotting the reversal first usually works to the benefit of the trader; both the stop-loss and change of trend will occur sooner. Subsequent computer testing proved this to be true. This alternative does not work when the reversal value is small and there are many occurrences of the optional reversal.
\section*{Selecting Trades}
Not all trades are profitable in any trading system. Some analysts prefer point-and-figure charts because both the profit objective and the risk can be identified at the time of entry. The profit objective can be calculated using the vertical or horizontal count, and the risk is the size of the price reversal needed to cause the opposite signal. Some traders prefer those trades that have a return to risk ratio greater than 2.0.
As with other trending systems, trendlines can be drawn to identify the current dominant trend. For point-andfigure, the upward trendline starts at the lowest box and
goes up and to the right at a \(45^{\circ}\) angle. Trades may be taken only in the direction of that trend. In a bull market, new short signals are ignored until the box is filled that penetrates the upward bullish trendline. Then the bias switches to the short side.
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0443.jpg?height=492&width=1327&top_left_y=396&top_left_x=63)
FIGURE 5.18 Alternative methods of plotting pointand-figure reversals. (a) Sample prices for plotting. Traditional method. (c) Alternative rule taken on day 6.
\section*{Price Objectives}
Point-and-figure charting has two unique methods for calculating price objectives: horizontal counts and vertical counts. These techniques do not eliminate the use of the standard bar charting objectives, such as support and resistance levels, which apply here as well.
\section*{The Horizontal Count}
The time that prices spend in a consolidation area is considered directly related to the size of the subsequent price move. One technique for calculating price objectives is to measure the width of the consolidation (the number of columns on a bar chart) and project the
same measurement up or down as the target of the move. The point-and-figure horizontal count method is a more exact approach to the same idea.
The upside price objective is calculated as:
\[
H_{U}=P_{L}+(W \times R)
\]
where:
\(H=\) the upside horizontal count price objective \(U\)
\(P=\) the price of the lowest box of the base formation \(L\)
\(W=\) the width of the bottom formation (number of columns)
\(R=\) the reversal value (number of boxes times the value of one box)
To use this formula, the base (width of the bottom or top formation) needs to be identified. Count the number of columns, \(W\), not including the breakout column and multiply \(W\) by the value of a minimum reversal, \(R\); then add that result to the bottom point of the base to get the upper price objective. The base can always be identified after the breakout has occurred. For example, Figure 5.19 shows the March 74 contract of London Cocoa ( \(£ 4\) box) forming a very long but clear base. The reversal value is \(£ 12\) and the width of the base is 19 columns (not counting the last column, which included the breakout). Added to the lowest point of the base ( \(£ 570\) ) this gives an objective of \(£ 798\), reached on the left shoulder of the topping formation. Another alternative is the wider base,
marked as \(W_{2}=25\). Using this selection results in a price objective of \(£ 870\), by adding \(25 \times £ 12=£ 300\) to \(£ 570\), the lowest point of the base.
The downside objective is calculated in the same manner as the upside objective:
\[
H_{D}=P_{H}-(W \times R)
\]
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0445.jpg?height=1008&width=1313&top_left_y=655&top_left_x=74)
FIGURE 5.19 Horizontal count price objectives.
where:
\(H=\) the downside horizontal count price objective
\(D\)
\(P_{H}=\) the price of the highest box of the top formation
\(W=\) the width of the top formation (number of columns)
\(R=\) the reversal value
Some examples are given for downside objectives in the same cocoa diagram (Figure 5.19). A small correction top could be isolated at the \(£ 720\) level and two possible top widths, \(W_{3}\) and \(W_{5}\), could be chosen. The broader top,
\(W_{3}\), has a width of 9 and a downside objective of \(£ 632\). The shorter top, \(W_{5}\), has a width of 5 and a downside objective of \(£ 680\). Although the closer objective, calculated from \(W_{5}\), is easy to reach, the farther one is reasonable because it coincides with a strong intermediate support level at about \(£ 640\).
The very top formation, \(W_{4}\), was small and only produced a nearby price objective similar to the first downside example; there would be no indication that prices were ready for a major reversal. The top also forms a clear head-and-shoulders pattern, which could be used in the same manner as in bar charting to find an objective. Using that technique, the distance from the top of the head to the point on the neckline directly below is 20 boxes; then the downside price objective is 20 boxes below the point where the neckline was penetrated by the breakout of the right shoulder, at \(£ 776\), giving \(£ 696\) as the objective.
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0447.jpg?height=768&width=1324&top_left_y=74&top_left_x=65)
FIGURE 5.20 Point-and-figure vertical count for QQQ. The major low in October 2002 had a reversal of 13 boxes, each with a value of 0.25 , for a total of 3.25 . Multiplying by 3 and adding the result, 9.75 , to the lowest value \(\$ 20.00\), gives the price objective of 29.75 . The second bottom in February 2003 shows a reversal of 7 boxes and gives a target of 28.75 .
The horizontal count can also be applied to a breakout from a triangular formation, similar to the one on the very far right in Figure 5.19 (marked "Head-andshoulders objective"). The width of the formation is the widest point in the center of the triangle, and the upward objective is also measured from the center, rather than from the bottom of the triangle.
\section*{The Vertical Count}
The vertical count is a simpler calculation than the
horizontal count. As with the horizontal count, there is adequate time to identify the formations and establish a price objective before it is reached. The vertical count is a measure of volatility (the amount of rebound from a top or bottom) and can be used to determine the size of a retracement after a major price move. To calculate the upside vertical count price objective, locate the first reversal column after a bottom formation. To do this, a bottom must be established with one or more tests, or a major resistance line must be broken to indicate that a bottom is in place. The vertical count price objective is then calculated:
\section*{\(V_{u p}=\) Lowest box \(+(\) First revesal boxes \(\times\) Minimum reversal boxes \()\)}
The downside vertical count price objective is just the opposite:
\section*{\(V_{\text {doun }}=\) Highest box \(-(\) First reversal boxes \(\times\) Minimum reversal boxes \()\)} where:
first reversal \(=\) the number of boxes in the first boxes reversal
minimum \(=\) the number of boxes needed for a reversal boxes chart reversal
Examples illustrating the vertical count are easy to find. In the QQQ chart (Figure 5.20), the NASDAQ low occurs in early October 2002, followed by an upward reversal of 13 boxes. Each box is \(\$ 0.25\), giving a total reversal of \(\$ 3.25\). Multiply the reversal amount by 3 , the number of
boxes in a reversal, and add that value, 9.75, to the low of \(\$ 20.00\) to get the target of \(\$ 29.75\). That value was reached during May 2003.
A secondary low in QQQ occurs in February 2003 at \(\$ 23.50\). The first reversal that follows is 7 boxes, or \(\$ 1.75\). Multiply 1.75 by 3 and add the result to the low to get the target of \(\$ 28.75\). The two objectives confirm each other. As a simple measurement tool based on recognizing key highs or lows, the vertical count relies on volatility to determine the extent of the move that follows. It can be quite accurate at times; otherwise it is likely to understate the expected price move.
\section*{Recent Applications of Point-and-Figure}
Not much new has happened to point-and-figure during the past 100 years; however, there has been renewed interest in using it. Two books, Power Investing with Sector Funds (St. Lucie Press / American Management Association, 1999) by Peter Madlem, and Point \& Figure Charting, Second Edition (John Wiley \& Sons, 2001) by Thomas Dorsey, show more recent examples of how this technique applies to stocks and sector indices. There are also a number of websites with instructions and examples, most combined with advertising.
\section*{Renko Bricks}
In a manner similar to point-and-figure, Renko Bricks 8 (from the Japanese word renga, for brick) assign a price range to each brick and record one box up and one to the right for each completion of a higher brick. Lower bricks
are one box down and one to the right, as shown in Figure 5.21. Each progression up and down is always at a \(45^{\circ}\) angle. By setting the size of the brick larger, you can smooth the price movement.
Renko Bricks suffer from the same problem as pointand-figure, or any strategy that uses a fixed size increment. When prices go higher, it becomes more sensitive, and when they go lower it becomes less sensitive to price moves. A percentage increment may solve the problem. A system that maintains a constant sensitivity is usually a better option.
\begin{tabular}{|c|c|c|c|c|c|c|c|c|c|}
\hline & & & X & & & & & & \\
\hline & & X & & X & & & & & \\
\hline & X & & & & X & & & & \\
\hline X & & & & & & X & & & \\
\hline & & & & & & & X & & \\
\hline & & & & & & & & X & \\
\hline & & & & & & & & & X \\
\hline & & & & & & & & & \\
\hline
\end{tabular}
FIGURE 5.21 Renko Bricks pattern.
\section*{THE N-DAY BREAKOUT}
Close on the heels of the swing and point-and-figure methods is the rolling breakout, or N -day breakout. In the theoretical sense, it is not entirely an event-driven method because it is affected by time, but its best feature is that it buys on new highs and sells on new lows, very much the same as event-driven techniques. The \(N\)-day breakout has become one of the most popular trendfollowing techniques. Its rules are simply:
Buy when today's high crosses above the high of the past \(N\) days.
- Sell when today's low crosses below the low of the past \(N\) days.
Using these basic rules, you would always be holding a long or short position, reversing direction whenever there is a new signal. A slightly more conservative set of rules is:
- Buy when today's close is above the high of the past \(N\) days.
- Sell when today's close is below the low of the past \(N\) days.
Using the close offers a confirmation of the new direction at the cost of setting the new position later in the day than the first set of rules. The intention of the \(N\)-day breakout is to react immediately to an event that drives prices higher than they have been recently. Figure 5.22 shows a buy and sell breakout in Merck based on a 5 -day calculation period. The buy signal occurs in early
January 2002 when prices turn up after a decline under \(\$ 54\). The third day up after the double bottom makes a new high above the previous 5 days. Although there is a wide-ranging day four days later, it fails to make a 5 -day low and the buy signal remains in effect until after prices peak on January 20. Four days later a new low generates a sell signal that is held for the rest of the chart. Two attempts to rally only succeed in making highs above the prior three days, leaving the short sale in place.
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0452.jpg?height=832&width=1313&top_left_y=650&top_left_x=76)
FIGURE 5.22 \(N\)-Day breakout applied to Merck, using a breakout period of 5 days.
The risk characteristic of the breakout system is similar to that of both the swing method and point-and-figure. Risk is the difference between the entry price and the point at which an N -day high or low would reverse the signal. The larger the calculation period, the larger the
risk. This is the primary feature that distinguishes eventdriven techniques from time-driven methods, such as a moving average.
A "Comparison of Major Trend Systems," including the \(N\)-day breakout, can be found in Chapter 8 after a discussion of time-based trends. These entry and risk characteristics are important when you select a trending system, and they vary considerably between event-driven and time-based methods.
\section*{Donchian's 4-Week Rule}
Breakout strategies have a long, successful history. In the mid-1970s, Playboy's Investment Guide reviewed Donchian's 4-Week Rule as "childishly simple . . . was recently discovered to rank premiere among a dozen widely followed mechanical techniques." Even now, simple trend-following systems continue to have success. Donchian's method used the following rules:
1. Go long (and cover shorts) when the current price exceeds the highs of the previous four calendar weeks.
2. Sell short (and liquidate longs) when the current price falls below the lows of the previous four calendar weeks.
3. When trading futures, roll forward if necessary into the next contract on the last day of the month preceding expiration.
In 1970, The Traders Note Book (Dunn and Hargitt Financial Services) rated the 4-Week Rule as the best of
the popular systems of the day, based on 16 years of history. The system satisfies the basic concepts of trading with the trend, limiting losses and following well-defined rules. It bears a great resemblance to the principle of Keltner's Minor-Trend Rule, modified to avoid trading too often.
\section*{Modifying the \(N\)-Day Rule}
Strategy development platforms as well as spreadsheets allow us to take many simple ideas and examine them in great detail, sometimes to excess. We can test the \(N\)-day breakout, the \(N\)-week breakout, and even the \(N\)-minute breakout. Using short time intervals and adding volatility, we get the volatility breakout strategy, popular in the 1990s, and discussed when we look at intraday trading.
In the \(N\)-day breakout, the determination of \(N\) is critical to the success of this system. While the most obvious approach to finding \(N\) is by back-testing a broad range of calculation periods, it has also been suggested that \(N\) could be based on the relationship of normal volatility to current volatility: 9
\[
N_{t}=N_{l} \times \frac{V_{n}}{V_{c}}
\]
where:
\(=\) the number of days used for today's calculation
= the initial number of days used for "normal" markets
\(\eta_{1}=\) the normal volatility measured over historical data \(=\) the current volatility measured over a fixed period shorter than the period used to define normal volatility, \(V_{n}\). Typically, this is less than \(1 / 4\) of the longer period.
As the current volatility increases, the number of days used in today's calculation decreases. This is also an adaptive technique. More can be found in Chapter 17.
When trading stocks, traders may prefer to define \(N\) as a multiple or fraction of the calendar quarter. That would relate the length of the trend to earnings announcements. A multiple of three months would smooth out those price reactions while a shorter period would try to capture the trend leading up to the announcements.
\section*{Testing the \(N\)-Day Rule}
Using a development platform, it is a simple matter to test the \(N\)-day breakout on any stock or futures market. In the following example, the same markets and the same data interval were used as previously used in the point-and-figure tests, Table 5.2 . Although testing methods will be discussed in Chapter 21, this process is needed to understand the N -day breakout and to introduce concepts that will be used throughout this book.
\section*{Apple (AAPL) Breakout Tests}
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0456.jpg?height=608&width=1323&top_left_y=132&top_left_x=69)
FIGURE 5.23 Apple breakout tests.
The \(N\)-day breakout results, in Table 5.3, are remarkable consistent. All markets were tested from January 2000 to November 2017 using calculation periods from 10 to 120 days, in increments of 10 days. The purpose was to get a broad view of performance. The average "best" calculation period was 93 days, typical of a macrotrend approach. Of the 23 tests performed on each market, seven of the markets had tests that were all profitable (see the last column in the table), and the average percentage of profitable tests was \(79 \%\). For point-andfigure, the average tests with positive returns was \(63 \%\).
Most important to traders, the net profits for the breakout system was more than 15 times greater than point-and-figure. In addition, it wasn't necessary to find the different ranges to test for each market and most of the selections had a similar number of trades. The consistency of the results adds confidence to the robustness of the method.
A closer look at the pattern of test results for Apple and the emini S\&P, Figures 5.21 and 5.22 , also shows consistency greater than that of the point-and-figure tests, Figures 5.23 and 5.24. For both Apple and the S\&P, the shorter calculation periods are less predictable. These patterns will compare closely with moving average tests rather than point-and-figure, where both use a rolling calculation.
\section*{Weekly Breakouts}
Weekly breakouts were introduced with Donchian's 4Week Rule. The original purpose for the Weekly Rule was to look at prices only on Friday. The close on Friday is considered important because it is the evening up at the end of the week, in the same sense as the daily close is considered the most important price of the day because all accounts are settled at that price. Many traders have the opinion that holding a position over a weekend is the only thing worse than holding it overnight. This evening-up process is expected to prevent false signals that may occur midday or midweek during periods of low liquidity. Weekly data are also smoother than daily data, and often show a clearer trend.
\section*{TABLE 5.3 Breakout test results using data from 2000 through November 2017.}
\section*{From January 2000 through November 2017}
\begin{tabular}{|l|c|c|c|c}
\hline Symbol Name & \begin{tabular}{c}
Best \\
Period
\end{tabular} & \begin{tabular}{c}
Tested \\
Range
\end{tabular} & \begin{tabular}{c}
No. \\
of
\end{tabular} & Tot: \\
\hline From To & Tests & Long \\
\hline
\end{tabular}
\section*{Interest rate futures}
\begin{tabular}{|c|c|c|c|c|c|c|}
\hline TU & \begin{tabular}{|l|}
2-Year \\
Notes
\end{tabular} & 80 & 10 & 120 & 23 & 403896 \\
\hline FV & \begin{tabular}{l}
5-Year \\
Notes
\end{tabular} & 100 & 10 & 120 & 23 & 292547と \\
\hline US & \begin{tabular}{l}
30-Year \\
Bonds
\end{tabular} & 40 & 10 & 120 & 23 & 183893^ \\
\hline EBL & \begin{tabular}{l}
Eurobund \\
(10 Year)
\end{tabular} & 70 & 10 & 120 & 23 & 399090C \\
\hline
\end{tabular}
\begin{tabular}{|c|c|c|c|c|c|c|}
\hline \multicolumn{7}{|c|}{ Index } \\
\hline ES & \begin{tabular}{l}
emini \\
S\&P
\end{tabular} & 115 & 10 & 120 & 23 & 191808\& \\
\hline NQ & \begin{tabular}{l}
Nasdaq \\
100
\end{tabular} & 115 & 10 & 120 & 23 & 1934285 \\
\hline DAX & DAX & 69 & 10 & 120 & 23 & 19918; \\
\hline \multicolumn{7}{|c|}{ Energy } \\
\hline CL & Crude oil & 115 & 10 & 120 & 23 & 153521 C \\
\hline HO & \begin{tabular}{l}
Heating \\
oil
\end{tabular} & 110 & 10 & 120 & 23 & 97719: \\
\hline \multicolumn{7}{|c|}{ Metals } \\
\hline GC & Gold & 90 & 10 & 120 & 23 & 195701C \\
\hline HG & Copper & 120 & 10 & 120 & 23 & 540575C \\
\hline PA & Palladium & 80 & 10 & 120 & 23 & 202148c \\
\hline \multicolumn{7}{|c|}{ Currency } \\
\hline CU & Euro & 105 & 10 & 120 & 23 & 199431: \\
\hline
\end{tabular}
\begin{tabular}{|l|l|l|c|c|c|r|}
\hline AAPL & Apple & 120 & 10 & 120 & 23 & \(17 \%\) \\
\hline AMZN & Amazon & 115 & 10 & 120 & 23 & 103 \\
\hline BAC & \begin{tabular}{l}
Bank of \\
America
\end{tabular} & 115 & 10 & 120 & 23 & 19.15 \\
\hline WMT & Walmart & 30 & 10 & 120 & 23 & 17.9 \\
\hline
\end{tabular}
Typical trading rules for a weekly breakout system most often use the closing prices:
■ Buy (and close out shorts) if the closing price on Friday exceeds the highest closing price of the past \(N\) weeks.
Sell short (and close out longs) if the close on Friday is below the lowest closing price of the past \(N\) weeks.
\section*{emini SP futures}
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0459.jpg?height=552&width=1228&top_left_y=1024&top_left_x=161)
FIGURE 5.24 emini S\&P breakout tests.
The main drawback of this model is that the risk can be very high. The initial risk of a new long position is the difference between the highest and lowest closing prices of the past \(N\) weeks. In addition, even if penetrated, the
position is not liquidated until the close of Friday, or even the open on Monday if the calculations are made after the Friday close. This could be very risky; however, that risk is offset by the smoothing effect of weekly data. It may be that accepting higher risk is better than being subjected to more frequent false signals. When a series of individual trade losses is viewed as a single, larger loss, the risk of weekly positions may not seem quite so large.
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0460.jpg?height=124&width=148&top_left_y=628&top_left_x=63)
Traders will find that the basic breakout method is one of the important trending techniques, and it is used throughout this book as a benchmark study. In Chapter 8 it is included in "Comparison of Major Trend Systems." A spreadsheet is also available on the Companion Website, TSM N-Day breakout example using BA (Boeing Aircraft), that allows testing of this method.
\section*{Avoiding Problems Programming the Weekly Breakout}
The Weekly Rule is often thought of as having signals only on Friday; however, it can be the last close of the week when there is a holiday on Friday. When trading, you will know which days are holidays, but when programming and testing a weekly system it will be necessary to look ahead to see when the week has ended.
To avoid this problem, many charting systems provide weekly data on request, converting from daily. The close of the week will be correct, regardless of holidays. It is
best not to try to use daily data to test a weekly strategy.
\section*{Dynamic Breakout System}
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0461.jpg?height=130&width=150&top_left_y=258&top_left_x=64)
While the \(N\)-day breakout adapts to price moves and volatility, placing orders for entry and exit one day ahead may improve timing. In his Dynamic Breakout System (DBS), \({ }^{10}\) Stridsman anticipates the entry and exit points based on a factor of the standard deviation of recent prices, then places stop orders for the next trading day. He also concludes from his study that the pattern of when an exit stop is hit falls into two groups, those that get stopped out very quickly and the others that hold the trade for a much longer time. From this information, he expects traders to position their stops better. A program that generates this information, TSM Dynamic Breakout System, is available on the Companion Website.
\section*{The N-Day Breakout Applied to Stocks}
Most literature on breakout systems applies this technique to futures markets. The primary differences between futures and stocks are that futures markets are generally less correlated and have higher leverage. Leverage in futures trading will cause a small percentage move to yield a relatively high return. In addition, the cost of trading futures is almost negligible compared to the face value of the contract. For example, one S\&P emini contract costs less than \(\$ 5\) per trade. At an S\&P price of 2500 and a value of \(\$ 50\) per big point, one contract has a value of \(\$ 125,000\), making the commission cost about \(0.4 / 100\) ths of a basis point
(0.00004). While you can trade up to 500 shares of a stock for a flat fee of \(\$ 8\) or less, most stocks average less than \(\$ 30\) per share, about 2.6 basis points. To decide the success of trading either futures or stocks, it is necessary to show the returns in terms of dollars per contract or cents per share. Only then can you decide if commissions and slippage can be covered comfortably and still net a profit.
\section*{Donchian's 40/20 Channel Breakout}
Before we applaud newer developers for innovation, we must give the originators credit. Richard Donchian created what now seem to be very simple trading methods, but in the 1960s while working at Hayden Stone, he implemented a number of technical systems that were groundbreaking. They included moving average and breakout systems. At the time, any
systematic trend-following method was state-of-the-art and profitable.
The 40/20 channel breakout, also called Donchian Channels, was the earliest \(N\)-day breakout that is recorded. The longer period was used for entries and the shorter for exits, very much like the Turtles method that follows.
\section*{The Turtles}
During the mid-1980s the group known as the Turtles, founded by Richard Dennis and Bill Eckhardt, was the biggest trading sensation, much like Monroe Trout in the later 1980s and "Jim" Simons' Renaissance Asset
Management in the 1990s. They all maintained a high degree of secrecy with regard to their trading methods. Years after the group disbanded, the rules and operations of the Turtles became public through publications of Michael Covel and Curtis Faith, 11 among others.
The method is based on an \(N\)-day breakout, with a number of add-on rules that seem to be rooted in trader experience. The following summary should be sufficient to test the concepts, although it is not clear how much discretion was allowed in following the signals. There are a number of subtle rules and variations presented in the original material that are not included here. Underlying the process was the imperative that you can't miss the trade.
During the early 198 os the futures markets were not as diverse as now, and commodities made up a larger part of the portfolio. Only markets that traded on U.S. exchanges were included.
\section*{The Turtle Rules}
There are two systems, \(S 1\) and \(S 2\); however, there is no indication of what proportion of assets are allocated to each. We will assume that the capital is apportioned equally. The two versions have differences in both the positioning of stop-losses and the method of compounding, and those rules are combined here. Both are explained.
\section*{System 1 (S1)}
1. Enter a long position when the intraday high exceeds the highest high of the previous 20 days. Exit the long position when the intraday low falls below the lowest low of the previous 10 days.
2. Enter a short position when the intraday low falls below the lowest low of the previous 20 days. Exit the short position when the intraday high exceeds the highest high of the previous 10 days.
3. Filter Rule. Ignore the \(S 1\) entry if the previous \(S 1\) entry was profitable (whether or not it was taken). However, if the prior \(S 1\) trade was a loss of at least \(2 \times L\), then the trade could be taken. \(L\) is a 20-day average-off true range volatility measure,
\[
\frac{\left(19 \times L_{t-1}+T R_{t}\right)}{20}
\]
where \(T R\) is the daily true range, \(t\) is today, and the conversion factor is the amount that transforms the point value of a market into its dollar value. We will call this the big point value (BPV).
\section*{System 2 (S2)}
1. Enter a long position when the intraday high exceeds the highest high of the previous 55 days. Exit the long position when the intraday low falls below the lowest low of the previous 20 days. Traders were allowed discretion in selecting a period slightly shorter than 55 days.
2. Enter a short position when the intraday low falls
below the lowest low of the previous 55 days. Exit the short position when the intraday high exceeds the highest high of the previous 20 days.
3. There was no filter for method \(S 2\).
\section*{Risk Control}
1. A stop-loss is placed a distance of \(2 L\) from the initial entry.
2. Trades are exited on the first occurrence of:
a. The stop-loss
b. An \(S 1\) or \(S 2\) reversal
c. A loss of \(2 \%\) relative to the portfolio (where \(2 L\) is equal to \(2 \%\) of the portfolio)
3. The position size is determined by equalizing \(L \times B P V\) across all markets; then 1 unit size \(=(1 \%\) of the investment \() /(L \times B P V)\)
4. Position limits restrict the maximum unit size that could be traded in correlated markets:
a. Single market, \(4 \times\) unit size
b. Closely correlated markets (e.g., energy complex, precious metals, currencies, shortterm rates), \(6 \times\) unit size
c. Less correlated markets (related by inflation or other factors), \(10 \times\) unit size
d. Any net position, long or short, \(12 \times\) unit size
5. Compounding positions.
a. Add another unit (or \(1 / 2\) unit) for every profitable price move equal to \(L\), measured from the actual entry price.
b. A maximum of 5 units are allowed (this is different from 4a).
c. A stop-loss is set at \(1 / 2 L\) on day 1 and \(2 L\) afterward (see alternate stops below). Once a second unit is bought, all stops are increased to \(2 L\). For each subsequent unit, stops were brought to \(2 L\) measured from the most recent entry, so the total trade risk was
\(2 L \times\) total contracts at all times during the trade.
d. Alternate stops. Stops could be placed at \(1 / 2 L\) instead of \(2 L\). If stopped out, that position could be reentered at the original entry price.
6. Portfolio risk management. For every \(10 \%\) drawdown in the portfolio, measured from the peak equity, the position size was cut by \(20 \%\). (At the time, most futures managers considered \(50 \%\) the maximum loss allowed.) For every \(6^{2} / 3 \%\) recovery, \(10 \%\) was added back. Costs were included when calculating these values.
\section*{Comment}
Richard Dennis was reported to have been one of the most successful floor traders during the late 1970s and early 1980 os. The industry was surprised when he formed
the Turtles but expected great success. It is not known if his previous success was based on using this method or one similar to it. Floor traders usually profit from the bid-asked spread during active trading periods, although Dennis was also said to hold large positions overnight.
It often happens that a good period in the market will encourage you to expand your operation. As Fate would have it, that good period is often followed by a bad one. As Will Rogers said, "Good judgment comes from experience, and a lot of that comes from bad judgment."
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0467.jpg?height=136&width=150&top_left_y=711&top_left_x=62)
The basic breakout concept with the initial position size and stop-loss is programmed as TSM Turtle, available on the Companion Website. While it does not attempt to duplicate all the rules, it is good to see the underlying method returns profits, and subtle additions may add to those returns. The period prior to 1984 should be of interest because it was this period in which Dennis made the decision to form the Turtles.
Figures 5.25 shows the cumulative profits (closed out trades only) for copper beginning in 1980. The slower system \(S 2(55 \times 20)\) shows steady profits for the entire 38 years, which is typical of a long-term trend following method. The faster system S1 \((20 \times 10)\) shows profits only for the first part of the 1980s, the period in which Dennis would have decided to form the Turtles. Remembering that this is only one market and many of the rules are not implemented, the reader would need to look further to decide if this is the general pattern or simply a poor example.
By way of comparison, the same 38 -year period was tested using the \(N\)-Day Breakout and the results of the optimization are shown in Figure 5.26. Copper was a very trending market, and all but the shortest two calculation periods returned a net profit. In retrospect, the returns of the slower \(55 \times 20\) Turtles strategy are shown as the horizontal line. Given that markets had more trend when Dennis started his program, he must be credited for having the foresight to use breakout systems ahead of the crowd.
Copper total profits
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0468.jpg?height=644&width=1317&top_left_y=764&top_left_x=72)
FIGURE 5.25 Copper profits for the slower and faster trends in our version of the Turtle system.
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0469.jpg?height=730&width=1339&top_left_y=61&top_left_x=63)
FIGURE 5.26 Relative performance of \(N\)-day breakout, copper futures, 1980-2017, with calculation periods from 10 to 120 days.
\section*{NOTES}
1 Edwin Lefèvre, Reminiscences of a Stock Operator (Burlington, VT: Books of Wall Street, 1980). First published by George H. Doran, 1923.
\(\underline{2}\) Jesse Thompson, "The Livermore System," Technical Analysis of Stocks \& Commodities (May 1983).
3 J. Welles Wilder, Jr., New Concepts in Technical Trading Systems (Greensboro, NC: Trend Research, 1978).
4 Victor De Villiers, The Point and Figure Method of Anticipating Stock Price Movements (New York: Trader Press, 1966; reprint of 1933 edition), p. 8.
5 Kermit C. Zieg, Jr., and Perry J. Kaufman, Point and Figure Commodity Trading Techniques (Larchmont, NY: Investors Intelligence, 1975). This book contains complete tabularized results of both point-and-figure tests.
6 Adam Hewison, "The Will Rogers Theory of Point \& Figure Trading," Technical Analysis of Stocks \& Commodities (August 1991).
7 Wyckoff (Market Techniques, 1933), p. 2.
\(\underline{8}\) Bramesh Bhandari, "Building Profits with Renko Bricks," Modern Trader (September 2017).
9 Andrew D. Seidel and Philip M. Ginsberg, Commodities Trading (Englewood Cliffs, NJ: Prentice-Hall, 1983).
10 Thomas Stridsman, "Revelation Trading," Futures (February 1998).
11 Michael W. Covel, The Complete TurtleTrader (Collins, 2007), and Curtis Faith, The Original Turtle Trading Rules (2003), originalturtles.org.
\section*{CHAPTER 6}
\section*{Regression Analysis}
Regression analysis is a way of measuring the relationship between two or more sets of data, or just price and time. A stock analyst might want to know how the price of Barrick Gold Corporation (ABX) changes with the price of physical gold. An economist might want to know how the value of the U.S. dollar is dependent on interest rates, inflation, and the trade balance. A hedger or arbitrageur could use the results to establish the relative fair value of two related products, such as palm oil and soybean oil, in order to select the cheaper product or to profit from price distortions; or, as an investor you might simply want to find the strongest stock in the banking sector. A straight line fit through a series of prices is also a way of drawing a trendline. Regression analysis is a valuable tool for traders.
\section*{COMPONENTS OF A TIME SERIES}
Regression analysis is often used to identify the main component of a time series, the trend. With some variation, it can also be used to isolate the seasonal (or secular trend) and cyclic components. These three factors are present in all commodity price data as well as many stocks. The part of the data that cannot be explained by these three elements is considered random, or unaccountable price movement.
Trends are the basis of many trading systems. Longterm trends can be related to economic factors, such as changing interest rates, inflation, shifts in the value of the U.S. dollar due to the balance of trade, and even consumer confidence. Economists use weekly and monthly economic data to forecast future prices, gross domestic product (GDP), and crop production, among many others. Because of the infrequent data, these forecasts are necessarily long-term, called macrotrends, and can have significant uncertainty, which can also be measured.
The reasons for the existence of short-term trends are not always as clear. Expectations of a merger or government approval of a new drug, a temporary disruption in oil supply, or a dockworkers slowdown could all be catalysts for higher prices. However, trends that survive for only a few days or weeks cannot be explained by macroeconomic factors but are usually the result of investor behavior - reaction to the constant flow of news and market reports. Traders will often use the longer trends, based on fundamentals, to bias trading in that direction.
Large sustained fluctuations above and below the longterm trend are attributed to cycles. Both business and industrial cycles respond slowly to changes in supply, demand, and technology. The decision to close a factory or build more container ships or office buildings is not made quickly, nor can the decision be easily changed once it has been made. Stimulating economic growth by lowering interest rates is not a cure that works overnight. Opening a new mine, finding new crude oil deposits, or
building an automobile assembly plant in another country makes the response to increased demand slower than the act of cutting back on production. Moreover, once the investment has been made, business is not inclined to stop production due to marginal returns or even small losses.
Seasonality, the third component of price movement, is a cycle that depends on the calendar year. The most obviously affected are crops, which have planting and harvesting cycles attributed directly to weather. The travel industry is much more active in the summer than winter, and there is a higher demand for electricity in the summer. The oil industry shifts their refining from heating oil to gasoline in February and March as winter demand comes to an end, then changes back again in the late summer. The fashion industry anticipates the changing seasons in order to introduce their new lines of clothing.
The random element of price movement is a composite of everything unexplained. In later sections an
Autoregressive Integrated Moving Average (ARIMA) will be used to find trends and cycles that may exist in the leftover data. This chapter concentrates on trend identification, using regression analysis. Seasonality and cycles are discussed in Chapters 8 and 9. Because the basis of a strong trading strategy is its foundation in real phenomena, serious students of price movement and traders should understand the tools of regression analysis to avoid incorporating erroneous relationships into their strategies. A sound premise is the basis for success.
\section*{CHARACTERISTICS OF THE PRICE} DATA
A time series is not just a series of numbers but ordered pairs of price and time. There is a special pattern in the way price reacts to periodic reports, and the way prices fluctuate due to the time of year. Most trading strategies use one price per day, usually the closing price, while economic analysis operates on weekly or monthly average data, but might use a single price (e.g., "week on Friday") for convenience. The infrequent data (also called low-frequency data), due to the reporting of most major statistics, forces a long-term perspective to the analysis.
The use of less frequent data also causes a smoothing effect. The highest and lowest prices rarely appear on the last day of a month and do not show up in average monthly data, causing the data to seem less volatile. Even when using daily closing price data, the intraday highs and lows have been eliminated, and the closing prices show less volatility.
\section*{Selection of the Calculation Period}
A regression analysis, which can identify price direction over a specific time period, will not be influenced by cyclic patterns or short-term trends that are the same length as the time interval used in the analysis. For example, if we use 12 months of data, then the average of those 12 months includes an entire season of price changes. If the seasonal pattern was a perfect cycle, increasing by \(15 \%\) during high-demand and dropping by
\(15 \%\) during harvest or high-supply, then the 12-month average would neutralize both up and down swings. Therefore, calculation periods equal to multiples of a calendar year are used for deseasonalizing the data.
In Figure 6.1, a regression line is calculated using the cash corn prices for 30 years ending in 2010, along with a 1-year (12-month) moving average. Although the regression is influenced by the exceptional rally in 2008, the upward-slanting center line increased from \(\$ 2.36 /\) bushel to \(\$ 2.88\) over the thirty years, or \(0.73 \%\) per year. We can think of that as the inflation rate for corn, based on the combination of real inflation, the changing value of the U.S. dollar, improvements in technology that increase the crop size, higher consumption, and other factors. A line parallel to the regression line was drawn across the lows of the price history to show the uniform increase over time.
The 12-month moving average plotted in Figure 6.1 does not appear to reflect seasonal price changes, but the difference between the monthly price and the corresponding moving average value would clearly show seasonal changes, as we will see in Chapter 10 . If you do not want to remove the effects of seasonality, the time interval of the regression analysis or moving average should be 3 months or less. By using a shorter calculation period, a regression analysis, or any trend technique, may be used to identify any sustained price move.
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0476.jpg?height=554&width=1327&top_left_y=64&top_left_x=63)
FIGURE 6.1 A basic regression analysis results in a straight line through the center of prices.
In classic time-series decomposition, the trend is removed first by subtracting the value of the regression line from the corresponding price. The detrended series is then used to find the cyclic and seasonal components. Detrending can also be done by taking the first differences of daily closing prices, \(P_{t}-P_{t-1}\), for the entire data series.
\section*{LINEAR REGRESSION}
When most people talk about regression, they normally think about drawing a straight line through the center of some period of price movement, such as the middle line in Figure 6.1. But regression is a simple and powerful tool for explaining the relationship between two price series. In econometrics, analysts will use multiple regression to find the relationship between various factors, such as supply, demand, inflation, and price.
In this chapter we look at how regression can be used:
- As a trading tool for a single market
- To find the relationships between two markets or two data series
■ To rank markets
The inputs to a regression analysis must be two time series of the same frequency (i.e., daily, monthly) and the same number of data points. For trading we will use daily data but economic relationships will depend on the availability of the data. We start with the linear relationship between two price series, \(X\) and \(Y\). A linear relationship will try to find the value of \(Y\) (the dependent variable) for each value of \(X\) (the independent variable) using the formula for a straight line, \(Y=a+b X\), where \(b\) is the slope of the line, and \(a\) is the \(Y\)-intercept, the point where the line crosses the \(Y\) axis when the value of \(X\) is zero.
The linear regression is also called a straight-line fit, or simply the best fit. It selects the straight line that comes closest to all of the data points. The result tells you that, for example, for every move of \(\$ 1\) in corn (series \(X\) ), we can expect a move of \(\$ 2.50\) in soybeans (series \(Y\) ). We can also expect inflation, or combined economic factors, to increase the price of corn by \(0.000029 \%\) per day, as shown in Figure 6.1. We will apply a linear regression in two examples, first to explain the price movement of corn based on the price of soybeans, then to explain the price of Barrick Gold Corporation (ABX) based on the price of physical gold.
\section*{Explaining, Not Predicting}
You may have noticed that we refer to explaining the Barrick Gold stock price in terms of the price of gold bullion. We do not say that we can predict the price. We are finding the past relationship between two price series. You may decide that this relationship can be used to trade those two markets whenever prices move too far from one another. The regression analysis may establish what you see as a fair value for one market based on the price of the other. In order to forecast a price, you will need to establish that conditions at the date of your forecast are likely to be the same as the period over which the regression was calculated. You must also account for the loss of accuracy, or confidence, as you forecast further into the future.
\section*{Calculating the Best Straight-Line Fit}
The method of least squares is the process for finding the regression line, and the one seen in Figure 6.1. It calculates the best straight-line fit through a selected period of price movement. This is done in the same way as finding the relationship between two price series, except that we will substitute the simple sequence \(1,2,3\), \(4, \ldots\) for the second series to represent time. We do not use the date as the dependent variable because weekends and holidays break the continuity of the series.
Our example uses ten days of price movement in Walmart during March 2002. To find the best straightline fit, we begin with the equation for a straight line:
\[
Y=a+b X
\]
In this equation, \(Y\) is the dependent variable because it is a function of the value of \(X\), the independent variable. The slope, \(b\), is the relative change in \(Y\) for every unit change in \(X\). Therefore, if \(b=0.20\) and \(X\) are sequential days, then for every day, the price \((Y)\) gains \(\$ 0.20\). The \(Y\)-intercept, \(a\), is an adjustment in the price level to bring \(X\) and \(Y\) into alignment. It is also the point at which the straight line crosses the \(Y\)-axis when
\(X=0\)
\section*{Method of Least Squares}
The method of least squares calculates the sum of the squares of all the differences between the price and the corresponding value of a straight line and chooses the line that has the smallest total deviation. The mathematical expression for this is:
\[
S=\sum_{i=t-n+1}^{t}\left(y_{i}-\hat{y}_{i}\right)^{2}
\]
where
\(S=\) the sum of the squares of the error at each of the 10 Walmart points on the straight line (one point for each price, designated by \(i=1,2,3, \ldots\) )
\(y_{i}=\) the price of Walmart on day \(i\)
\(\begin{aligned} \hat{y}_{i}= & \text { the estimated value of this price on the straight } \\ & \text { line }\end{aligned}\)
\(y=\) the difference between the actual price \(y_{i}\) at \(i\) and
the predicted price \(\hat{y}_{i}\)
\section*{Walmart Regression and Error Deviation}
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0480.jpg?height=695&width=1341&top_left_y=272&top_left_x=60)
FIGURE 6.2 Error deviation for method of least squares.
Graphically, the individual deviations, or errors, for the best fit may look like those in Figure 6.2. Each actual data point is \(\left(1, y_{1}\right),\left(2, y_{2}\right),\left(3, y_{3}\right), \ldots\) and the corresponding position on the regression line is \(\left(1, \hat{y}_{1}\right),\left(1, \hat{y}_{2}\right),\left(1, \hat{y}_{3}\right), \ldots\) The sum of the squares of the errors is:
\[
S=\sum_{i=t-n+1}^{t}\left(y_{i}-\hat{y}_{i}\right)^{2}
\]
\(S=\left(y_{1}-\hat{y}_{1}\right)^{2}+\left(y_{2}-\hat{y}_{2}\right)^{2}+\cdots+\left(y_{10}-\hat{y}_{10}\right)^{2}\)
The straight line that causes \(S\) to be the smallest possible value will be the best choice for the 10 Walmart data points. The square of \(y,-\frac{1}{y}\) is always positive; therefore, prices above and below the regression line are treated equally. The least-squares method for solving the Walmart time-price relationship can be found directly by solving the equations
\[
\begin{aligned}
& b=\frac{N \sum x y-\sum x \sum y}{N \sum x^{2}-\left(\sum x\right)^{2}} \\
& a=\frac{1}{N}\left(\sum y-b \sum x\right)
\end{aligned}
\]
where
\(N=\) the number of data points (10 in the example)
\(\Sigma=\) the sum over \(N\) points
This is easily done in a spreadsheet by entering Walmart prices in column B (see Table 6.1) and calculating the individual expressions needed for the two formulas in the next columns We can now substitute the values on the Sum line into the two equations:
\section*{TABLE 6.1 Calculations for the Walmart best fit.}
\begin{tabular}{|c|c|c|c|c|c|c|c|c|c|}
\hline 4. & A & \(B\) & C & D & E & F & G & H & 1 \\
\hline 1 & Date & Wal-Mart & x & \(X^{\wedge} 2\) & XY & \(y^{4} 2\) & \begin{tabular}{c}
Regression \\
Value
\end{tabular} & & Solution \\
\hline 2 & 12/7/2017 & 96.78 & 1 & 1 & 96.78 & 9366.37 & 96.379 & A \(=\) intercept & 96.143 \\
\hline 3 & 12/8/2017 & 96.55 & 2 & 4 & 193.10 & 9321.90 & 96.615 & X \(=\) Slope & 0.236 \\
\hline 4 & 12/11/2017 & 96.93 & 3 & 9 & 290.79 & 9395.42 & 96.851 & & \\
\hline 5 & 12/12/2017 & 96.7 & 4 & 16 & 386.80 & 9350.89 & 97.087 & & \\
\hline 6 & 12/13/2017 & 97.76 & 5 & 25 & 488.80 & 9557.02 & 97.323 & & \\
\hline 7 & 12/14/2017 & 97.13 & 6 & 36 & 582.78 & 9434.24 & 97.559 & & \\
\hline 8 & 12/15/2017 & 97.11 & 7 & 49 & 679.77 & 9430.35 & 97.795 & & \\
\hline 9 & 12/18/2017 & 97.9 & 8 & 64 & 783.20 & 9584.41 & 98.031 & & \\
\hline 10 & 12/19/2017 & 98.8 & 9 & 81 & 889.20 & 9761.44 & 98.267 & & \\
\hline 11 & 12/20/2017 & 98.75 & 10 & 100 & 987.50 & 9751.56 & 98.503 & & \\
\hline 12 & Sum & 974.41 & 55 & 385 & 5378.72 & 94953.6 & & & \\
\hline
\end{tabular}
\[
\begin{aligned}
b & =\frac{10 \times 5378.72-55 \times 974.41}{10 \times 385-55 \times 55} \\
& =\frac{53789.2-53592.6}{3850-3025} \\
& =0.23593 \\
a & =\frac{1}{10} \times(974.41-0.23594 \times 55) \\
a & =96.143
\end{aligned}
\]
The equation for the least-squares approximation is:
\[
Y=96.143+0.236 X
\]
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0482.jpg?height=128&width=144&top_left_y=1720&top_left_x=65)
Selecting values for \(X\) and solving for \(Y\) gives the results shown in the right column of Table 6.1, "Regression Value," representing the straight line fit.
This is shown along with the original prices for Walmart in Figure 6.2. The straight-line increases by
approximation \(23.6 \$\) per day and the approximation line starts at 96.143, where \(X=0\). The spreadsheet used for this can be found on the Companion Website as TSM Walmart Regression Analysis.
\section*{Excel Regression}
If you would rather not enter the formulas yourself, Excel's regression function can be found in the dropdown menu Data/Data Analysis (this is available as an "add-in" if not already loaded), then select "Regression." Assign the sequential values \((1,2,3, \ldots)\) as \(X\), the prices as \(Y\), and the output will be in a new worksheet. Excel will produce the analysis shown in Table 6.2. The \(Y\) intercept and slope can be found in the bottom left of the lower table. Also of interest is the correlation,
\(R\) Square \(=0.7504\), at the top, which shows the quality of the fit (reasonably good).
TABLE 6.2 Output from Excel's regression function.
\section*{SUMMARY OUTPUT}
Regression Statistics
Multiple R 0.8663
R Square
0.7504
Adjusted R
0.7192
Square
Standard
0.4370
\section*{Error}
Observations 10
\section*{ANOVA}
\begin{tabular}{|l|c|c|c|}
\hline & df & SS & \(\boldsymbol{M S}\) \\
\hline Regression & 1 & 4.5926 & .4 .5926 \\
\hline Residual & 8 & 1.5275 & .0 .1909 \\
\hline Total & 9 & 6.1201 & \\
\hline
\end{tabular}
\begin{tabular}{|l|l|c|l|}
\hline & Coefficients & StandardError & t Stat \\
\hline Intercept & 96.143. & 0.299 & 322.082 \\
\hline X Variable 1 & .0 .236. & 0.048 & .4 .904. \\
\hline
\end{tabular}
\section*{Corn Explained by Soybeans}
Finding the relationship between corn and soybean prices will tell the farmer whether planting one or the other is a better business decision. We use the same technique, but this time we use the corn and soybean price series instead of letting one be the simple integer sequence. Table 6.3 gives the cash prices and the intermediate calculations. These result in the slope \(=0.282\) and the \(y\)-intercept \(=0.336\), giving the equation for the regression as \(y=0.282+0.336 X\).
The Excel solution is shown in Table 6.4 with the
correlation, \(R=0.91\). Looking at the scatter diagram of the corn-soybean relationship, Figure 6.3, we see that if corn is selling at \(\$ 2.00 /\) bu we can expect soybeans to sell at \(\$ 5.00 /\) bu.
This is close to what would be expected for farm income. Corn yield is generally thought to be 2.5 times greater per acre than the soybean yield in most parts of the United States; then the ratio 1:2.5 will yield \(\$ 5\) for soybeans when corn is \(\$ 2\). The slope of the regression is 0.3358 , showing that our ratio was \(1: 2.98\). Notice that, at higher prices (right and up), points are scattered further from the line, indicating greater variation due to volatility.
\section*{TABLE 6.3 Calculations for the corn-soybean regression.}
Source: Illinois Statistical Service, Commodity Research Bureau, Commodity Yearbook, 1966-1982.
\begin{tabular}{|l|c|l|l|l|l|c|}
\hline Year & Seq & Corn \(\mathbf{y}_{\mathbf{i}}\) & Soy \(_{\mathbf{i}}\) & \(\mathbf{x}_{\mathbf{i}}{ }^{\mathbf{2}}\) & \(\mathbf{x}_{\mathbf{i}} \mathbf{y}_{\mathbf{i}}\) & \(\mathbf{y}_{\mathbf{i}}^{\mathbf{2}}\) \\
\hline 1956 & 1 & .1 .27 & .2 .43 & .5 .90 & .3 .09 & .1 .61 \\
\hline 1957 & 2 & .1 .19 & .2 .26 & .5 .11 & .2 .69 & .1 .42 \\
\hline 1958 & 3 & .1 .10 & .2 .15 & .4 .62 & .2 .36 & .1 .21 \\
\hline 1959 & 4 & .1 .10 & .2 .07 & .4 .28 & .2 .28 & .1 .21 \\
\hline 1960 & 5 & .1 .05 & .2 .03 & .4 .12 & .2 .13 & .1 .10 \\
\hline\(\vdots\) & \(\vdots\) & \(\vdots\) & \(\vdots\) & \(\vdots\) & \(\vdots\) & \(\vdots\) \\
\hline 1979 & 24 & .2 .25 & .6 .61 & .43 .69 & .14 .87 & .5 .06 \\
\hline 1980 & 25 & .2 .52 & .6 .28 & 39.44 & .15 .83 & .6 .35 \\
\hline 1981 & 26 & .3 .11 & .7 .61 & .57 .91 & .23 .67 & .9 .67 \\
\hline
\end{tabular}
\begin{tabular}{|l|l|l|l|l|l|l|}
\hline 1982 & 27 & .2 .50 & .6 .05 & 36.60 & .15 .13 & 6.25 \\
\hline Sums & & \(43 \cdot 38\) & 106.46 & 512.95 & 202.35 & 82.27 \\
\hline
\end{tabular}
TABLE 6.4 Excel solution for the corn-soybean regression.
\section*{SUMMARY OUTPUT}
\section*{Regression Statistics}
Multiple R 0.9135
R Square \(\quad 0.8345\)
Adjusted R
0.8279
Square
Standard
0.2888
Error
Observations 27
ANOVA
\begin{tabular}{l|c|c|c|c}
\hline & df & SS & \(\boldsymbol{M S}\) & \(\boldsymbol{F}\) \\
\hline Regression & 1 & 10.5106 & 10.5106 & 126.04 ؛ \\
\hline Residual & 25 & 2.0846 &. & \\
\hline Total & 26 & 12.5952 & & \\
\hline
\end{tabular}
\begin{tabular}{|l|l|l|l|l|}
\hline & Coefficients & \begin{tabular}{c}
Standard \\
Error
\end{tabular} & t Stat & P-vala \\
\hline Intercept & .0 .2825 & 0.1304 & .2 .1665 & .0 .040 \\
\hline
\end{tabular}
\begin{tabular}{|l|l|l|l|l|}
X Variable 1 & .0 .3358 & 0.0299 & 11.2271 & .0 .000
\end{tabular}
\section*{Gold Bullion and Barrick Gold Corporation}
A question often asked is, "If gold goes up by \(\$ 1\), how much will a gold mining share go up?" For this to make sense, the mining company should not be diversified but concentrated on gold production. To find how the stock price of Barrick Gold Corporation can be explained by the price of physical gold, we will first take a long view, from 1998 through 2017. It will be necessary to align the daily data because stocks do not always trade on the same days as futures, and we'll use gold futures to be practical. When there is a missing date, use the price from the previous day. In Table 6.5, we indexed the price data (columns \(D\) and \(E\) ) to see if that made a difference in the regression results - it did not.
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0487.jpg?height=795&width=1341&top_left_y=1084&top_left_x=60)
FIGURE 6.3 Scatter diagram of corn, soybean pairs
with linear regression solution.
\section*{TABLE 6.5 Spreadsheet for ABX-gold regression.}
\begin{tabular}{|c|c|c|c|c|c|c|c|}
\hline 4 & A & B & C & D & E & F & G \\
\hline 1 & Date & ABX & Gold Cash & \(\mathrm{Y}=\mathrm{ABX}\) & X \(=\) Gold & Index Reg & Price Reg \\
\hline 2 & 8/3/1998 & 12.93 & 286.1 & 100.00 & 100.00 & 125.20 & 16.19 \\
\hline 3 & 8/4/1998 & 12.98 & 286.1 & 100.39 & 100.00 & 125.20 & 16.19 \\
\hline 4 & 8/5/1998 & 13.27 & 287.9 & 102.63 & 100.63 & 125.36 & 16.21 \\
\hline 5 & 8/6/1998 & 13.22 & 287.8 & 102.24 & 100.59 & 125.35 & 16.21 \\
\hline 6 & 8/7/1998 & 13.18 & 285.7 & 101.93 & 99.86 & 125.16 & 16.18 \\
\hline 7 & 8/10/1998 & 13.22 & 285.6 & 102.24 & 99.83 & 125.15 & 16.18 \\
\hline 8 & 8/11/1998 & 12.68 & 284.8 & 98.07 & 99.55 & 125.08 & 16.17 \\
\hline 9 & 8/12/1998 & 12.68 & 285 & 98.07 & 99.62 & 125.10 & 16.18 \\
\hline
\end{tabular}
Using the Excel regression function applied to the prices (columns B and C), where \(Y=\mathrm{ABX}\) and \(X=\) gold, gave an intercept \(a=12.8841\) and a slope \(b=0.0115\). We interpret that as an increase of 1.15 in ABX for every \(\$ 1\) move in gold. However, Figure 6.4 shows that the price of gold has stayed high while ABX has dropped. The long-term best fit dampens both the upward and downward moves in order to find the center (Figure 6.5).
Most analysts and traders will consider it more relevant to use a small amount of data and recalculate each day. If we use a rolling 20-day regression, Figure 6.6 shows the results of the most recent 20 days, mid-December 2017. The intercept \(\mathrm{a}=7.8715\), and the slope \(b=0.004839\), a change of \(48 \$\) in ABX for every \(\$ 1\) change in gold. The direction of the linear regression
values tracks the trend of ABX nicely, and runs through the center of the price movement.
\section*{\(A B X\) and cash gold prices}
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0489.jpg?height=627&width=1327&top_left_y=282&top_left_x=63)
FIGURE 6.4 Prices of ABX and gold show that gold remained high while ABX declined from 2011.
\(A B X\) and regression values
60
50
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0489.jpg?height=596&width=1323&top_left_y=1244&top_left_x=65)
FIGURE 6.5 The best fit for ABX tracks the upward and downward move, but is greatly dampened due to trying
to fit a large amount of data.
ABX-Gold 20-Day Regression
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0490.jpg?height=358&width=1301&top_left_y=225&top_left_x=90)
13.4
— ABX — Regression estimate
FIGURE 6.6 ABX-Gold regression using only the last 20-days of prices.
\section*{Programming and Spreadsheet Tools}
In addition to the regression function in Excel Data Analysis, there are simple functions that can produce the same results. \(\operatorname{Slope}(y, x)\) returns the slope value, \(b\), when you enter the column lists for \(Y\) and \(X\). Intercept \((y, x)\) returns the \(y\)-intercept, \(a\), when you enter the same values for \(Y\) and \(X\). Once you know what to look for, it becomes easy.
In strategy development software, such as TradeStation, the functions that calculate linear regression are nearly the same. LinearRegSlope LinearRegValue, LinRegIntercept all produce the same results as Excel. Most often, traders are only interested in the slope as a way to identify the direction of prices. Using daily data,
they can add the slope value to the most recent price to project tomorrow's price:
\section*{Projected price \((1\)-day ahead \()=\) Today's price + Slope}
If they want to project \(n\) days ahead, they multiply the slope by \(n\) and add that value to today's price,
Projected price \((n\)-days ahead \()=\) Today's price \(+n \times\) Slope
As prices are projected further ahead, there is a much greater chance of error. This is discussed in a later section, "Confidence Bands." Note that when economist project they use the last value on the regression line, not the last price.
\section*{LINEAR CORRELATION}
Solving the least-squares equation for the best fit does not mean that the answer is useful. In the previous sections we used two price series that had a clear relationship; therefore, the results appeared reasonable. The least-squares method will always give an answer, even when there is nothing that makes one prices series dependent upon the other. You may think that two data items affect one another, such as the amount of disposable income and the purchase of television sets, but that might not be the case. Instead, the purchase of television sets may peak just before the Superbowl.
The linear correlation, which produces a value called the coefficient of determination \({ }_{r}^{2}\), or the correlation
coefficient, expresses the strength of the relationship between the data on a scale from +1 (perfect correlation) to o (no relationship). It may be even better to look at \(r\), which varies from +1 to -1 , rather than \(r^{2}\), because you then know whether the correlation is positive or negative. A negative correlation between two prices series means that when one goes up, the other goes down. When \(r=+1\) there is a perfect positive correlation, when \(r=0\) there is no correlation, and when \(r=-1\) there is a perfect negative correlation, as shown in Figure 6.7. This is the most practical way to find out whether two price series are moving in a similar manner. If \(r^{2}\) is less than about 0.20 , then the linear regression has no practical value. In the examples that looked at the corn-soybean relationship, the Excel results showed an \(\mathrm{r}^{2}=0.83\), very high, while the long-term ABX-gold correlation was only 0.26. For arbitrage purposes, however, high correlations mean little opportunity while moderately positive correlations are good. Another measurement, cointegration, will be helpful in qualifying arbitrage pairs, and is discussed in Chapter 13.
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0492.jpg?height=261&width=294&top_left_y=1466&top_left_x=63)
Return series 1
(a)
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0492.jpg?height=263&width=308&top_left_y=1465&top_left_x=401)
Return series 1
(b)
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0492.jpg?height=294&width=300&top_left_y=1464&top_left_x=752)
(c)
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0492.jpg?height=304&width=293&top_left_y=1455&top_left_x=1095)
(d)
FIGURE 6.7 Degrees of correlation. (a) Perfect positive linear correlation ( \(r=1\) ). (b) Somewhat positive linear
correlation ( \(r=0.5\) ). (c) No correlation ( \(r=0\) ). (d) Perfect negative linear correlation \((r=1)\).
To calculate the correlation coefficient, \(r\), for the most recent \(n\) days, where \(t\) is today, we use Pearson's Product-Momentum Correlation:
\[
r=\frac{1}{N} \sum_{i=t-n+1}^{t}\left[\left(\frac{x_{i}-\bar{x}}{s_{x}}\right)\left(\frac{y_{i}-\bar{y}}{s_{y}}\right)\right]
\]
In the calculation above, \(s_{x}\) and \(s_{y}\) are the standard deviations of \(x\) and \(y\), and \(\bar{x}\) and \(\bar{y}\) are the averages. The result \(r\) is interpreted as follows:
\(|\equiv+|\) A perfect positive linear correlation. The data points are along a straight line going upward to the right (Figure 6.7a). For every upward move in \(x\) there is a corresponding upward move in \(y\).
* 1 ) The scattered points become more uniformly distributed about a positive approximation line as the value of \(r\) becomes closer to +1 (Figure 6.7b).
\(r=0\) No linear correlation exists (Figures 6.7c, 6.7d).
*|,|(|) The scattered points become more uniformly distributed about a negative approximation line as the value of \(r\) becomes closer to -1 .
\(t=-\mid\) A perfect negative linear correlation, the line going downward to the right. For every upward move in \(x\) there is a corresponding downward move in \(y\).
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0494.jpg?height=129&width=149&top_left_y=63&top_left_x=63)
In Excel, the correlation function \(\operatorname{correl}(x, y)\) returns \(r^{2}\). The formula appears to be different, but it is only a regrouping of the factors. If you need to know whether the correlation is positive or negative, it will be necessary to do the calculation yourself. On the Companion Website, the spreadsheet, TSM ABX-Gold regression comparison of power fits, compares the formula given above with the Excel method.
\section*{Use of Returns or Price Differences for Correlations}
Because most price analyses involve the use of two time series, a strong trend can exaggerate the correlations by overshadowing the smaller movements. Inputs to correlations should be returns or price changes, not the actual prices. It is best if these changes are in percent, but for back-adjusted futures data, the price differences should be used. Most software, such as Excel, will calculate the correlation on whatever series you input, so it is your responsibility to give it the correct data.
\section*{Confidence Bands}
Regression analysis includes its own measure of accuracy called the confidence level. It is based on the size of the errors, the distance of the actual data from the regression line, and the number of data points. Looking back at Figure 6.3, the straight line cannot touch all the points, but its "goodness of fit" is best when the errors, \(e_{t}\) , are small. If the actual data points are \(y_{i}\) and their
corresponding value on the fitted line \(\hat{y}_{i}\), then \(s\) is the standard deviation of the errors,
\[
s=\sqrt{\frac{\sum\left(y_{i}-\hat{y}_{i}\right)^{2}}{N}}
\]
where \(i=1, N\), the number of data points.
Using the Excel function NORMDIST, we can find that the \(95 \%\) level is equivalent to 1.96 standard deviations. Then, a confidence band of \(95 \%\), placed around the forecast line, is written:
\[
\begin{aligned}
& 95 \% \text { upper band }=y_{i}+1.96 \sigma \\
& 95 \% \text { lower band }=y_{i}-1.96 \sigma
\end{aligned}
\]
Figure 6.8 a is an example of a forecast with a \(95 \%\) confidence band. The points that are outside the band are of particular interest and can be interpreted in one of two ways.
1. They are normal outliers, and prices are expected to correct the levels within the bands.
2. The model was not performed on representative or adequate data and should be reestimated with more data.
Figure 6.8b also shows that the forecast loses accuracy as it is further projected; the forecast is based on the size of the sample used to find the regression coefficients. The
more data included in the original solution, the longer the forecast will maintain its accuracy.
(a)
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0496.jpg?height=404&width=1214&top_left_y=355&top_left_x=176)
(b)
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0496.jpg?height=435&width=1133&top_left_y=1091&top_left_x=237)
FIGURE 6.8 Confidence bands. (a) A 95\% confidence band. (b) Out-of-sample forecasts lose confidence.
In the previous example of the corn-soybean relationship, the Excel analysis output (Table 6.4) showed the values corresponding to the \(95 \%\) confidence level for both the slope and \(Y\)-intercept. Generally, the
slope is the more interesting value. The solution for the slope was 0.3358 , with the upper \(95 \%\) at 0.3974 and the lower \(95 \%\) at \(0.2742,18 \%\) higher and \(22 \%\) lower respectively. These values are large because only a few data points were used.
\section*{Spearman's Correlation}
Most analysts will find Pearson's correlation works well for their applications, but some may want to look at an alternative, Spearman's correlation. The difference is that Spearman's correlation will give less weight to outliers and focus on the main pattern, similar to Figure 6.8b. Given a few outliers, it would still return a high correlation.
The technique used by Spearman is to rank the values of the two series, \(x\) and \(y\), then apply the formula to the ranking pairs. The process is more complicated than Pearson's correlation but the results may be more useful. The process can be found online by searching for "Spearman's correlation."
\section*{Autocorrelation}
Serial correlation or autocorrelation is a way of identifying if there is persistence in the data - that is, future data can be predicted (to some degree) from past data. That could indicate the existence of trends. A simple way of finding autocorrelation is the put the data into column A of a spreadsheet, then copy it to column B while shifting the data down by 1 row. Then find the correlation of column A and column B, ignoring the first
and last rows. Additional correlations can be calculated shifting column B down 2,3 , or 4 rows, which would show the existence of a lagged relationship, or a cycle.
A formal way of finding autocorrelation is by using the Durbin-Watson test, which gives the \(d\)-statistic. This approach measures the change in the errors ( \(e\) ), the difference between \(N\) data points and their average value:
\[
\begin{aligned}
e_{t} & =r_{t}-\frac{\sum_{t-N+1}^{t} r_{i}}{N} \\
d & =\frac{\sum_{t-N+1}^{t}\left(e_{i}-e_{i-1}\right)^{2}}{\sum_{t-N+1}^{t} e_{i}^{2}}
\end{aligned}
\]
A positive autocorrelation, or serial correlation, means that a positive error factor has a good chance of following another positive error factor. The value of \(d\) always falls between o and 4. There is no autocorrelation if \(d=2\). If \(2>d>1\), there is positive autocorrelation; however, if \(\mathrm{d}<1\) then, there is more similarity in the errors than is reasonable. The further \(d\) is above 2 , the more negative autocorrelation appears in the error terms.
\section*{NONLINEAR APPROXIMATIONS FOR TWO VARIABLES}
The linear regression, \(a+b x\), also called a 1st-order
polynomial equation, is the simplest way of finding the relationship between two price series. It uses one multiplier ( \(b\), the slope) of power 1 (hence first order) and one constant, \(a\) (the \(Y\)-intercept), to shift the starting point. By adding a third term, \(c x^{2}\), the approximation can be made much more accurate when a factor such as the decline in the supply of gold causes the stock price to rise at a faster rate. The term, \(x^{2}\), introduces a parabolic curve - a single, smooth change of direction. A fourth term, \(d x^{3}\), would add inflection, the ability for the curve to turn up and down at different points. Each time we add one more term, the ability to fit one price series based on another becomes better. Because we will want to create a polynomial with more than two or three terms, it is more convenient to change the general notation to:
\[
y=a_{0}+a_{1} x+a_{2} x^{2}+\cdots+a_{n} x^{n}
\]
The first two terms on the right side of the equal sign form the equation for a straight line (where \(a_{0}\) was called \(a\) and \(a_{1}\) was called \(b\) ). For most price forecasting, the second-order equation, also called curvilinear, which uses three terms, is sufficient. Figure 6.9 shows the general form of a second-order equation, curving up and to the right at an increasing rate.
Curvilinear (Second Order)
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0500.jpg?height=855&width=1337&top_left_y=134&top_left_x=64)
FIGURE 6.9 Curvilinear (parabolas).
\section*{ABX-Gold Results}
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0500.jpg?height=142&width=152&top_left_y=1197&top_left_x=61)
If we want to know if the price of ABX will go up faster than the linear approximation when gold prices move much higher, then we will want to try a 2nd- and 3 rd-order approximation. Instead of a period of only a few days, this solution will use 8 years from 2011 through mid-2018. A spreadsheet with this data and the results of the approximations, TSM ABX-Gold Regression, is available on the Companion Website.
The second-order (curvilinear) form:
\[
y=a_{0}+a_{1} x+a_{2} x^{2}
\]
must be solved for the coefficients \(a_{0}, a_{1}\), and \(a_{2}\) using the simultaneous equations:
\[
\begin{aligned}
N a_{0}+a_{1} \sum x+a_{2} \sum x^{2} & =\sum y \\
a_{0} \sum x+a_{1} \sum x^{2}+a_{2} \sum x^{3} & =\sum x y \\
a_{0} \sum x^{2}+a_{1} \sum x^{3}+a_{2} \sum x^{4} & =\sum x^{2} y
\end{aligned}
\]
\section*{Second-Order Least Squares Solution}
The least squares solution can be extended to the curvilinear (second-order) equation by minimizing the sum of the errors: 1
\[
S=\sum_{i=1}^{N}\left(y_{i}-a_{0}-a_{1} x_{i}-a_{2} x_{i}^{2}\right)^{2}
\]
We'll skip the way we get to the solution because that can be found in a statistics book. The procedure is identical to the linear least squares solution. The constant values can then be found by using a spreadsheet and substituting the following terms into the equations:
\[
\begin{aligned}
& a_{1}=\frac{S_{x y} S_{x^{2} x^{2}}-S_{y x^{2}} S_{x x^{2}}}{S_{x x} S_{x^{2} x^{2}}-\left(S_{x x^{2}}\right)^{2}} \\
& a_{2}=\frac{S_{x x} S_{y x^{2}}-S_{x x^{2}} S_{x y}}{S_{x x} S_{x^{2} x^{2}}-\left(S_{x x^{2}}\right)^{2}} \\
& a_{0}=\bar{y}-a_{1} \bar{x}-a_{2} \bar{x}^{2}
\end{aligned}
\]
Fortunately, there are simple computer programs that have already been written to solve these problems, such as Polysoftware's Pro-Stat or Matlab.
\section*{ABX-Gold 2nd- and 3rd-Order Results}
Using Excel for the linear (1st order) regression solution, and Pro-Stat for the 2 nd-order and 3 rd-order solutions, we get the values for the constants \(a_{0}, a_{1}, a_{2}\), and \(a_{3}\) shown in Table 6.6.
Seeing a plot of the three solutions, Figure 6.10, shows that even with different values for the constants, the solutions are very similar. The most likely scenario is that \(a_{2}\) and \(a_{3}\), the constants used in the 2nd- and 3 rdorder solutions, are very small because they could not improve over the linear solution. In this case, simple was better. We can also see that the correlations improved only slightly, indicating only a marginal improvement.
\footnotetext{
TABLE 6.6 ABX = f(gold) solution for 1st-, 2nd-, and 3rd-order polynomials.
}
\begin{tabular}{|l|l|l|l|l|l|}
\hline Linear & -53.2977. &. & & & \(0.86 \%\) \\
\hline \begin{tabular}{l}
2nd \\
Order
\end{tabular} & -96.026. & .0 .115858 & \(-2.1 \mathrm{E}-05\) & & 0.869 \\
\hline \begin{tabular}{l}
3rd \\
Order
\end{tabular} & 232.294. & -0.59271. & 0.0004828 & \begin{tabular}{c}
\(-1.2 \mathrm{E}-\) \\
07
\end{tabular} & 0.872 \\
\hline
\end{tabular}
60
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0503.jpg?height=492&width=1339&top_left_y=610&top_left_x=61)
\(\begin{array}{llllllll}1 / 3 / 2011 & 1 / 3 / 2012 & 1 / 3 / 2013 & 1 / 3 / 2014 & 1 / 3 / 2015 & 1 / 3 / 2016 & 1 / 3 / 2017 & 1 / 3 / 2018\end{array}\)
—_1st Order —_2nd Order —_3rd Order _ ABX
FIGURE 6.10 Comparison of ABS-Gold linear, 2nd-, and 3rd-order regressions.
\section*{TRANSFORMING NONLINEAR TO LINEAR}
Returning to the simpler solutions, two curves that can also be used to forecast prices are logarithmic (power) and exponential (see Figure 6.11). The exponential, curving up when \(b>0\), is used to scale price data that become more volatile at higher levels. It is equivalent to
converting a stock price to a percentage. The logarithmic curve that bends down ( \(0<b<1\) in Figure 6.11a) is typical of volatility measured over increasing time intervals. Each of these formulas can be easily transformed into linear relationships and solved using the method of least squares. This will allow you to fool the computer into solving a nonlinear problem using a linear regression tool.
Logarithmic (Power)
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0505.jpg?height=1664&width=1341&top_left_y=111&top_left_x=60)
FIGURE 6.11 Logarithmic and exponential curves.
Source: Cuthbert Daniel and Fred S. Wood, Fitting Equations to Data: Computer Analysis of Multifactor
Data, 2nd ed. (New York: John Wiley \& Sons, 1980), pp. 20, 21. Reprinted with permission.
\section*{Logarithmic Solution}
Using monthly cash corn data, we solve the logarithmic relationship by starting with \(y=a+b x\), then substituting \(\ln x\) for \(x\), and \(\ln y\) for \(y\). In Table 6.7, monthly data for corn \((Y)\) is shown in column \(B\), a sequential number \((X)\) in \(C\), the natural \(\log (\ln )\) of corn in D , and \(\ln X\) in E. Now solve the regression using \(\ln x\) and \(\ln y\) instead of \(x\) and \(y\). The solutions are shown at the right. To create the values for the linear regression line, cell F2 \(=\mathrm{K} \$ 2+\mathrm{K} \$ 3 * \mathrm{C} 2\). Copy down to get all the values.
For the \(\log\) solution, cell
\(\mathrm{G} 2=\mathrm{EXP}(\mathrm{L} \$ 2+\mathrm{L} \$ 3 * \mathrm{LN}(\mathrm{C} 2)\), and for the exponential regression,
\(\mathrm{H} 2=\operatorname{EXP}(\mathrm{M} \$ 2+\mathrm{M} \$ 3 * \mathrm{C} 2)\). The curvilinear solution does not require any transformation, just an extension of the calculations shown earlier in Table 6.3. Use the sums and averages at the bottom of the spreadsheet shown in Table 6.8. The column heading shows the calculations. The value for the curvilinear fit for cell
\(\mathrm{L} 2=\mathrm{K} \$ 8+\mathrm{K} \$ 6 * \mathrm{C} 463+\mathrm{K} \$ 7 * \mathrm{C} 463 * \mathrm{C} 463\) , where \(\mathrm{K} \$ 6=b, \mathrm{~K} \$ 7=c\), and \(\mathrm{K} \$ 8=a\).
When comparing the regression results, we again find that none of them are perfect. In Figure 6.12 the log approximation, curving slightly down, seems to have
favored the earlier data from 1978 to 2006. The other three approximations are close together from 1995 through 2017. The linear solution is good, but then it will continue higher at the same rate until it becomes unrealistic. The exponential starts lower but also curves upward. Only the curvilinear solution seems to be bending down, not expecting higher prices.
\section*{TABLE 6.7 Spreadsheet setup for linear, logarithmic, and exponential regressions.}
\begin{tabular}{|c|c|c|c|c|c|c|c|c|c|c|c|c|c|}
\hline 4 & A & B & C & D & E & F & G & H & 1 & J & K & L & M \\
\hline 1 & Date & \(\mathrm{Y}=\) Corn & \(\times\) & \(\ln Y\) & \(\ln X\) & Linear & Log & Exp & Curvilinear & & Linear & Log & Exp \\
\hline 2 & 8/31/1978 & 215.25 & 1 & 5.372 & 0.000 & 193.235 & 209.181 & 209.444 & 3.739 & A \(=\) intercept & 192.7715 & 5.3432 & 5.343211 \\
\hline 3 & 9/29/1978 & 221.25 & 2 & 5.399 & 0.693 & 193.699 & 209.362 & 209.705 & 5.393 & X = Slope & 0.463534 & 0.001246 & 0.001246 \\
\hline 4 & 10/31/1978 & 231.25 & 3 & 5.443 & 1.099 & 194.162 & 209.468 & 209.966 & 7.045 & & & 209.181 & \\
\hline 5 & 11/30/1978 & 233.25 & 4 & 5.452 & 1.386 & 194.626 & 209.543 & 210.228 & 8.693 & Curvilinear & & & \\
\hline 6 & 12/29/1978 & 228.75 & 5 & 5.433 & 1.609 & 195.089 & 209.601 & 210.490 & 10.338 & \(B=\) & 1.659739 & & \\
\hline 7 & \(1 / 31 / 1979\) & 234.5 & 6 & 5.457 & 1.792 & 195.553 & 209.649 & 210.753 & 11.980 & \(C=\) & -0.00165 & & \\
\hline 8 & 2/28/1979 & 238.75 & 7 & 5.475 & 1.946 & 196.016 & 209.689 & 211.015 & 13.618 & \(A=\) & 2.080506 & & \\
\hline 9 & \(3 / 30 / 1979\) & 253.5 & 8 & 5.535 & 2.079 & 196.480 & 209.724 & 211.278 & 15.253 & & & & \\
\hline 10 & 4/30/1979 & 261.5 & 9 & 5.566 & 2.197 & 196.943 & 209.754 & 211.542 & 16.885 & & & & \\
\hline
\end{tabular}
\section*{TABLE 6.8 Spreadsheet for the curvilinear (2ndorder) solution.}
\begin{tabular}{|c|c|c|c|c|c|c|c|c|c|c|c|c|}
\hline 4. & A & \(B\) & C & D & E & F & G & H & 1 & J & K & 1 \\
\hline 1 & Date & \(\mathrm{Y}=\) Corn & X & X-Avg & Y-Avg & \(\mathrm{X}^{*} \mathrm{X}\) & \(X^{*}{ }^{*}\) & \(Y^{*} Y\) & \(\mathrm{X}^{*} \mathrm{x}^{\wedge} 2\) & \(x^{\wedge} 2^{*} x^{\wedge 2}\) & \(y^{*} X^{\wedge} 2\) & Curvilinear \\
\hline 463 & \(1 / 31 / 2017\) & 343 & 462 & 225.5 & 40.603 & 213444 & 158466 & 117649 & 98611128 & \(4.56 \mathrm{E}+10\) & 73211292 & 416.99003 \\
\hline 464 & 2/28/2017 & 350 & 463 & 226.5 & 47.603 & 214369 & 162050 & 122500 & 99252847 & \(4.6 \mathrm{E}+10\) & 75029150 & 417.12479 \\
\hline 465 & \(3 / 31 / 2017\) & 339 & 464 & 227.5 & 36.603 & 215296 & 157296 & 114921 & 99897344 & \(4.64 E+10\) & 72985344 & 417.25625 \\
\hline 466 & 4/28/2017 & 338 & 465 & 228.5 & 35.603 & 216225 & 157170 & 114244 & \(1.01 E+08\) & \(4.68 \mathrm{E}+10\) & 73084050 & 417.38441 \\
\hline 467 & \(5 / 31 / 2017\) & 349 & 466 & 229.5 & 46.603 & 217156 & 162634 & 121801 & \(1.01 \mathrm{E}+08\) & \(4.72 E+10\) & 75787444 & 417.50928 \\
\hline 468 & 6/30/2017 & 351.5 & 467 & 230.5 & 49.103 & 218089 & 164150.5 & 123552.3 & \(1.02 E+08\) & \(4.76 \mathrm{E}+10\) & 76658284 & 417.63085 \\
\hline 469 & 7/31/2017 & 340.5 & 468 & 231.5 & 38.103 & 219024 & 159354 & 115940.3 & \(1.03 E+08\) & \(4.8 \mathrm{E}+10\) & 74577672 & 417.74912 \\
\hline 470 & 8/31/2017 & 320 & 469 & 232.5 & 17.603 & 219961 & 150080 & 102400 & \(1.03 E+08\) & \(4.84 \mathrm{E}+10\) & 70387520 & 417.86409 \\
\hline 471 & 9/29/2017 & 319 & 470 & 233.5 & 16.603 & 220900 & 149930 & 101761 & \(1.04 E+08\) & \(4.88 \mathrm{E}+10\) & 70467100 & 417.97577 \\
\hline 472 & 10/31/2017 & 313 & 471 & 234.5 & 10.603 & 221841 & 147423 & 97969 & \(1.04 E+08\) & \(4.92 E+10\) & 69436233 & 418.08415 \\
\hline 473 & 11/30/2017 & 314 & 472 & 235.5 & 11.603 & 222784 & 148208 & 98596 & \(1.05 E+08\) & \(4.96 E+10\) & 69954176 & 418.18923 \\
\hline \multicolumn{13}{|l|}{474} \\
\hline 475 & Mean & 302.3972 & 236.5 & Sum \(\Rightarrow\) & \(-4.394 E-11\) & 35162820 & 37817853 & 51375445 & \(1.25 E+10\) & \(4.71 E+12\) & 1.29E+10 & \\
\hline
\end{tabular}
Regression comparison
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0508.jpg?height=632&width=1325&top_left_y=128&top_left_x=64)
\(-\mathrm{Y}=\) Corn - Linear-Log-Exp-Curvilinear
FIGURE 6.12 Comparison of four regression methods on weekly corn data.
These solutions show that a long-term fit of the data will look good at some intervals and poor at others. Then the calculation period will be the critical parameter, and shorter or well-selected intervals allow for better results, as we saw in Figure 6.10, the ABX-gold fit. Traders can use a rolling calculation period over a shorter interval to stay relevant. Economists will use a multivariate solution, discussed in the next section, if prices are a complex combination of factors.
\section*{Interrelationships}
The price at which a commodity or stock trades is often dependent upon the prices of other competitive or substitute products. This can be seen for stocks where two pharmaceutical companies provide the same product
(such as the cholesterol drugs Lipitor and Zocor), and for airlines vying for passengers on the same route.
The ability to substitute one product for another creates an opportunity for arbitrage. In general, if two physical products provide the same function, they should sell at the same price, net of transaction costs, which can include carrying charges, shipping, inspection, and commissions. These products and stocks are watched carefully when they move apart; traders step in quickly to buy the cheaper one and sell short the more expensive one, causing prices to come back into alignment. In the equities markets this is the basis for pairs trading. In commodities, arbitrageurs keep the futures and cash prices together; they continually prevent the price of gold in New York, London, and Hong Kong from drifting apart. For interest rate markets, "strips" serve the purpose of preventing the large pool of 3 -month rates, 5 and 10-year notes, and 30 -year bonds from offering widely different returns when they revert to the same maturity. The Interbank market provides the same stability for foreign exchange markets, and the soybean crush, energy crack, and other processing margins do not stay out of line for long. The following markets have close relationships that can be found using regression analysis.
\footnotetext{
Commodity
Reason
Product
Relationships
All crops
Farmers choose which crops to plant based on income and yield
}
Feedlots choose the cheapest feedgrain that offers the same protein value
Livestock and feedgrains
All livestock
Sugar and corn
Hogs and pork bellies
Silver, gold, and platinum
\section*{Nonferrous}
metals
Interest rates
and stock
markets
Interest rates and foreign exchange
Cost of feed affects the cost of livestock
Consumer purchases decline as prices rise
Commercial sweetener substitution
Product dependency: bacon prices depend on hog prices
Investor's inflation hedge
Driven primarily by the housing market
Investors continually choose between stocks and interest rates
Investors worldwide move money to seek the best returns and protect against inflation
\section*{MULTIVARIATE APPROXIMATIONS}
Regression analysis is most often used in complex economic models to find the combination of two or more independent variables that best explain or forecast prices. A simple application of the annual production and usage of wheat will tell us whether these factors are significant in determining the price of wheat. Because
both the supply and demand for wheat is global, we should not expect a very accurate model using only two inputs. However, the method of solution is the same when you add other factors.
Applying the method similar to least squares, the equation for two independent variables is:
\[
y=a_{0}+a_{1} x_{1}+a_{2} x_{2}
\]
where
\[
\begin{aligned}
y & =\text { the resulting price, in this case cash wheat } \\
x_{1} & =\text { the total production (supply) } \\
x_{2} & =\text { the total distribution (usage) } \\
a_{0}, a_{1}, & =\text { constants, or weighting factors, to be } \\
a_{2} & \text { calculated }
\end{aligned}
\]
As in the linear approximation, the solution to this problem will be found by minimizing the sum of the squares of the errors at each point, where \(\hat{y}_{i}\) is the approximation for the \(i\) th data item, and \(y_{i}\) is the actual price.
\[
S=\sum_{i=1}^{N}\left(y_{i}-\hat{y}_{i}\right)^{2}
\]
However, this solution will use Excel's Solver. Table 6.9 shows the first few rows of the set-up needed. Column B has the world production, C has the consumption or
usage, and D has the wheat cash price. The cells H2, I2, and J2 are the constants needed for the solution. Column E gives the formula, using those constants for each of the values of production and usage, minus the cash price. By subtracting the cash price, we are creating the forecast errors and we are able to tell Solver to minimize the standard deviation of column E. The cell G2 = STDEV(E2:E32), spans the full set of data:
\section*{\(\mathrm{E} 2=\$ \mathrm{H} \$ 2+\$ \mathrm{I} \$ 2 * \mathrm{~B} 2+\$ \mathrm{~J} \$ 2 * \mathrm{C} 2-\mathrm{D} 2\)}
On the Solver page, we indicate that the solution is found in cell \(\$ \mathrm{G} \$ 2\) and that we want to minimize that value (Figure 6.13) by changing cells \(\$ \mathrm{H} \$ 2\) :\$J \(\$ 2\). Constraints are added to say that the three cells must have values between \(\pm 10\). When we click on "Solve" at the bottom, the cells in Table 6.9 show the answer.
The last step is the show the solution in column F, using the original formula,
Cash price \(=a_{0}+a_{1} \times\) production \(+a_{2} \times\) usage. Figure 6.14 shows the original wheat prices and the Solver solution.
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0512.jpg?height=139&width=155&top_left_y=1434&top_left_x=62)
As with the least-squares and polynomial solutions, user-friendly software is available. The data for this solution was available from the Commodity Research Bureau Yearbook (published annually by John Wiley \& Sons). The full spreadsheet and the forecasted results are available on the Companion Website as Wheat supply and demand. For only two inputs, the result looks good.
Neural networks and genetic algorithms have been used for complex problems of supply and demand. Both have the advantage of providing a nonlinear solution. Both genetic algorithms and neural nets are discussed in Chapter 20.
\section*{TABLE 6.9 Wheat prices and set-up for Solver solution.}
\begin{tabular}{|c|c|c|c|c|c|c|c|c|c|c|}
\hline 4 & A & B & C & D & E & F & G & H & 1 & J \\
\hline 1 & Crop year & \begin{tabular}{l}
World \\
Prod- \\
uction
\end{tabular} & Usage & \begin{tabular}{c}
Chicago \\
Cash
\end{tabular} & Minimize & \begin{tabular}{l}
Solver \\
Solution
\end{tabular} & \begin{tabular}{c}
Standard \\
Deviation
\end{tabular} & a0 & a1 & a2 \\
\hline 2 & 1970-1 & 306.5 & 226 & 1.33 & 1.79 & 3.12 & 0.65 & 0.997627 & -0.01399 & 0.028385 \\
\hline 3 & 1971-2 & 344.1 & 254.9 & 1.34 & 2.08 & 3.42 & & & & \\
\hline 4 & 1972-3 & 337.5 & 262.6 & 1.73 & 2.00 & 3.73 & & & & \\
\hline 5 & 1973-4 & 361.3 & 278.9 & 3.95 & -0.09 & 3.86 & & & & \\
\hline 6 & 1974-5 & 355.2 & 273.8 & 4.09 & -0.29 & 3.80 & & & & \\
\hline 7 & 1975-6 & 352.6 & 265.9 & 3.55 & 0.06 & 3.61 & & & & \\
\hline 8 & 1976-7 & 414.3 & 286.9 & 2.73 & 0.61 & 3.34 & & & & \\
\hline 9 & 1977-8 & 377.8 & 268.6 & 2.33 & 1.01 & 3.34 & & & & \\
\hline 10 & 1978-9 & 438.9 & 304.1 & 2.97 & 0.52 & 3.49 & & & & \\
\hline
\end{tabular}
Set Objective:
To:
Max
Min
Value of:
0
By Changing Variable Cells:
SH\$2:SJ\$2
Subject to the Constraints:
SHS2 \(<=10\)
SHS2 \(>=-10\)
SIS2 \(<=10\)
SIS2 \(>=-10\)
SIS2 \(<=10\)
SIS2 \(>=-10\)
Add
Add
\(\square\) Change
\(\square\) Delete
Reset All
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0514.jpg?height=58&width=237&top_left_y=863&top_left_x=988)
Make Unconstrained Variables Non-Negative
Select a Solving GRG Nonlinear Options Method:
\section*{FIGURE 6.13 Solver set-up page.}
6
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0514.jpg?height=407&width=1280&top_left_y=1290&top_left_x=109)
0
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0514.jpg?height=108&width=1263&top_left_y=1787&top_left_x=75)
Chicago Cash
FIGURE 6.14 Wheat cash prices and Solver solution.
\section*{Generalized Multivariate Solution}
In general, the relationship between \(n\) independent variables is expressed as:
\[
y=a_{0}+a_{1} x_{1}+a_{2} x_{2}+\cdots+a_{n} x_{n}
\]
The solution to this equation is the natural extension of the problem in two and three variables. The classic solution creates \(n+1\) equations in \(n+1\) variables and requires specialized software - that is, unless you use Solver. This problem is set up and solved in exactly the same way as the wheat solution, only with more data. To get a fast solution, it is best to have an idea about the range of values that each constant (a) can take on. The wider the range, the slower the solution.
Many independent variables \(\left(x_{i}\right)\) may be used to increase the possibility of finding a good fit. The predictive quality of this solution will depend on the relevance of the independent variables. It is best to start with the obvious components of a time series, such as inflation, then add standard economic statistics, including the Consumer Price Index and supply-anddemand information specific to the market being evaluated. For both grain and energy markets, the accumulation of inventory, or stocks, is a strong influence on price; these factors also have an expected seasonal variation, which is represented in terms of an index of adjustment. Using monthly data means that you must have a strong tolerance for risk because even the
best models do not account for the price fluctuations during the month. Measuring the error of the estimates will help determine whether additional factors are necessary. When done, look at the coefficients, \(a\). Those that are very small should be discarded. The fewer inputs, the better.
\section*{Selecting Data for an S\&P Model}
A rising stock market is driven by a healthy economy and lower interest rates. A good economy means that there is high employment and consumers are actively buying homes, durable goods, services, and frivolous items with their disposable income. Low interest rates increase corporate profitability by reducing the cost of borrowing and providing lower mortgages for homeowners.
Economic growth and controlled inflation are delicately orchestrated by the central bank of each country; in the United States, it is the Federal Reserve.
To create a robust S\&P economic model, it is necessary to select the most meaningful data. The following was suggested by Lincoln \(\underline{2}\) to be used for a 6-month-ahead S\&P forecast: \({ }^{3}\)
- S\&P prices, the closing prices of the Standard \& Poor's 500 cash index
- Corporate bonds/Treasury bonds, the BAA corporate bond yield divided by the 30 -year Treasury bond yield, normalized by subtracting the historical mean
■ Annual change in the U.S. dollar, the 12-month
change in the dollar, minus 1 , which might be based on the Dollar Index traded on the New York Futures Exchange (discussed in Chapter 2), or a weighting of major currencies
Annual change in federal funds rate, the 12-month change in the Fed funds rate, minus 1
- Federal funds rate/Discount rate, the Fed funds rate divided by the discount rate, normalized by subtracting the historical mean
Money supply, M1 money supply, not seasonally adjusted
Annual Consumer Price Index, the 12-month change in the CPI, minus 1
- Inflation/Disinflation index, the annualized 1month change in the CPI divided by the 12-month change in the CPI, minus 1
- Leading economic indicators, the 12-month change in the leading economic indicators, minus 1
- One-month versus 10-month oscillator for the \(S \& P\) cash index, the difference between the monthly average and the past 10 months, approximately 200 days
Inflation-adjusted commercial loans, the inflationadjusted 12-month growth in commercial loans
Lincoln used 20 years of monthly values to forecast the S\&P price six months ahead. Some of these data are available on a weekly basis and might be adapted to a shorter time frame, one that is still consistent with the
frequency of the data. Also, remember that yields must always be used for interest rates, not prices.
\section*{Least-Squares Sinusoidal}
When you know that there is a seasonal or cyclic pattern to price movement, you can use the trigonometric functions, sine and cosine, as a special case of multiple linear equations. Observing periodic peaks and valleys in a price series suggests that a cyclic pattern may be present. One of the more well-known uses of cyclic analysis was performed by Hurst in The Profit Magic of Stock Transaction Timing (Prentice-Hall), in which there is an interesting example of Fourier analysis applied to the Dow Jones Industrial Averages. A full discussion of cyclic analysis and trigonometric estimations can be found in Chapter 11.
The equation for the approximation of a periodic movement is:
\(y_{t}=a_{0}+a_{1} t+a_{2} \cos \frac{2 \pi t}{P}+a_{3} \sin \frac{2 \pi t}{P}+a_{4} \cos \frac{2 \pi t}{P}+a_{5} \sin \frac{2 \pi t}{P}\)
which is a special case of the generalized multivariate approximation:
\[
y=a_{0}+a_{1} x_{1}+a_{2} x_{2}+a_{3} x_{3}+a_{4} x_{4}+a_{5} x_{5}
\]
where
\[
\begin{aligned}
& P=\text { the number of data points in each cycle (the } \\
& \text { period) }
\end{aligned}
\]
\(x_{1}=t\), the incremental time element
\(x_{2}=\cos .(2 \pi t / P)\), a cyclic element
\(x_{3}=\sin .(2 \pi t / P)\), a cyclic element
\(x_{4}=t \times \cos (2 \pi t / P)\), an amplitude-variation element
\(x_{5}=t \times \sin (2 \pi t / P)\), an amplitude-variation element
The number of data points, \(P\), in each cycle would be 12 if you were calculating seasonality using monthly data. If you believe that there is a cycle, then you can find the average number of data points between major price peaks. The term \(a_{1} t\) will allow for the linear tendencies of the sequence. The term \(2 \pi\) refers to an entire cycle and \(2 \pi t / P\) is a section \((1 / P)\) of a specific cycle \(t\); this in turn adds weight to either the sine or cosine functions at different points within a cycle.
The solution is found using Solver in exactly the same way as multiple regression. Using Excel, it is just as easy to calculate \(\cos (2 \pi t / P)\) for \(x_{2}\). You need to decide the period, \(P\), but start with the number of data points in 1 year. If the data are annual, then \(P=1\), if quarterly, then \(P=4\). Given the speed of Solver, you should find the best solution within a few tries.
\section*{ARIMA}
An Autoregressive Integrated Moving Average (ARIMA) model is created by a process of regression analysis over a moving time window, comparing today's prices with past prices (the autoregressive part) each
time there is a new piece of data, until it finds the best fit. Moving average refers to the normal concept of smoothing price fluctuations, using a rolling average of the past \(n\) days.
ARIMA is based on finding a repeated pattern in the data. It makes the assumptions that forecast errors are white noise, relative volatility is constant, and absolute changes get larger as prices increase. 4 It is essentially a parameter optimization and an adaptive process in one. G.E.P. Box and G.M. Jenkins refined ARIMA at the University of Wisconsin \({ }^{5}\) and their procedures for solution have become the industry standard. This technique is often referred to as the Box-Jenkins forecast. In the ARIMA process, the autocorrelation is used to determine to what extent past prices will forecast future prices. In a first-order autocorrelation, only the prices on the previous day are used to determine the forecast. This would be expressed as:
\[
p_{t}=a \times p_{t-1}+e
\]
where
\(p_{t}=\) the price being forecast (dependent variable)
\(p_{t}=\) the price being used to forecast (independent
\(-1 \quad\) variable)
\(a=\) the coefficient (constant factor)
\(e=\) the forecast error
In a second-order autoregression:
\[
P_{t}=a_{1} \times P_{t-1}+a_{2} \times P_{t-2}+e
\]
The current forecast \(P_{t}\) is based on the two previous prices \(P_{t-1}\) and \(P_{t-2}\) using two unique coefficients and a forecast error. A moving average is used to correct for the forecast error, \(e\). There is also the choice of a 1st- or 2nd-order moving average process:
\[
\begin{array}{ll}
1 \text { st-order: } & E_{t}=e_{t}-b e_{t-1} \\
2 n d \text {-order: } & E_{t}=e_{t}-b_{1} e_{t-1}-b_{2} e_{t-2}
\end{array}
\]
where
\[
\begin{aligned}
E_{t} & =\text { the approximated error term } \\
e_{t} & =\text { today's forecast error }
\end{aligned}
\]
\(e_{t-1}\) and \(e_{t-2}=\) the two previous forecast errors
\(b_{1}\) and \(b_{2}=\) the two regression coefficients
Because the two constant coefficients, \(b_{1}\) and \(b_{2}\), can be considered percentages, the moving average process is similar to exponential smoothing.
The success of the ARIMA model is determined by two factors: high correlation in the autoregression and low variance in the final forecast errors. The determination of whether to use a 1st- or 2nd-order autoregression is based on a comparison of the correlation coefficients of the two regressions. If there is little improvement using the 2 nd-order process, it is not used. The final forecast is constructed by adding the moving average term, which approximates the errors, back into the autoregressive
\section*{process:}
\[
p_{t}^{\prime}=p_{t}+E_{t}+e^{\prime}
\]
where
\[
\begin{aligned}
p_{t}^{\prime} & =\text { the new forecast } \\
e^{\prime} & =\text { the new forecast error }
\end{aligned}
\]
The moving average process is again repeated for the new errors \(e^{\prime}\), added back into the forecast to get a new value \(p^{\prime \prime}\) and another error \(e^{\prime \prime}\). When the variance of the errors becomes sufficiently small, the ARIMA process is complete.
\section*{Creating a Stationary Price Series}
The contribution of Box and Jenkins was to stress the simplicity of the solution. They determined that the autoregression and moving average steps could be limited to 1st- or 2nd-order processes. To do this, it was first necessary to detrend the data, thereby making them stationary. Detrending can be accomplished most easily by differencing the data, creating a new series by subtracting each previous term \(P_{t-1}\) from the next \(P_{t}\). Of course, the ARIMA program must remember all of these changes, or transformations, in order to restore the final forecast to the proper price notation by applying these operations in reverse. If a satisfactory solution is not found in the Box-Jenkins process, it is usually because the data are still not stationary and further differencing is necessary.
With the three features just discussed, the Box-Jenkins forecast is usually shown as \(\operatorname{ARIMA}(p, d, q\) ), where \(p\) is the number of autoregressive terms, \(d\) is the number of differences, and \(q\) is the number of moving average terms. The expression ARIMA ( \(0,1,1\) ) is equivalent to simple exponential smoothing, a common technique discussed in the next chapter. In its normal form, the Box-Jenkins ARIMA process performs the following steps:
Specification. Preliminary steps for determining the order of the autoregression and moving average to be used:
- The variance must be stabilized. Volatility can vary directly or inversely with price changes. A simple test for variance stability, using the log function, is checked before more complex transformations are used.
Prices are detrended. This step takes the first differences; however, a second difference (or more) will be performed if it helps to remove further trending properties in the series (this is determined by later steps).
- Specify the order of the autoregressive and moving average components. This determines the number of prior terms to be used in these approximations (not necessarily the same number). In the Box-Jenkins approach, these numbers should be as small as possible; often one value is used for both. Large numbers require a rapidly expanding amount of
calculation, even for a computer. All ARIMA programs will print a correlogram, a display of the autocorrelation coefficients. The correlogram is used to find whether all the trends and welldefined periodic movements have been removed from the series by differencing. Figure 6.15 shows a monthly correlogram of corn returns from 1978 to 2017 before any data manipulation. It shows that there is a tendency for persistence in the nearest two months and seasonality clustered around the 11th lag (the 12-month cycle), but none of them meet the threshold of 0.40 , which would require another round of differencing.
We can compare the weekly correlograms of corn, wheat, and gold and Figure 6.16. Weekly data will be less correlated because it is less likely that the same pattern will appear in the smaller weekly window. Then, seeing a cluster of more correlated weeks could be interpreted as indicative of a cycle. Although wheat does not have the same seasonality as corn, it would still have a 12 -month cycle.
\section*{Corn monthly correlogram from 1978}
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0525.jpg?height=689&width=1329&top_left_y=136&top_left_x=64)
FIGURE 6.15 Correlogram of monthly corn prices, 1978-2017, for 24 lags.
\section*{Weekly correlogram}
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0525.jpg?height=577&width=1337&top_left_y=1060&top_left_x=64)
■ Corn Wheat ! Gold
FIGURE 6.16 Correlogram of weekly returns of corn, wheat, and gold, 1978-2017.
Estimation: determining the coefficients.
Having minimized the number of autoregressive and moving average terms, the ARIMA method then attempts to minimize the errors in the forecast. It will perform a linear or nonlinear regression on price (depending on the number of coefficients selected), determine the errors in the estimation, approximate those errors using a moving average, and add the smoothed error series to the regression values to get the forecast. It will look at the resulting error of the new estimation and repeat the process until the completion criteria are satisfied.
Testing for completion. To determine when an ARIMA process is completed, three tests are performed at the end of each estimation pass:
Compare the change in the coefficient value. If the last estimation has caused little or no change in the value of the coefficient(s), the model has successfully converged to a solution.
- Compare the sum of the squares of the error. If the error value is small or if it stays relatively unchanged, the process is completed.
- Perform a set number of estimations. Unless a maximum number of estimations is set, an ARIMA process might continue indefinitely. This safety check is necessary in the event the model is not converging to a solution.
Once completed, the errors can be examined using an \(O\) statistic to check for any trend. If one exists, an additional moving average term may be used to
eliminate it.
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0527.jpg?height=1283&width=1327&top_left_y=150&top_left_x=63)
FIGURE 6.17 ARIMA forecast becomes less accurate as it is used farther ahead.
\section*{Forecast Results}
The final ARIMA coefficients are used to calculate the forecast value. These forecasts are most accurate for the next day and are less accurate for subsequent days (see Figure 6.17).
What if the forecast does not work? If you've checked all your work, the most likely problem is instability in the data - that is, large price changes or erratic volatility that prevents recent data from being similar to past data. Select either a shorter or longer period that contains more homogeneous data.
\section*{ARIMA Trading Strategies}
In the article that originally piqued the interest of traders, \({ }^{6}\) Anon uses a 5 -day-ahead forecast. If the ARIMA process forecasts an uptrend and prices fall below the forecast value, the market can be bought with added confidence (expecting lower risk and more profit by buying at a price that is below estimated value). This technique of selecting better entry points may compensate for some of the inaccuracies latent in any forecasting method. The danger of this approach is that prices may continue to move counter to the forecast, and not give you an opportunity to enter.
\section*{Follow the Trend}
Use the 1-day-ahead forecast to determine the trend direction. Hold a long position if the forecast is for higher prices and a short position if lower prices are forecast.
\section*{Mean-Reverting Indicator}
Use the ARIMA confidence bands to determine overbought/oversold levels. Not only can a long position be entered when prices penetrate the lowest \(95 \%\)
confidence band, but they can be closed out when they return to the mean. Although mean reversion trades are tempting, they always carry more risk than trend trading. A conservative trader will enter the market only in the direction of the ARIMA trend forecast. If the trend is up, only the penetrations of a lower confidence band will be used to enter new long positions.
\section*{Kalman Filters}
Kalman offers an alternative approach to ARIMA, allowing an underlying forecasting model (message model) to be combined with other timely information (observation model). The message model may be any trading strategy, moving average, or regression approach. The observation model may be the specialist's or floor broker's opening calls, market liquidity, or earlier trading activity in the same stock, index market, or on a foreign exchange - all of which have been determined to be good candidates for forecasting.
Assume that the original forecast (message) model can be described as:
\[
M\left(p_{t}\right)=c_{f} p_{t-1}+m e_{t}
\]
where \(c_{f}\) is the forecast factor and \(m e\) is the message error. The observation model is:
\[
O\left(p_{t}\right)=c_{o} p_{t}+o e_{t}
\]
where \(o e\) is the observation model error. The combined
forecast would then use the observation model error to modify the result:
\[
p_{t+1}^{\prime}=c_{f} p_{t}^{\prime}+K_{t+1} o e_{t}
\]
where \(K=\) the Kalman gain coefficient, \({ }^{7}\) a factor that adjusts the error term.
\section*{BASIC TRADING SIGNALS USING A LINEAR REGRESSION MODEL}
A linear regression, or straight-line fit, could be the basis for a simple trading strategy similar to a moving average. For example, an \(n\)-day linear regression, applied to the closing prices, can produce a 1-day-ahead forecast price, \(F_{t+1}=F_{t}+b\), a projection of the slope \(b=F_{t}-F_{t-1}\). If the current regression value is \(R V_{t}\), we can have the following rules for trading:
- Buy when tomorrow's closing price \(\left(C_{t+1}\right)\) moves above the forecasted value \(F_{t+1}\) or the current forecast \(F_{t}\).
- Sell short when tomorrow's closing price \(\left(C_{t+1}\right)\) moves below the forecasted value \(F_{t+1}\) or the current forecast \(F_{t}\).
\section*{Adding Confidence Bands}
Because the linear regression line passes through the
center of price movement during a period of steadily rising or falling prices, these rules would produce a lot of buy and sell signals. To reduce the frequency of signals and avoid changes of direction due to market noise, confidence bands are drawn on either side of the regression line. A \(90 \%\) confidence band is simply 1.65 times the standard deviation of the residuals ( \(R_{t}\), the difference between the actual prices and the corresponding value on the regression line as of time \(t\), the most recent price). A \(95 \%\) confidence band uses a multiplier of 1.96; however, most people use 2.0 simply for convenience. The new trading rules using a \(95 \%\) confidence band would then become:
- Buy when tomorrow's closing price \(\left(C_{t+1}\right)\) moves above tomorrow's forecasted value
\[
\left(F_{t+1}+2.0 \times R_{t}\right)
\]
- Sell short when tomorrow's closing price \(\left(C_{t+1}\right)\) moves below the forecasted value
\[
\left(F_{t+1}-2.0 \times R_{t}\right)
\]
An important difference between a model based on linear regression and one founded on a moving average is the lag. Both methods assume that prices will continue to move in the same direction as the last moving average point or the last regression slope value. If prices continue higher at the same rate, a moving average will initially lag behind, then increase at the same rate. The lag creates a safety zone to absorb some minor changes in prices without a change in the direction of the trend.
(See Chapter 7 for a complete discussion of moving averages, and Chapter 8 for a comparison of a linear regression slope trading system with five other popular trending methods.)
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0532.jpg?height=135&width=148&top_left_y=324&top_left_x=63)
A regression model, however, identifies a change of direction by measuring tomorrow's actual price against the projected future price (a straight-line projection for a linear regression). Confidence bands around the straight-line projection will decide if the new price triggered a change of direction. Figure 6.18 shows the changing direction of a rolling linear regression at three points in time compared to a moving average. At the most recent period on the chart the reversal point for the trend direction is much closer using the confidence bands of the regression than the lagged moving average. While this is generally true, much depends on how the trend develops. As with most trending systems, performance tends to improve as the calculation period increases, capturing the largest economic trends. The Companion Website has a spreadsheet, Bund regression with bands, that produces trading signals and performance using regression bands. It also compares the results with the slope method described in the next section.
\section*{Using the Linear Regression Slope and Correlations}
The slope of the linear regression line, the angle at which it is rising or falling, is all that is needed for a simple trend trading system. The slope shows how quickly
prices are expected to change over a unit of time. The unit of time is the same as the data period used to find the regression values, usually days or weeks. As with other trend systems, the longer the calculation period, the slower the trend will react to price changes. Using only the slope, you can trade with the following rules:
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0533.jpg?height=849&width=1339&top_left_y=458&top_left_x=65)
FIGURE 6.18 Linear regression model. Penetration of the confidence band turns the trend from up to down. When prices move steadily up, the regression model will signal a change of direction faster than a moving average.
- Buy when the slope \(>0\).
- Sell when the slope \(<0\).
If \(b\) is the slope, a faster version of this is:
- Buy when the change in the value of the slope is
positive, \(b_{t}>b_{t-1}\).
- Sell when the change in the value of the slope is negative, \(b_{t}<b_{t-1}\).
Both trading methods can be seen in Figure 6.19. The scale of the slope is different from the prices; therefore, it is shown in the middle panel in Figure 6.19. Both the moving average line in the top panel and the slope use a 60 -day period. The slope crosses the zero line at about the same time the moving average turns from up to down and down to up. If we look at the changes in direction of the slope, there are many more trading signals. We will compare the performance of these variations in Chapter 8.
The bottom panel of Figure 6.19 shows the correlation, \(r\), of the regression. The 30-day moving average of the correlation is actually smoother than the slope in the middle panel and could be used to generate trading signals. Note that the correlation is lower when prices are father from the moving average in the top panel.
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0534.jpg?height=562&width=1327&top_left_y=1340&top_left_x=63)
FIGURE 6.19 IBM trend using the slope and \(r\). (Top)
IBM prices with 80-day moving average. (Center) 80day regression slope. (Bottom) Correlation \(r\).
\section*{Forecast Oscillator}
Tuschar Chande used the regression forecast and its residuals to create the Forecast Oscillator. 8 Using a 5day regression, find the residuals as a percentage variation from the regression line. A buy signal occurs when the 3-day average of the residuals crosses above the regression line; a short sale is when the 3 -day average of the residuals crosses below the regression line. If:
\[
\% F_{t}=100 \times \frac{y_{t}-\hat{y}_{t}}{y_{t}}
\]
and \(\% F_{t}(3)\) is the 3 -day moving average of \(\% F\), then:
- Buy when \(\% F_{t}(3)\) crosses above \(\hat{y}_{t}\).
■ Sell short when \(\% F_{t}(3)\) crosses below \(\hat{y}_{t}\).
This makes the assumption that the residuals trend.
\section*{MEASURING MARKET STRENGTH}
One of the natural applications of the linear regression is to measure and compare the strength of one market against another. For example, we might want to ask, "Which pharmaceutical company is leading the others, Amgen (AMGN), Johnson \& Johnson (JNJ), Merck
(MRK), or Pfizer (PFE)?" Table 6.10 shows the prices on \(1 / 1 / 2018\) and \(6 / 29 / 2018\). It would be easiest to say that the simple return for the 6 months tells the story, in which case the stocks would be MRK, AMGN, PFE, and JNJ.
\section*{TABLE 6.10 Ranking of pharmaceutical companies.}
\begin{tabular}{|l|l|l|l|l|}
\hline & 1/1/2018 & 6/29/2018 & Return & Slope \\
\hline AMGN & 174.36. & 184.59 & \(.5 .9 \%\). & -0.0262. \\
\hline JNJ & 137.49 & 121.34 & \(-11.7 \%\), & -0.0449. \\
\hline MRK & .55 .26 & .60 .70 & \(.9 .8 \%\). & 0.0619. \\
\hline PFE & .35 .76 & .36 .28 & \(.1 .5 \%\). & 0.0379. \\
\hline
\end{tabular}
200
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0536.jpg?height=570&width=1327&top_left_y=1051&top_left_x=63)
160
\(\begin{array}{llllll}1 / 2 / 2018 & 2 / 2 / 2018 & 3 / 2 / 2018 & 4 / 2 / 2018 & 5 / 2 / 2018 & 6 / 2 / 2018\end{array}\)
FIGURE 6.20 AMGN shows a declining slope even though the price is higher.
When we calculate the regression slope, we see a slightly different picture. Merck is still the strongest, but the rankings are MRK, PFE, AMGN, and JNJ. The two in the middle have switched. Figure 6.20 shows why. Even though AMGN is higher on \(6 / 29 / 2018\) than on \(1 / 1 / 2018\), it shows a declining pattern. Regression would be the preferable way to rank both prices and performance.
\section*{NOTES}
1 F.R. Ruckdeschel, BASIC Scientific Subroutines, Vol. 1 (Peterborough, NH: Byte/McGraw-Hill, 1981).
\(\underline{2}\) Thomas H. Lincoln, "Time Series Forecasting: ARMAX," Technical Analysis of Stocks \&
Commodities (September 1991).
3 Note that the "minus 1 " in the data list refers to the calculation of returns, final value divided by starting value, minus 1.
4 Murray A. Ruggiero, Jr., "Predictive Market Modeling in R Language," Modern Trader (July 2017).
5 G.E.P. Box and G.M. Jenkins, Time Series Analysis: Forecasting and Control, 2nd ed. (San Francisco: Holden-Day, 1976).
6 Louis J. Anon, "Catch Short-Term Profits with ARIMA," Commodities Magazine (December 1981).
\({ }^{7}\) For a more complete discussion, see Andrew D. Seidel and Philip D. Ginsberg, Commodities Trading
(Englewood Cliffs, NJ: Prentice-Hall, 1983), or R. E.
Kalman, "A New Approach to Linear Filtering and Prediction Problems," Journal of Basic Engineering (March 1960).
8 Tushar S. Chande and Stanley Kroll, The New Technical Trader; also in Technical Analysis of Stocks \& Commodities 10:5.
\section*{CHAPTER 7 \\ Time-Based Trend Calculations}
The purpose of all trend methods is to ignore the underlying noise in the market, those erratic moves that seem to be meaningless, and find the current direction of prices. But trends are dependent upon your time horizon. In addition, there may be more than one trend at any one time, caused by short-term events and longterm policy, and it is likely that one trader will search for the strongest, or most dominant trend while another will seek a series of shorter-term moves. There is no "right" or "wrong" trend.
The technique that is used to uncover the particular trend can depend upon whether any of the underlying trend characteristics are known. Does the stock or futures market have a clear seasonal or cyclic component, such as the travel industry or coffee prices; or, does it respond to long-term monetary policy because it has a high cost of servicing debt? If you know more about the reasons why prices trend, you will be able to choose the best method of finding the trend and the calculation period.
Chapter 6 used regression to find the direction of a single series (based on price and time), the relationship between two markets, and the ranking of both similar and diverse markets. The regression slope was used to forecast the trend and bands around the regression line
allowed us to decide if the trend had changed or if there was an opportunity for buying and selling inside the band. Chapter 5 looked at price direction based on events. Time was ignored. As long as the price did not move above a resistance level or below a support level, the direction was still intact.
But time is a factor in trading. Prices can move faster or slower over the same time period. A moving average and variations of averages try to hold onto profits as they develop instead of waiting for an event to trigger a change of direction. This chapter will show how these averages are calculated and how one differs from another. Chapter 8 will give examples of the trading systems that use them.
\section*{FORECASTING AND FOLLOWING}
There is a clear distinction between forecasting the trend and recognizing the current trend. Forecasting is predicting the future price, a very desirable but more complex achievement. As shown in the previous chapter, it involves combining those data that are most important to price change and assigning a value to each one. The results are always expressed with a confidence level, the level of uncertainty in the forecast. There is always lower confidence as you try to forecast further into the future.
The techniques most commonly used for finding the current direction of prices are called autoregressive functions. They determine the trend direction based only on past prices. Most analysis limits its goals to simply stating that prices are moving in an upward, downward,
or sideways direction, with no indication of confidence and no indicator of how long the direction will persist. Nevertheless, an entire industry has formed, trading rules developed, and complex strategies have evolved. The key to their success is that these techniques assume persistence, that the direction of prices today is most likely to be the same as the direction of prices tomorrow. For the most part, this assumption has proved to be true and, from a practical viewpoint, these methods are more flexible than the traditional regression models. But to achieve success they introduce a lag. A lag is a delay in the identification of the trend. Great effort has been spent trying to reduce this lag in an attempt to identify the trend sooner; however, the lag is the zone of uncertainty that allows the technique to ignore most of the market noise. The lag is the best and worst part of moving average methods.
In an autoregressive model, one or more previous prices determine the next sequential price. If \(p_{t}\) represents today's price, \(P_{t-1}\) yesterday's price, and so on, then tomorrow's expected price will be:
\[
p_{t+1}=a_{0}+a_{1} p_{t}+a_{2} p_{t-1}+\cdots+a_{t} p_{1}+e
\]
where each price is given a corresponding weight \(a_{i}\) and then combined to give the resultant price for tomorrow \(p_{t+1}+e\) (where \(e\) represents an error factor, usually ignored). The simplest example is the use of yesterday's price alone to generate tomorrow's price:
\[
p_{t+1}=a_{0}+a_{1} p_{t}+e
\]
which you may also recognize as the formula for a straight line, \(y=a+b x\), plus an error factor. The general form, using \(n\) past prices, is the same as the multivariate solution in Chapter 6, but using only prices instead of fundamental factors.
The autoregressive model does not have to be linear; each prior day can have a nonlinear predictive quality. Then each expected price \(P_{t+1}\) could be represented by a curvilinear expression,
\[
p_{t+1}=a_{0}+a_{1} p_{t}+a_{1} p_{t-1}^{2}+e, \text { or by an }
\]
exponential or logarithmic formula,
\(\ln p_{t+1}=a_{0}+a_{1} \ln p_{t}+a_{2} \ln p_{t-1}+e\), which is
commonly used in equity analysis. Any of these expressions could then be combined to form an autoregressive forecasting model for \(P_{t+1}\).
In going from the simple to the complex, it is natural to want to know which of these choices will perform best. Theoretically, the best method will be the one that, when used in a strategy, yields the highest return for the lowest risk; however, every investor has a personal risk preference. The answer can only be found by applying and comparing different methods and experiencing how they perform when actually traded. It turns out that the best historic results often come from overfitting the data, and is a poor choice for trading. At the end of Chapter 8 there is a comparison of popular trending systems, and Chapter 21 will show testing methods that are most likely to lead to robust results. Throughout the book there will be comparisons of systems and methods
that are similar.
\section*{Least-Squares Model}
The least-squares regression model is the same technique that was used in the previous chapters to find the relationship between two markets - Barrick Gold and cash gold, corn and soybeans - or to find how price movement could be explained by the main factors influencing them, supply and demand. Most trading systems depend only on price; therefore, we will look again using the least-squares model with time as the independent variable and price as the dependent variable. The regression results will be used in an autoregressive way to forecast the price \(n\)-days ahead, and we will look at the accuracy of those predictions. The slope of the resulting straight line will determine the direction of the trend.
\section*{Error Analysis}
A simple error analysis can be used to show how time works against the predictive qualities of regression, or any forecasting method. Using General Electric (GE) prices, ending February 15, 2010, the slope and \(y\) intercept are calculated for a rolling 20-day window. The \(1^{-}, 5^{-}\), and 10-day-ahead forecast is found by projecting the slope by that number of days. The forecast error is the difference between the projected price and the actual price. Figure 7.1 shows the price for GE from December 31, 2010, through February 15, 2011, along with the error for three forecast intervals. The forecast error gets larger as we try to forecast further ahead. This result is typical
of forecasting error, regardless of the method, and argues that the smallest forecast interval is the best.
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0544.jpg?height=127&width=146&top_left_y=209&top_left_x=64)
The method of finding the forecast error is shown in Table 7.1 (the full spreadsheet can be found on the Companion Website as TSM General Electric regression error forecast). Only the closing prices are needed, and they appear in column 3. The slope and intercept use the sequential numbers in column 1 for \(X\), and the GE prices for \(Y\). The \(n\)-day ahead forecast is:
\(y_{t+n}=\) intercept \(_{t}+\) slope \(_{t} \times\) price \(_{t}+n \times\) slope \(_{t}\)
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0544.jpg?height=827&width=1341&top_left_y=866&top_left_x=60)
FIGURE 7.1 General Electric price from December 31, 2010, through February 15, 2011. Forecast accuracy decreases as the forecast period increases.
regression error based on a 2o-day rolling calculation period.
\section*{Regression}
Forec:
\begin{tabular}{|l|l|l|l|l|l|l}
\hline Seq & Date & GE & Slope & Intercept & 1-day & 5-da.
\end{tabular}
\begin{tabular}{|l|l|l|l|l|l|l}
\hline\(n\) & \(2 / 1 / 2011\) & 20.80 & 0.118 & -351.689 & 20.438 & 20.91 \\
\hline \begin{tabular}{l}
\(n+\). \\
1
\end{tabular} & \(2 / 2 / 2011\) & 20.71 & 0.131 & -390.484 & 20.673 & 21.19 \\
\hline \begin{tabular}{l}
\(n+\). \\
2
\end{tabular} & \(2 / 3 / 2011\) & 20.75 & 0.141 & -422.673 & 20.886 & 21.44 \\
\hline \begin{tabular}{l}
\(n+\). \\
3
\end{tabular} & \(2 / 4 / 2011\) & 20.56 & 0.144 & -432.439 & 21.019 & 21.59 \\
\hline \begin{tabular}{l}
\(n++\). \\
4
\end{tabular} & \(2 / 7 / 2011\) & 20.87 & 0.146 & -440.206 & 21.166 & 21.75 \\
\hline \begin{tabular}{l}
\(n+\). \\
5
\end{tabular} & \(2 / 8 / 2011\) & 21.28 & 0.152 & -458.803 & 21.367 & 21.97 \\
\hline \begin{tabular}{l}
\(n+\). \\
6
\end{tabular} & \(2 / 9 / 2011\) & 21.31 & 0.156 & -471.628 & 21.544 & 22.16 \\
\hline \begin{tabular}{l}
\(n+\). \\
7
\end{tabular} & \(2 / 10 / 2011\) & 21.27 & 0.157 & -471.985 & 21.675 & 22.30 \\
\hline \begin{tabular}{l}
\(n++\). \\
8
\end{tabular} & \(2 / 11 / 2011\) & 21.33 & 0.152 & -459.262 & 21.769 & 22.37 \\
\hline \begin{tabular}{l}
\(n+\). \\
9
\end{tabular} & \(2 / 14 / 2011\) & 21.50 & 0.150 & -452.185 & 21.879 & 22.48 \\
\hline \begin{tabular}{l}
\(n++\). \\
10
\end{tabular} & \(2 / 15 / 2011\) & 21.46 & 0.140 & -419.686 & 21.914 & 22.47 \\
\hline
\end{tabular}
\footnotetext{
TABLE 7.2 The standard deviation of errors for
different "days ahead" forecasts.
\begin{tabular}{|l|c|c|c|c|c|}
\hline Days ahead & 1 & 2 & 3 & 5 & 10 \\
\hline Stdev of errors & 1.137 & 1.336 & 1.519 & 1.860 & 2.672 \\
\hline
\end{tabular}
The standard deviation for five forecasts (Table 7.2), taken over the entire 10 years, shows the error increasing as the days-ahead increase. This confirms the expectation that forecasting accuracy decreases with time and that confidence bands will get wider with time. For this reason, any forecasts used in our strategies will be 1-day ahead.
\section*{Defining Our Expectations}
To be profitable trading a trending system it is only necessary to be correct in one of the following two cases:
1. In more than \(50 \%\) of the days you are correct in predicting whether prices will go up or down and the average up move is equal to the average down move.
2. Your forecast accuracy is less than \(50 \%\) but the size of the profitable moves is greater than the size of the losing moves.
Unfortunately, there is no way to prove that a particular method of forecasting, moving average, regression, or other techniques, will be accurate in the future over all calculation periods. The fact is that some calculation periods will be profitable and others will not. Those that are profitable must satisfy one of the two conditions stated above.
Experience shows that the most robust trending method is the one that has been profitable over most markets and most calculation periods. The shorter calculation periods have been excluded because they have no reliable trend (this was discussed in Chapter 1), so we need to restrict our statement to longer periods.
The methods discussed in the remainder of this chapter are all intended to identify the direction of prices based only on past price data. The trading systems that use these trends assume persistence, that there is a better chance of prices continuing in the same direction. If the systems are profitable, then the assumption was correct. There is sufficient performance history for macrotrend funds that justify this conclusion. These systems will be discussed in the next chapter.
\section*{PRICE CHANGE OVER TIME}
The most basic of all trend indicators is momentum ( \(M\) ), the change of price over some period of time. Unless indicated, the time period will be in days, but it could be intraday bars or weeks. Momentum is written as:
\[
M_{t}=p_{t}-p_{t-n}
\]
where \(t\) is today, and \(n\) is the number of days back. Sometimes this is called rate of change (ROC), but true rate of change refers to change over a unit of time. Then:
\[
R O C_{t}=\underline{p_{t}-p_{t-n}}
\]
If the momentum is positive, we can say that the trend is up, and if negative, the trend is down. Of course, this decision is based only on two data points, but if those points are far enough away from each other, that is, if \(n\) is large, then the trend as determined by this method will be very similar to a simple moving average, discussed in the next section. The simplest method can often be the most robust; therefore, as you read about other approaches to analyzing price, keep asking, "Is it better than momentum?"
\section*{THE MOVING AVERAGE}
The most well-known of all smoothing techniques, used to remove market noise and find the direction of prices, is the moving average (MA). Using this method, the number of elements to be averaged remains the same, but the time interval advances. This is also referred to as a rolling calculation period. Using a series of prices,
\(p_{0}, p_{1}, p_{2}, \ldots, p_{t}\), a moving average measured over the most recent \(n\) of these prices, or data points, at time \(t\) would be:
\[
M A_{t}=\frac{p_{t-n+1}+p_{t-n+2}+\cdots+p_{t}}{n}=\frac{1}{n} \sum_{i=t-n+1}^{t} p_{i}, n \leq t
\]
Then today's moving average value is the average (arithmetic mean) of the most recent \(n\) data points. For example, using three points \((n=3)\) to generate a \(3^{-}\) day moving average starting at the beginning of the data:
\[
\begin{aligned}
M A_{3}= & \left(p_{1}+p_{2}+p_{3}\right) / 3 \\
M A_{4}= & \left(p_{2}+p_{3}+p_{4}\right) / 3 \\
& \vdots \\
M A_{t}= & \left(p_{t-2}+p_{t-1}+p_{t}\right) / 3
\end{aligned}
\]
You may quickly realize that today's new moving average value is only dependent on how the new data point compares to the old one that is being dropped off. All the other data points remain unchanged. If the new price is higher than the oldest price, then the moving average will increase; if lower, the new average value will decrease. That makes it not exactly the same as momentum, but very similar.
\section*{The Calculation Period}
The selection of the number of data points, called the calculation period, is based on the predictive quality of the choice (measured by the error but more often by the profitability) or the need to determine price trends over specific time periods, such as a season. For outright trading, the calculation period is chosen for its accuracy in identifying the trend and the risk tolerance of the trader to price swings. Slower trends, using longer calculation periods, are usually better indicators of price direction, but involve larger risk. The stock market has adopted the 200-day moving average as its benchmark for direction; however, traders find this much too slow for timing buy and sell signals.
The length of a moving average can be tailored to specific
needs. A 63-day moving average, \(1 / 4\) of 252 business days in the year, would reflect quarterly changes in stock price, minimizing the significance of price fluctuations within a calendar quarter. A simple yearly calculation period, 252 days, would ignore all seasonality and emphasize the annual growth of the stock, or show inflation in commodities. Any periodic cycle that is the same length as the moving average length is lost; therefore, if a monthly cycle has been identified, then a moving average of less than 10 days (half the cycle length) would be best for letting the moving average show that cycle. Using a moving average to find seasonal and cyclic patterns is covered in Chapters 10 and 11, and was discussed in Chapter 6, "Regression Analysis." At this point it is sufficient to remember that if there is a possibility of a cyclic or seasonal pattern within the data, care should be taken to select a moving average that is out of phase with that pattern (that is, not equal to the cycle period).
The length of the moving average may also relate to its commercial use. A jeweler may purchase silver each week to produce bracelets. Frequent purchases of small amounts keep the company's cash outlay small. The purchaser can wait a few extra days during a week while prices continue to trend downward but will buy immediately when prices turn up. A 6-month trend cannot help him because it gives a long-term answer to a short-term problem; however, a 5 -day moving average may give the trend direction within the jeweler's time frame.
\section*{User-Friendly Software}
Fortunately, we have reached a time when it is not necessary to perform these calculations the long way. Spreadsheet programs and specialized testing software provide simple tools for performing trend calculations as well as many other more complex functions discussed in this book. The notation for many of the different spreadsheets and software is very similar and selfexplanatory:
\begin{tabular}{|l|l|l|l|}
\hline Function & Excel & TradeStation & MatLab \\
\hline Summation & =sum & summation & Sum \\
\hline Moving average & \(=\) average & average & Mean \\
\hline Standard deviation & \(=\) stdev & stddev & Std \\
\hline Maximum value & \(=\) max & highest & Max \\
\hline Minimum value & \(=\) min & lowest & Min \\
\hline
\end{tabular}
In the spreadsheet notation, the function is followed by the list of rows. For example, (D11:D30) would be 20 rows in column D, and in TradeStation notation average(close,period) is followed by the data and the calculation period. For MatLab the parameter is a vector or an array.
\section*{What Can You Average?}
The closing or daily settlement is the most common price applied to a moving average. It is generally accepted as the "true" price of the day and is used by many analysts for the calculation of trends. It is the price used to reconcile brokerage accounts at the end of the day, create
the Net Asset Value (NAV) for funds, and for futures trading it is called marked-to-market accounting. A popular alternative is to use the average of the high, low, and closing prices, representing some sort of center of gravity. You may also try the average of the high and low prices, ignoring the closing price entirely.
Another valid component of a moving average can be other averages. For example, if \(p_{1}\) through \(p_{t}\) are prices, and \(M A_{t}\) is a 3-day moving average on day \(t\), then:
\[
\begin{aligned}
& M A_{3}=\left(p_{1}+p_{2}+p_{3}\right) / 3 \\
& M A_{4}=\left(p_{2}+p_{3}+p_{4}\right) / 3 \\
& M A_{5}=\left(p_{3}+p_{4}+p_{5}\right) / 3
\end{aligned}
\]
and:
\[
D M A_{5}=\left(M A_{3}+M A_{4}+M A_{5}\right) / 3
\]
where \(D M A_{5}\) is a double-smoothed moving average, which gives added weight to the center points. Double smoothing can be very effective and is discussed later in this chapter. Smoothing the highs and lows independently is another technique that creates a daily trading range, or a band that reflects volatility. This can be used to identify normal and extreme moves, and is also discussed in Chapter 8.
\section*{Types of Moving Averages}
Besides varying the length of the moving average and the elements that are to be averaged, there are a great number of variations on the simple moving average. In the methods that follow the notation assumes that the most recent day is \(t\) and the average is found over the past \(n\) days.
\section*{The Simple Moving Average}
The simple moving average is the average (mean) of the most recent \(n\) days. It has also been called a truncated moving average and it is the most well-known and commonly used of all the methods. Repeating the formula from earlier in this chapter,
\[
M A_{t}=\frac{p_{t-n+1}+p_{t-n+2}+\cdots+p_{t}}{n}=\frac{1}{n} \sum_{i=t-n+1}^{t} p_{i}, \quad n \leq t
\]
The main objection to the simple moving average is its abrupt change in value when an important old piece of data is dropped off, especially if only a few days are used in the calculation. We also know that, if the new data, \(p_{t}\) , is greater than the oldest data item that will be dropped off, \(P_{t-n}\), then the new average, \(M A_{t}\) will be greater than the previous average, \(M A_{t-1}\).
\section*{Average-Modified or Average-Off Method}
To avoid the end-off problem of the simple moving average, each time a new piece of data is added the previous average can be dropped off. This is called an
average-modified or average-off method. It is computationally convenient because you only need to keep the old average value rather than all the data that was used to find the average.
\[
A v g O f_{t}=\frac{(n-1) \times \operatorname{AvgOff}_{t-1}+p_{t}}{n}
\]
\(n\)
The substitution of the moving average value for the oldest data item tends to smooth the results even more than a simple moving average and dampens the end-off impact.
\section*{Weighted Moving Average}
The weighted moving average (WMA) opens many possibilities. It allows the significance of individual or groups of data to be changed. It may restore perceived value to parts of a data sample, or it may incorrectly bias the data. A weighted moving average is expressed in its general form as:
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0554.jpg?height=415&width=1327&top_left_y=1373&top_left_x=63)
The weighted moving average at time \(t\) is the average of the previous \(n\) prices, each price having its own weighting factor \(w_{i}\). There is no restriction on the values
used as weighting factors, that is, they do not have to be percentages that all total to 1 . The most popular form of this technique is called front-loaded because it gives more weight to the most recent data \((t=n)\) and reduces the significance of the older elements. For the front-loaded weighted moving average (seen in Figure 7.2):
\[
w_{1} \leq w_{2} \leq \cdots \leq w_{n-1} \leq w_{n}
\]
The weighting factors \(w_{i}\) may also be determined by regression analysis, but then they may not necessarily be front-loaded. A common modification to front-loading is called step-weighting in which each successive \(W_{i}\) differs from the previous weighting factor \(w_{i-1}\) by a fixed increment. The most common 5-day front-loaded, stepweighted average would have weighting factors increasing by 1 each day, \(w_{1}=1, w_{2}=2, w_{3}=3\), \(w_{4}=4\), and \(w_{5}=5\). In general, for an \(n\)-day frontloaded step-weighted moving average:
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0555.jpg?height=566&width=1329&top_left_y=1338&top_left_x=64)
FIGURE 7.2 A comparison of moving averages. The
simple moving average, linearly weighted average, triangular weighted, and average-off methods are applied to the S\&P, April through December 2010.
\[
\begin{aligned}
w_{t-n+1} & =1 \\
& \vdots \\
w_{t-1} & =n-1 \\
w_{t} & =n
\end{aligned}
\]
A TradeStation program for calculating an \(n\)-day, frontloaded, linearly weighted moving average is called waverage.
If simple linear step-weighting is not what you want, then a percentage relationship \(a\) between \(w_{i}\) elements can be used:
\[
w_{i-1}=a \times w_{i}
\]
If \(a=0.90\) and \(w_{5}=5\), then \(w_{4}=4.5, w_{3}=4.05\) ,\(w_{2}=3.645\), and \(w_{1}=3.2805\). Each older data item is given a weight of 0.90 of the more recent value. This is similar to exponential smoothing, which will be discussed later in this chapter.
\section*{Weighting by Group}
Prices may also be weighted in groups. If every two consecutive data elements have the same weighting factor, and \(P_{t}\) is the most recent price, \(n\) is the
calculation period (preferably an even number), and there are \(n / 2\) number of weights, then:
\[
W M A_{t}=\frac{w_{1} p_{t-n+1}+w_{1} p_{t-n+2}+w_{2} p_{1-n+3}+w_{2} p_{t-n+4}+\cdots+w_{n / 2} p_{t-1}+w_{n} / 2 p_{t}}{2 \times\left(w_{1}+w_{2}+\cdots+w_{n / 2}\right)}
\]
For two or more data points using the same weighting, this formula can be regrouped as:
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0557.jpg?height=152&width=1159&top_left_y=668&top_left_x=228)
\[
\begin{aligned}
& 2 \times\left(w_{1}+w_{2}+\cdots+w_{n / 2}\right)
\end{aligned}
\]
Any number of consecutive data elements can be grouped for a step-weighted moving average.
If the purpose of weighting is to reproduce a pattern that is intrinsic to price movement, then either the geometric average, \(G=\left(p_{1} \times p_{2} \times p_{3} \times \ldots \times p_{p_{n}}\right)^{1 / n}\), discussed in Chapter 2, or exponential smoothing, explained later in this chapter, may be a better tool.
\section*{Triangular Weighting}
While the simple moving average or linear regression treats each price equally, exponential smoothing and linear step-weighting put greater emphasis on the most recent data. There is an entire area of study in which the period of the dominant cycle is the basis for determining the best trend period. Triangular weighting or triangular filtering \({ }^{1}\) attempts to uncover the trend by
reducing the noise in both the front and back of the calculation window, where it is expected to have the greatest interference. Therefore, if a 21-day triangular weighting is used, the 11th day will have the greatest weight while days 1 and 21 will have the smallest. It is best to have an odd number of days.
To implement triangular weighting with integer weights, begin with the standard formula for a weighted average, calculated for \(n\) days as of the current day \(t\) :
\[
W M A_{t}=\frac{\sum_{i=1}^{n} w_{i} P_{t-n+i}}{\sum_{i=1}^{n} w_{i}}\left\{\begin{array}{l}
w_{i}=i, \quad \text { for } i=1, \frac{n}{2} \\
w_{i}=n-\frac{n}{2}+i-1, \quad \text { for } i>n / 2
\end{array}\right.
\]
where \(n\) is also called the size, or width, of the window. These weighting factors \(w_{i}\) will increase linearly from 1 to the middle of the window, at \(n / 2\), then decrease until \(n\).
Instead of a triangular filter, which climbs in equal steps to a peak at the middle value, a Guassian filter can be used, which weights the data in a form similar to a bell curve. Here, the weighting factors are more complex, but the shape of the curve may be more appealing:
\[
w_{i}=10^{x} \text { and } x=\frac{3}{2} \times\left(1-\frac{2 i}{n}\right)^{2}
\]
Triangular weighting is often used for cycle analysis. Two techniques that use this method successfully, Hilbert and Fischer transforms, can be found in Chapter 11.
\section*{Pivot-Point Weighting}
Too often we limit ourselves by our perception of the past. When a weighted moving average is used, it is normal to assume that all the weighting factors should be positive; however, that is not a requirement. The pivot-point moving average uses reverse linear weights (e.g., \(5,4,3, \ldots\) ) that begin with a positive value and continue to decline even when they become negative. \(\underline{2}\) In the following formula, the pivot point, where the weight is zero, is reached about \(2 / 3\) through the data interval. For a pivot-point moving average of 11 values, the eighth data point is given the weight of \(o\) :
\(P P M A_{t}(11)=\left(-3 p_{t-10}-2 p_{t-9}-1 p_{t-8}+0 p_{t-7}+1 p_{t-6}+2 p_{t-5}\right.\)
\[
\left.+3 p_{t-4}+4 p_{t-3}+5 p_{t-2}+6 p_{t-1}+7 p_{t}\right) / 22
\]
The intent of this pattern is to reduce the lag by frontloading the prices. The divisor is smaller than the usual linear weighted average (where the sum of 1 through 11 is 66) because it includes negative values. The general formula for an \(n\)-day pivot-point moving average is: \({ }^{3}\)
\[
\operatorname{PPMA}_{t}(n)=\frac{2}{n(n+1)} \sum_{i=1}^{n}(3 i-n-1) p_{i}
\]
1 A computer program and indicator that calculates and displays the pivot-point moving average, both called TSM Pivot Point Average, are available on the Companion Website. The negative weighting factors actually reverse the impact of the price move for the oldest data points rather than just give them less importance. For a short interval this can cause the trendline to be out of phase with prices. This method seems best when used for longer-term cyclic markets, where the inflection point, at which the weighting factor becomes zero, is aligned with the cyclic turn or can be fixed at the point of the last trend change.
\section*{Standard Deviation Moving Average}
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0560.jpg?height=122&width=144&top_left_y=991&top_left_x=65)
This method creates a comparatively smooth trendline, StdAvg, by modifying the moving average value with a percentage of the standard deviation of prices. \({ }^{4}\) This also implies some amount of volatility. The following instructions are from the program TSM Stdev \(M v g A v g\), available on the Companion Website. It uses \(5 \%\) of a 30 -period standard deviation, and a 15 -period moving average; however, each of these values can be changed. The result is shown for S\&P futures in Figure 7.3.
SD = StdDev(close,30);
SDV = (SD - SD[1]) / SD;
StdAvg = Average(close,15) + 0.05*SDV;
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0561.jpg?height=558&width=1327&top_left_y=64&top_left_x=63)
FIGURE 7.3 SP continuous futures, April through December 2010, with examples of the simple moving average, standard deviation average, geometric average, and exponential smoothing, all with calculation periods of 40 days.
\section*{THE MOVING MEDIAN}
The median is the middle value when all items are sorted. It is useful for ignoring the extremes and showing a "typical" value. It's a slower calculation than any of the other averages because each day the past \(N\) prices must be sorted.
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0561.jpg?height=122&width=144&top_left_y=1441&top_left_x=65)
One problem using the moving median instead of a moving average is that the median value will remain the same if prices have been in a sideways range before they take a sharp turn up or down. The new prices will not affect the median value until nearly half the data are replaced. That makes the median appear to go sideways while prices are moving quickly. You can plot the moving
median using the indicator TSM Median available on the Companion Website.
\section*{GEOMETRIC MOVING AVERAGE}
The geometric mean is a growth function that is applicable to long-term price movement. It was introduced in Chapter 2. It is especially useful for calculating the components of an index. The geometric mean can also be applied to the most recent \(n\) points at time \(t\) to get a geometric average (GA) similar in function to a moving average:
\[
G A_{t}=\left(p_{t-n+1} \times p_{t-n+2} \times \cdots \times p_{t-1} \times p_{t}\right)^{(1 / n)}=\left(\prod_{i=1}^{n} p_{t-i+1}\right)^{\prime}
\]
The daily calculation, as shown in Chapter 2, could be rewritten as:
\[
\ln G A_{t}=\frac{\ln p_{t-n+1}+\ln p_{t-n+2}+\cdots+\ln p_{t-1}+\ln p_{t}}{n}=\frac{1}{n}\left(\sum_{i=1}^{n} \ln p_{t-i+1}\right)
\]
This is similar in form to the standard moving average based on the arithmetic mean and can be written in either spreadsheet or program code using the natural \(\log , \ln\), as:
GA = average(ln(price), n)
A weighted geometric moving average ( \(W G A\) ), for \(n\) days ending at the current day \(t\), would have the form:
\[
\begin{aligned}
\ln W G A_{t}= & \frac{w_{1} \ln p_{t-n+1}+w_{2} \ln p_{t-n+2}+\cdots+w_{n-1} \ln p_{t-1}+w_{n} \ln p_{t}}{w_{1}+w_{2}+\cdots+w_{n}} \\
= & \frac{\sum_{i=1}^{n} w_{i} \ln p_{t-i+1}}{\sum_{i=1}^{n} w_{i}}
\end{aligned}
\]
The geometric moving average gives greater weight to lower values without the need for a discrete weighting function. This is most applicable to long data intervals where prices had a wide range of values. In applying the technique to recent index or stock prices, this distinction is not as clear. For example, if the historical index values vary from 10 to 1000 , the simple average of those two values is 505 and the geometric average is 100 , but for the three sequential prices of \(56.20,58.30\), and 57.15 , the arithmetic mean is 57.2166 and the geometric is 57.1871 . The \(5^{-}, 10\)-, or 20 -day moving averages of stock prices, compared to geometric averages of the same intervals, show negligible differences. The geometric moving average is best applied to long-term historic data with wide variance, using yearly or quarterly average prices.
\section*{ACCUMULATIVE AVERAGE}
An accumulative average is simply the long-term average of all data and is not practical for trend following. One drawback is that the final value is dependent upon the start date. If the data have varied around the same price for the entire data series, then the result would be good. It would also be useful if you are looking for the average of a ratio over a long period. Experience shows that price levels have changed because of inflation or a structural shift in supply and/or demand, and that a rolling window is a better approach.
\section*{Reset Accumulative Average}
A reset accumulative average is a modification of the accumulative average and attempts to correct for the loss of sensitivity as the number of trading days becomes large. This alternative allows you to reset or restart the average whenever a new trend begins, a significant event occurs, or at some specified time interval, for example, at the time of quarterly earnings reports or at the end of the current crop year.
\section*{DROP-OFF EFFECT}
Many rolling trend calculations are distinguished by the drop-off effect, a common way of expressing the abrupt change in the current value when a significant older value is dropped from the calculation. Simple moving averages, linear regressions, or any average that weights the data equally, or gives more weight to the older data, are subject to this effect. For an \(n\)-period moving average, the importance of the oldest value being
dropped off, \(P_{t-n}\), is measured by the difference between the new price being added, \(P_{t}\), and the one being removed, \(P_{t-n}\), divided by the number of periods:
\[
\text { Drop-off effect }=\operatorname{ABS}\left(P_{t}-P_{t-n}\right) / n
\]
A front-weighted average, in which the oldest values have less importance, reduces this effect because older data slowly become a smaller part of the result before being dropped off. Exponential smoothing, discussed next, is by nature a front-loaded trend that minimizes the drop-off effect as does the average-off method.
\section*{EXPONENTIAL SMOOTHING}
Exponential smoothing may appear to be more complex than other techniques, but it is only another form of a weighted average. It can also be more accurately called percentage smoothing and has the added advantage of only needing the current price, \(P_{t}\), the last exponentially smoothed value \(E_{t-1}\), and the smoothing constant \(a\) (a percentage), to compute the new value. The technique of exponential smoothing was developed during World War II for tracking aircraft and missiles and projecting their positions: The immediate past is used to predict the immediate future.
Exponential smoothing is similar to a weighted moving average, but the weights have a specific form; they get smaller by the same percentage for each previous day. Think of this in terms of a company with 1,000 shares of
stock outstanding. A new investor is given \(5 \%\), or 50 shares, leaving the original shareholders to divide 950 shares. A second investor buys \(5 \%\), so the previous investor now has 47.5 shares and the remaining have 902.5. For the next investor buying \(5 \%\) we get \(50,47.5\), 45.125 , and the balance is 857.375 . The original shareholders will always have some diminishing shares and the new shareholder will always have \(5 \%\). Because all past data will have some weight, exponential smoothing will be slower than the comparable moving average.
\section*{The Common Form of Exponential Smoothing}
The common use of exponential smoothing is written as:
\[
E_{t}=E_{t-1}+s c \times\left(p_{t}-E_{t-1}\right)
\]
where
\[
\begin{aligned}
E_{t} \text { and } & =\text { today's and yesterday's exponential } \\
E_{t-1} & \text { smoothing values } \\
p_{t} & =\text { today's price } \\
s c & =\text { the smoothing constant, } \mathrm{o} \leq s c \leq 1
\end{aligned}
\]
Another way of visualizing the effect of the smoothing process with \(a=0.10\) is by thinking of it as moving the exponential trendline closer to the current price by \(10 \%\) of the distance between the price and the previous trendline value. In Figure 7.4, using a smoothing constant of o.10, the distance from the new price \(P_{t}\) and
the previous trendline value \(E_{t-1}\) is \(p_{t}-E_{t-1}\). The new trendline value is \(10 \%\) closer to the price because the distance between \(p_{t}\) and \(E_{t-1}\) is reduced by
\(0.10 \times\left(p_{t}-E_{t-1}\right)\). Therefore:
New exponential value \(=\) Previous exponential value
t a percentage of (Today's price - Previous exponential value)
The smoothing process is started by letting \(E_{1}=p_{1}\) and calculating the next value:
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0567.jpg?height=865&width=1327&top_left_y=857&top_left_x=63)
FIGURE 7.4 Exponential smoothing. The new exponential trendline value, \(E_{t}\), is moved closer to the
new price, \(P_{t}\), by \(10 \%\) of the distance between the new price and the previous exponential trendline value, \(E_{t-1}\).
Even though the calculations are initialized with the closing price, a longer-term smoothing, where the smoothing constant is small, will take more data for the smoothed line, \(E_{t}\), to reach a stable value.
\section*{The Smoothing Constant Expressed in Days}
The standard conversion from the number of days to a smoothing constant sc was given by Hutson \({ }^{5}\) as:
\[
s c=\frac{2}{n+1}
\]
where \(n\) is the equivalent number of days in the standard moving average. While this is the way most development platforms express the calculation period for exponential smoothing, it greatly limits the smoothing ability. In this formula, when \(n\) goes from 1 to 5 , we get smoothing constants of \(1.0,0.667,0.50,0.40\), and 0.333 . That leaves large gaps in the test possibilities. The function TSM_Exponential_Smoothing allows you to input a fractional smoothing constant.
Using the Hutson conversion does not give you the real exponential smoothing equivalent of the moving average because it ignores the lag, which can be substantial. This can be seen in Tables 7.3 and 7.4 .
A 2nd- or 3rd-order exponential smoothing, based on the weighting of the past 2 or 3 days' prices, is the
exponential equivalent of step-weighting. Its general form is:
\[
s c_{p}=1-\left(1-\frac{2}{n+1}\right)^{\frac{1}{p}}
\]
A comparison of the standard moving average days with 1st-, 2nd-, and 3rd-order exponential smoothing is shown in Table 7.3.
TABLE 7.3 Comparison of exponential smoothing values.
\begin{tabular}{|l|c|c|c|}
\hline \begin{tabular}{l}
Moving \\
Average Days \\
( \(\boldsymbol{n}\) )
\end{tabular} & \begin{tabular}{c}
1st-Order \\
\(\boldsymbol{P}=1\)
\end{tabular} & \begin{tabular}{c}
2nd-Order \\
\(\boldsymbol{P}=2\)
\end{tabular} & \begin{tabular}{c}
3rd-Order \\
\(P=3\)
\end{tabular} \\
\hline 3 & 0.500 & 0.293 & 0.206 \\
\hline 5 & 0.333 & 0.184 & 0.126 \\
\hline 7 & 0.250 & 0.134 & 0.091 \\
\hline 9 & 0.200 & 0.106 & 0.072 \\
\hline 11 & 0.167 & 0.087 & 0.059 \\
\hline 13 & 0.143 & 0.074 & 0.050 \\
\hline 15 & 0.125 & 0.065 & 0.044 \\
\hline 17 & 0.111 & 0.057 & 0.039 \\
\hline 19 & 0.100 & 0.051 & 0.035 \\
\hline 21 & 0.091 & 0.047 & 0.031 \\
\hline
\end{tabular}
TABLE 7.4 Comparison of exponential smoothing residual impact.
\begin{tabular}{|c|c|c|c|c|}
\hline \(\mathbf{N}\) & 2/(n + 1) & RI (\%) & \(\mathbf{1 0 \%}\) RI & \(\mathbf{5 \% ~ R I}\) \\
\hline .5 & 0.333 & 13.17 & 0.369 & 0.451 \\
\hline 10 & 0.182 & 13.44 & 0.206 & 0.259 \\
\hline 15 & 0.125 & 13.49 & 0.142 & 0.181 \\
\hline 20 & 0.095 & 13.51 & 0.109 & 0.139 \\
\hline
\end{tabular}
\section*{Estimating Residual Impact}
The primary difference between the standard moving average and exponential smoothing is that all prices remain as part of the exponentially smoothed value indefinitely. For practical purposes, the effect of the oldest data may be very small. A general method of approximating the smoothing constant for a given level of residual impact is given by:
\[
s c=1-R I^{1 / n}
\]
where
\(n=\) the number of moving average days that is equivalent to the smoothing constant
\(R I=\) the level of residual impact expressed as a percentage (e.g., 0.05, 0.10, 0.20)
A smaller percent implies more residual impact. 6 The approximation for the smoothing constant, given in the previous section as \(2 /(n+1)\), can be shown to have a consistent residual impact of between 13 and \(14 \%\). The use of the preceding formula, as shown in Table 7.4, would allow the specific adjustment of residual impact;
however, eliminating all residual impact would transform exponential smoothing to a weighted average.
\section*{Relating Exponential and Standard Averages}
It is much easier to visualize the amount of smoothing in a 10-day moving average than with a "10\%" exponential smoothing, where \(a=0.10\). Although we try to relate the speed of both techniques, the simple moving average is equally weighted and the exponential is front weighted; therefore, they produce very different results. Because the exponential smoothing never completely discards the old data, a \(10 \%\) smoothing is slower than a 10-day moving average, and a \(5 \%\) smoothing is slower than a 20-day moving average.
Table 7.5 relates the fully calculated exponential smoothing (within 1\%) to the standard moving average. Find the smoothing constant on the top line, and the equivalent number of days in a standard moving average will be below it. Observe in the following summary that, if you perform an optimization with equally spaced exponential smoothing constants, there is more sensitivity at the low end and little at the high end.
If equally distributed smoothing constants are used for testing, half of the tests will analyze moving averages of three days or less. If the process is reversed, and equally spaced days are used, then the smoothing constants are very different, shown in the next summary, Table 7.6. The distribution of calculation periods used for testing will be important when finding robust system parameters and is discussed in Chapter 21.
The distribution of smoothing constants is very close to logarithmic and is plotted on a log scale in Figure 7.5. This can be seen because the line representing the relationship between the smoothing constant and the moving average days is nearly straight.
\section*{TABLE 7.5 Equating standard moving averages} to exponential smoothing.
\begin{tabular}{|l|c|c|c|c|c|c|c|c|c|}
\hline \begin{tabular}{l}
Smoothing \\
constant
\end{tabular} & 0.10 & 0.20 & 0.30 & 0.40 & 0.50 & 0.60 & 0.70 & 0.80 & 0 \\
\hline \begin{tabular}{l}
Standard \\
(n-day \\
average)
\end{tabular} & 20 & 10 & 6 & 4 & 3 & 2.25 & 1.75 & 1.40 & 1. \\
\hline
\end{tabular}
\section*{TABLE 7.6 Equating exponential smoothing to} standard moving averages.
\begin{tabular}{|l|c|c|c|c|c|c|c|c|}
\hline \begin{tabular}{l}
Standard \\
( \(n\)-day \\
average \()\)
\end{tabular} & 2 & 4 & 6 & 8 & 10 & 12 & 14 & 16 \\
\hline \begin{tabular}{l}
Smoothing \\
constant
\end{tabular} & 0.65 & 0.40 & 0.30 & 0.235 & 0.20 & 0.165 & 0.14 & 0.125 \\
\hline
\end{tabular}
A
Number of Days Used in Calculating
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0573.jpg?height=1375&width=1329&top_left_y=148&top_left_x=62)
FIGURE 7.5 Graphic evaluation of exponential smoothing and moving average equivalents.
\section*{Double Smoothing}
In order to make a trendline smoother, the period of a moving average may be increased or the exponential
smoothing constant decreased. This succeeds in reducing the short-term market noise at the cost of increasing the lag. An alternative to increasing the calculation period is double smoothing, that is, the trend values can themselves be smoothed. This will slow down the trendline but gives weight to the previous values in a way that may be unexpected.
A double-smoothed 3-day moving average, \(M A\), would take the most recent 3 moving average values, calculated from prices, and use them in another 3-period average to get a double-smoothed moving average, \(D M A\) :
\[
\begin{aligned}
& M A_{3}=\left(p_{1}+p_{2}+p_{3}\right) / 3 \\
& M A_{4}=\left(p_{2}+p_{3}+p_{4}\right) / 3 \\
& M A_{5}=\left(p_{3}+p_{4}+p_{5}\right) / 3
\end{aligned}
\]
then
\[
D M A_{5}=\left(M A_{3}+M A_{4}+M A_{5}\right) / 3
\]
By substituting the original prices, \(P_{1}, \ldots, p_{5}\), into the equation for \(D M A_{5}\) we find out that:
\[
D M A_{5}=\left(p_{1}+2 p_{2}+3 p_{3}+2 p_{4}+p_{5}\right) / 9
\]
This shows that double smoothing puts weight on the center values, and for a 3-day average the results look the same as triangular weighting. For longer calculation periods the end values have decreasing weight, but all
other values have the same weight. For a 5 -day doublesmoothed average the three end values would have declining weights. For exponential smoothing the result is also different. Because the most recent value in exponential smoothing receives the full weight of the smoothing constant, \(s c\), the double smoothing:
\[
D E_{t}=D E_{t-1}+s c \times\left(E_{t}-D E_{t-1}\right)
\]
causes the nearby value \(t\) to be smoothed twice by \(s c\), or \(s c \times s c\), and older values as well. Therefore, the net effect of using a constant of \(s c=0.10\) for exponential double smoothing will result in a weighting that is much closer to using the square of \(s c\), approximately 0.031 .
Figure 7.6 and Table 7.7 give an example of this method using the standard conversion of a smoothing constant from the number of days. Prices for Microsoft are shown, along with a single 0.20 smoothing, a double smoothing, and a single error correction. The error correction positions the trendline in the middle of the price move and may be a good candidate for mean reversion trading.
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0576.jpg?height=819&width=1341&top_left_y=59&top_left_x=60)
FIGURE 7.6 Comparison of exponential smoothing techniques applied to Microsoft shows a single 0.20 smoothing (Exp), a double-smoothed series (Dbl Exp), and a single smoothed series with the forecast error corrected (Single Err Cor).
\section*{TABLE 7.7 Comparison of exponential} smoothing techniques applied to Microsoft.
\begin{tabular}{|l|l|l|c|l|l|l}
\hline & & Exp & \begin{tabular}{c}
Dbl \\
Exp
\end{tabular} & & \begin{tabular}{l}
Sm \\
Err
\end{tabular} & \\
\hline Date & MSFT & 0.10 & o.10 & \begin{tabular}{c}
Exp \\
Err
\end{tabular} & .o.10. & \begin{tabular}{c}
Cor \\
ExI
\end{tabular} \\
\hline \(1 / 19 / 2011\) & 28.31 & 27.994 & 27.540 & .0 .316 & .0 .453 & 28.4 \\
\hline \(1 / 20 / 2011\) & 28.19 & 28.013 & 27.588 & .0 .177 & .0 .426 & 28.4 \\
\hline \(1 / 21 / 2011\) & 27.86 & 27.998 & 27.629 & -0.138 & .0 .369 & \(28.3^{4}\) \\
\hline \(1 / 24 / 2011\) & 28.22 & 28.020 & 27.668 & .0 .200 & .0 .352 & 28.3 \\
\hline
\end{tabular}
\begin{tabular}{|l|l|l|l|l|l|l|}
\hline \(1 / 25 / 2011\) & 28.29 & 28.047 & 27.706 & .0 .243 & .0 .341 & \(28.3^{4}\) \\
\hline \(1 / 26 / 2011\) & 28.62 & 28.105 & 27.746 & .0 .515 & .0 .359 & 28.4 \\
\hline \(1 / 27 / 2011\) & 28.71 & 28.165 & 27.788 & .0 .545 & .0 .377 & \(28.5^{\prime}\) \\
\hline \(1 / 28 / 2011\) & 27.59 & 28.108 & 27.820 & -0.518 & .0 .288 & 28.3 \\
\hline \(1 / 31 / 2011\) & 27.57 & 28.054 & 27.843 & -0.484 & .0 .211 & 28.2 \\
\hline \(2 / 1 / 2011\) & 27.83 & 28.031 & 27.862 & -0.201 & .0 .170 & 28.21 \\
\hline \(2 / 2 / 2011\) & 27.78 & 28.006 & 27.876 & -0.226 & .0 .130 & 28.1 \{ \\
\hline \(2 / 3 / 2011\) & 27.49 & 27.955 & 27.884 & -0.465 & .0 .070 & 28.0 ؛ \\
\hline \(2 / 4 / 2011\) & 27.61 & 27.920 & 27.888 & -0.310 & .0 .032 & \(27.9!\) \\
\hline \(2 / 7 / 2011\) & 28.04 & 27.932 & 27.892 & .0 .108 & .0 .040 & 27.97 \\
\hline \(2 / 8 / 2011\) & 28.12 & 27.951 & 27.898 & .0 .169 & .0 .053 & 28.0 ! \\
\hline \(2 / 9 / 2011\) & 27.81 & 27.937 & 27.902 & -0.127 & .0 .035 & 27.9 ! \\
\hline \(2 / 10 / 2011\) & 27.34 & 27.877 & 27.899 & -0.537 & -0.022 & \(27.8!\) \\
\hline
\end{tabular}
\section*{Double Smoothing of Price Changes}
To reduce the compounded lag produced by double smoothing yet take advantage of the smoother trendline, William Blau has substituted the price changes,
\(p_{t}-p_{t-n}\), for the price itself, 7 a process that makes the data more sensitive to change. The first smoothing is then performed on this accelerated price series and acts to restore the speed of the series back to normal. When
\(n=1\), the price changes are called the first differences. In effect, the first smoothed series does not have a lag so that the second smoothing results in one lag, the same as a normal moving average. Blau found this to be a successful proxy for long-term trends, where the first
smoothing may be as long as 250 days, and the second, a much shorter 5 days. The only disadvantage of this is that the scale is no longer the same as the price so that it cannot be plotted in the same window as prices.
To calculate the double smoothing of price change (in the following chapters the price change is also called momentum), follow the same method as exponential smoothing. First calculate the smoothed momentum, \(S M_{t}\), substituting the price change, \(P_{t}-P_{t-n}\), for the price, \(P_{t}\), normally used. Next, perform another exponential smoothing using the smoothed momentum instead of price. The result is the double-smoothed momentum, \(D S M_{t}\).
\[
\begin{aligned}
S M_{t} & =S M_{t-1}+s c \times\left(\left(p_{t}-p_{t-n}\right)-S M_{t-1}\right) \\
D S M_{t} & =D S M_{t-1}+s c \times\left(S M_{t}-D S M_{t-1}\right)
\end{aligned}
\]
As an example of this approach, start with the 5 -day momentum, \(M(5)_{t}=p_{t}-p_{t-5}\), and smooth the momentum values using the 5 -day period equivalent, \(s c=0.166\). Smooth the resulting values again using the 20-day smoothing constant equivalent, o.0555. The result is shown in the bottom panel of Figure 7.7 applied to Microsoft. The double-smoothed trendline is very smooth and the points at which the trends turn show less lag than any of the other methods. Trading signals should be generated from the trendline only - that is, buying when the trendline turns up and selling when it turns down. These methods are discussed in detail in
Chapter 8 under "TRIX" and in Chapter 9 under "Double Smoothing."
\section*{Adding Back the Smoothing Error}
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0579.jpg?height=125&width=144&top_left_y=325&top_left_x=65)
The single and double exponential smoothing methods, including error corrections, can be compared in a spreadsheet. A piece of that spreadsheet is shown in Table 7.7 and the entire spreadsheet is available on the Companion Website as TSM Comparison of exponentials MSFT. The methods are applied to Microsoft from August 1998 through February 2011. The smoothing constants, all 0.10, are shown in row 2. The first calculation in column C is the single exponential smoothing (Exp), followed by the double smoothing in column D (DblExp). The error for the single smoothing, the current price minus the corresponding exponential value, is in column E (Exp Err), followed by an exponential smoothing of those error values (Sm Err) in F. Column G shows the single exponential with the smoothed errors added back (Corr Exp). To see the difference in the single smoothing and the errorcorrected method, the last two columns indicate when the trends turn up or down based on the trendline changing direction. The error-corrected method (column \(\mathrm{G})\) is more sensitive to changing prices.
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0580.jpg?height=560&width=1327&top_left_y=63&top_left_x=63)
FIGURE 7.7 Double-smoothing applied to Microsoft, June 2010 through February 2011. (Top panel) The price of Microsoft along with an exponential double smoothing of 10 and 20 days. (Second panel) Blau's double smoothing of 20/20 days. (Third panel) Blau's smoothing of \(5 / 40\) days. (Bottom panel) The 5 -day difference before applying Blau's double smoothing of \(5 / 20\) days.
\section*{Regularization}
An interesting form of double smoothing is given by Mills and called exponential regularization. \(\underline{8}\)
\[
R E M A_{t}=\frac{R E M A_{t-1} \times(1+2 \times w)+\alpha \times\left(p_{t}-R E M A_{t-1}\right)-w \times R E M A_{t-2}}{1+w}
\]
where
\[
\begin{aligned}
p & =\text { price } \\
a & =\text { smoothing constant } \\
w & =\text { weighting factor }
\end{aligned}
\]
보Nominally, both \(\alpha\) and \(w\) are set to 9. A comparison of a 9-day standard exponential and the 9day exponential regularization is shown in Figure 7.8, applied to weekly S\&P data, 2007 through 2010. The regularized trendline is much smoother but also shows more lag. The program TSM Exponential Regularization can be found on the Companion Website.
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0581.jpg?height=645&width=1331&top_left_y=608&top_left_x=61)
FIGURE 7.8 Comparison of a 9-day exponential smoothing with a 9-day exponential regularization (the smoother line), applied to the weekly S\&P, 2007-2010.
\section*{Hull Moving Average}
A double-smoothed method that uses linearly weighted averages and modified calculation periods, all applied to weekly data, is the Hull Moving Average. 9 Beginning with the suggested period, \(p=16\) weeks, three weighted averages use the original period, the square root of the period, and half the period, with the goal of shortening
the net period and reducing the lag. The calculation can be written as:
\section*{WAVG1 \(=\) WAVG \((\) close,\(p)\)}
WAVG2 \(=\) WAVG \((\) close, \(\operatorname{INT}(p / 2))\)
\section*{HMA \(=\) WAVG \((2 *\) WAVG2 - WAVG1, INT(SQRT(p) \())\)}
where
close \(=\) weekly closing prices
\[
p=\text { calculation period }
\]
WAVG = linearly weighted average function (data series, period)
INT = integer portion function
SQRT = square root function
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0582.jpg?height=124&width=146&top_left_y=1165&top_left_x=64)
The 16-week HMA can be compared with a traditional double smoothing which uses a 20-week exponential smoothing followed by a 5 -week smoothing, as shown in Figure 7.9. Applied to the emini S\&P from December 2007 through July 2011, both of these are very similar (the HMA is the slower trend in the top panel and the double smoothed average is at the bottom). A double-smoothed 16 -week simple moving average is much more sensitive to price changes, as seen in the top panel. A program, TSM Hull Moving Average, can be found on the Companion Website.
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0583.jpg?height=645&width=1326&top_left_y=63&top_left_x=66)
FIGURE 7.9 The Hull Moving Average (slower trend in the top panel), compared with a double-smoothed 16week simple moving average (top panel) and a double smoothed exponential (20 and 5-week) at the bottom.
\section*{PLOTTING LAGS AND LEADS}
Moving averages, as well as any trend calculation, can be plotted with leads and lags, that is, forward or backward on a chart, each having a major impact on the interpretation. The conventional plot places the moving average value \(M A_{t}\) directly above or below the last price \(P_{t}\) used in the calculation. Any averaging or smoothing technique is said to be lagging actual price movement. When prices have been trending higher over the calculation period, the value \(M A_{t}\) will be lower than the most recent price \(P_{t}\); therefore, it will be plotted below the actual prices. When prices are declining, the trendline will be plotted above the prices.
Using a simple moving average as an example, the trend values can be plotted so they lead or lag the most recent price used in the calculation. If it is to lead by 4 days, the value \(M A_{t}\) is plotted four periods ahead on the chart, on day \(t+4\); if it is to lag by 2 days, it is plotted at \(t-2\). In the case of leading moving averages, the analysis attempts to compensate for the time delay by treating the average as an \(n\)-day-ahead forecast rather than a concurrent statement of direction. A penetration of the forecasted line by the price is used to signal a change of direction. The lag technique may serve the purpose of phasing the moving average, putting it in tune with a specific cycle. A 10-day moving average, when lagged by 5 days, will be plotted in the middle of the actual price data. This technique is used when finding the seasonal patterns of commodities. Figure 7.10 shows Microsoft with a simple 20-day moving average plotted 4 days ahead as well as 4 days lagged. The charting technique, Ichimoku Clouds, uses multiple lead plots.
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0585.jpg?height=825&width=1339&top_left_y=58&top_left_x=61)
FIGURE 7.10 Plotting a moving average lag and lead for a short period of Microsoft. The leading trendline is at the top, the lagging one at the bottom.
\section*{NOTES}
1 J.J. Payne, "A Better Way to Smooth Data," Technical Analysis of Stocks \& Commodities (October 1989).
\(\underline{2}\) Patrick E. Lafferty, "End-Point Moving Average," Technical Analysis of Stocks \& Commodities (October 1995).
3 Don Kraska, "Letters to S\&C," Technical Analysis of Stocks \& Commodities (February 1996), p. 12.
4 Robert T.H. Lee, Power Tools for Traders (Hong Kong: MegaCapital Limited, 1997).
5 Jack K. Hutson, "Filter Price Data: Moving Averages vs. Exponential Moving Averages," Technical Analysis of Stocks \& Commodities (May-June 1984).
6 Donald R. Lambert, "Exponentially Smoothed Moving Averages," Technical Analysis of Stocks \& Commodities (September-October 1984).
7 William Blau, Momentum, Direction, and Divergence (New York: John Wiley \& Sons, 1995).
\(\underline{8}\) Mark Mills, "Regularization," in "Traders' Tips," Technical Analysis of Stocks \& Commodities (July 2003).
9 "The Hull Moving Average," Technical Analyst (JulySeptember 2010).
\section*{CHAPTER 8 Trend Systems}
The previous chapters developed the tools for calculating trends - a traditional moving average, various weighted averages, exponential smoothing, and regression. To profit from identifying the trend requires trading rules and specific parameters that define the trend speed and an acceptable level of risk, among other factors. This chapter first discusses the rules that are necessary for all trading strategies and gives examples of actual systems. The selection of trend speed is handled only briefly here but is continued with a detailed analysis of these and other systems throughout the book, and especially in Chapter 21. It is most important to find trends that are robust - that is, ones that work across many markets and under varied economic conditions. At the same time, they must satisfy an investor's risk tolerance. It is a difficult balance.
Trend systems are the preferred choice of Commodity Trading Advisors (CTAs) and many hedge funds. Some advisors are reported to be using the same trend systems devised in 1980. CTA total assets under management reached a record \(\$ 343\) billion in 2017 , but a small part of the \(\$ 3.37\) trillion managed by all hedge funds. It attests to the long-term success of trend following.
\section*{WHY TREND SYSTEMS WORK}
Trend analysis is the basis for many successful trading programs, some with audited performance spanning nearly 40 years. Being able to identify the trend is also important if you are a discretionary trader looking to increase your chances for success by trading on "the right side of the market." Trend systems work because:
Long-term trends capture large price moves caused by fundamental factors. Economic trends are most often based on government interest rate policy, which is both slow to develop and incremental. In turn, interest rates directly affect foreign exchange, the trade balance, mortgage rates, carrying charges, and the stock market.
Persistence. Some stock price moves defy analysis. They continue to rise beyond any normal assessment of value. Only by staying with the trend could you capture the gains of Apple, Amazon, Tesla, and even Bitcoin. In the case of Bitcoin, extreme trends have been both up and down.
Prices are not normally distributed but have a fat tail. The fat tail refers to the unusually large number of directional price moves in many stocks and futures markets that are far longer than would be expected if prices were randomly distributed. Profits generated by the fat tail are essential to the longterm success of trend following.
Money moves the markets. Most trends are supported by the flow of investor funds. While this causes short-term noise, it also delivers the longterm trends. As trends become clearer, additional
money flows in to continue the trend.
Trend trading works when the market is trending. It doesn't work in markets that are not trending. There is no magic solution that will generate profits for trending strategies when prices are moving sideways, and there is no one trending technique that is always best. You'll find that most trending methods have about the same returns over time but with different risk profiles and different trading frequency.
\section*{How Often Do Markets Trend?}
Is there a way to measure how often markets trend? One analyst defines a trend as 10 consecutive closes in the same direction, but that seems arbitrary and a small window. What if there were 9 days up and one small down day?
A trend is a relative concept. It depends on the trader's time horizon and it is relative to the frequency and size of price swings that are acceptable to the trader.
Ultimately, a trend exists if you can profit from the price moves using a trending strategy.
\section*{The Fat Tail}
The fat tail is a statistical phenomenon caused by a combination of market fundamentals and supported by human behavior. The net effect is that prices move in one direction much longer than can be explained by a random distribution. As a simple example, consider coin flipping as a classic way to produce a random distribution. In 100-coin tosses:
50 will be a head or a tail followed by the opposite head or tail.
25 will be two heads or two tails in a row. \(12^{1 / 2}\) (if we could have halves tosses) will be 3 heads or 3 tails in a row.
About 6 will be 4 heads or 4 tails in a row.
About 3 will be 5 in a row.
1 or 2 will be 6 in a row of either heads or tails.
If price moves are substituted for coin flips, then heads would be a move up and tails a move down. If the pattern of up and down price moves follows a random distribution (and the up and down moves were of the same size), then it would not be possible to profit from a trend system. But prices are not normally distributed. Instead of one run of 6 out of 100 days of trading, we may see a run of 12 , or 3 runs of 6 .
These long runs can translate into very large trading profits. It is not necessary to have every day go in the same direction in order to profit, only that the downward reversals during an uptrend not be large enough to change the direction of the trend and end the trade. The more tolerance for the size of the interim reversals, that is, the more risk you are willing to take, the more likely the fat tail can be captured.
If there are more runs of longer duration for every 100 daily price moves, what is the shape of the rest of the distribution? Figure 8.1 gives a theoretical representation of an actual price distribution compared
to a random distribution. The extra movement that goes into creating the fat tail comes from the frequency of short runs. There are fewer runs of 1 and 2 and more runs greater than 6 . The total remains the same. Readers interested in this subject should read the section "Gambling Techniques: The Theory of Runs" in Chapter 22 .
\section*{Distribution of Profits and Losses}
As a trader, you would want to know, "How often is there a profit from a fat tail? To find the answer, we'll apply the most basic trending system, a simple moving average that buys when the trendline turns up and sells short when it turns down. This will be discussed in more detail in the next sections. For now, we need to know that results depend on both the market and the calculation period. Applying a simple 40 -day moving average strategy to five diverse futures markets, 30 -year bonds, the S\&P, the euro currency, crude oil, and gold, the results of individual trades can be collected and displayed as a histogram (frequency distribution). The results of the S\&P are shown in Figure 8.2.
\section*{Random versus Actual Price Distribution}
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0592.jpg?height=782&width=1325&top_left_y=146&top_left_x=64)
FIGURE 8.1 Distribution of runs. The shaded area shows the normal distribution of random runs. The solid dark line represents the distribution when there is a fat tail. In the fat tail distribution, there are fewer short runs and an unusually large number of longer runs or a single exceptionally long run.
In the frequency distribution, the bottom axis shows the starting value of the bins that hold the size of the profitable or losing trades, and the left scale shows the number of trades that fall into that bin. If the distribution was normal, then the shape would be a bell curve. This distribution is clearly extended far to the right, with one very large profit showing in the \(\$ 18,750\) bin . That one profit offsets 15 losses in the bar with the highest frequency, \(-\$ 1,250\). But the S\&P is not the only market with this distribution. Table 8.1 shows the
distribution sample, where bin \(1=-\$ 5,000\) and \(\operatorname{bin} 20=+\$ 18,750\). The tails to the right are very long and those to the left very short. It is important to remember that a pure trend strategy needs this distribution to be profitable.
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0593.jpg?height=740&width=1331&top_left_y=431&top_left_x=61)
Starting value of bin
FIGURE 8.2 Frequency distribution of returns for SP futures using a 40-day simple moving average strategy. Results show a fat tail to the right.
TABLE 8.1 Frequency distribution for a sample of five diverse markets, showing the fat tail to the right and a short tail to the left.
\begin{tabular}{|l|l|l|l|l|l|l|l|l|l|l|l|l|l|l|l|l|}
\hline Bin & \(\mathbf{1}\) & \(\mathbf{2}\) & \(\mathbf{3}\) & \(\mathbf{4}\) & \(\mathbf{5}\) & \(\mathbf{6}\) & \(\mathbf{7}\) & \(\mathbf{8}\) & \(\mathbf{9}\) & \(\mathbf{1 0}\) & \(\mathbf{1 1}\) & \(\mathbf{1 2}\) & \(\mathbf{1 3}\) & \(\mathbf{1 4}\) & \(\mathbf{1 5}\) & \(\mathbf{1 6}\) \\
\hline Bonds & \(\mathbf{0}\) & 2 & 8 & 17 & 53 & 27 & 6 & 3 & 2 & 3 & \(\mathbf{1}\) & \(\mathbf{0}\) & \(\mathbf{0}\) & \(\mathbf{1}\) & \(\mathbf{1}\) & o \\
\hline S\&P & \(\mathbf{2}\) & \(\mathbf{2}\) & 12 & 5 & 17 & 2 & 4 & 2 & 3 & 1 & 0 & 0 & \(\mathbf{1}\) & \(\mathbf{1}\) & 0 & 0 \\
\hline Euro & \(\mathbf{1}\) & \(\mathbf{0}\) & 4 & 7 & 26 & 75 & 20 & 2 & \(\mathbf{2}\) & 3 & \(\mathbf{1}\) & \(\mathbf{0}\) & \(\mathbf{2}\) & \(\mathbf{1}\) & \(\mathbf{1}\) & o \\
\hline
\end{tabular}
\begin{tabular}{|l|l|l|l|l|l|l|l|l|l|l|l|l|l|l|l|l|}
\hline Crude & O & 3 & 22 & 92 & 2 & 0 & 4 & o & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
\hline Gold & 0 & 1 & 4 & 8 & 20 & 70 & 16 & 4 & 0 & 2 & 0 & 3 & 0 & 0 & 0 & 0 \\
\hline
\end{tabular}
\section*{Time Intervals, Market Characteristics, and}
\section*{Trends}
Trends are most easily seen using long-term charts, weekly rather than daily data, or daily rather than hourly data. The farther you step back from a chart, the clearer the trend. If you display a daily chart, there will be some obvious trending periods and some equally clear sideways moves. Change that to a weekly chart and the trends will seem much clearer. Change that to an hourly chart and you'll see mostly noise. Lower frequency data translates into better performance when using longerterm trends. While there are always fast trends that show profits in back-testing, they tend to be less stable and inconsistent in their returns. Trends using longer calculation periods are more likely to track economic policy, such as the progressive lowering of interest rates by the central bank or a plan to allow the currency to weaken, which stimulates exports and reduces debt.
Market sectors differ in their trending qualities. Interest rate futures, money markets, and utility stocks are among the many investment vehicles closely tied to government rate policy and reflect the same long-term trend; this trend can persist for years. Foreign exchange is more complex and may be manipulated by monetary policy. Governments are more accepting of changes in the exchange rates if they occur slowly, but they will work hard to keep them within a target range. The Bank
of Japan has been known to intervene often, while the Swiss National Bank had only one spectacular intervention in January 2015, an attempt to stabilize the franc in front of a possible Greek financial crisis. Most foreign exchange markets show clear but shorter trends compared to interest rates.
\section*{Equities}
The stock market presents another level of difficulty. Individual stocks are driven by many factors, including earnings, competition, government regulation, management competence, and consumer confidence. Because the volume of trading in individual shares may vary considerably from day to day, these factors do not often net out as a clear trend. Stock prices may run up sharply on anticipation of better earnings or approval of a new drug and reverse just as quickly within a few days. Liquidity, or volume, is an important element in the existence of a steady trend.
Individual stocks are also affected by concurrent trading in the index markets. When the S\&P futures or the ETF SPY are bought and sold, all stocks within that index are bought and sold. If one company in the S\&P 500 has just announced the loss of a major contract, but the overall market is strong, the share price of the suffering company may be dragged higher by arbitrage due to massive buying of the S\&P index. This behavior makes for erratic price patterns in individual stocks. This individuality allows us to understand why Charles Dow created his indices, trying to bring order to chaos.
Emerging markets are the exception. The introduction of a new market, such as the fictitious East European Stock Index, would be lightly traded but may be very trending. Initial activity would be dominated by commercials, such as banks, all of which would have a similar opinion on the economy of Eastern Europe. As the general public starts to participate it adds liquidity while it also introduces noise, which in turn makes the trends less clear. Finding the trend then requires a longer time interval. Readers interested in this process should review the discussion of noise in Chapter 1.
When using a trending strategy, select both the markets and the time frame that work with you. Longer calculation periods, lower frequency data, and markets that are more closely linked to their underlying fundamentals will all perform better.
\section*{BASIC BUY AND SELL SIGNALS}
All trends lag the price movement. It is both the advantage and the disadvantage of the method. As the calculation period gets larger, the trend lags further. Figure 8.3 shows Amazon prices from April 2010 through February 2011 with a 40-day moving average. Clearly, the moving average is smoother than the prices because, on any day, only two of the values change. The lag exists because the value of the average is closest to the price 20 days ago, or half the length of the calculation period. But that value is plotted under today's price. When prices are going steadily up or down, the lag will be largest, as we see on the right side of Figure 8.3. It
is the lag that allows us to stay in a trade.
The most common way to trade a moving average is to be long when prices are above the average and short when below. The rules are:
- Buy when prices cross above the trendline.
- Sell short when prices cross below the trendline.
Even with these simple rules, there are important choices to be made. Do you buy at the moment rising prices cross the trendline during the trading session, or do you wait for the price to close above the trendline? As seen in Figure 8.3, prices may cross back and forth through the trendline before settling on a final direction. If you subscribe to the belief that the closing price of the day is the most reliable price, then the number of trading signals can be reduced by using the rules:
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0597.jpg?height=566&width=1329&top_left_y=1096&top_left_x=62)
FIGURE 8.3 Amazon (AMZN) with a 40-day moving average.
- Buy when prices close above the trendline.
- Sell short when prices close below the trend line.
Another school of thought prefers the average of high and low prices, or the average of the high, low, and closing prices. A buy or short sale signal occurs when the \((\) high + low \() / 2\) or \((\) hight + low + close \() / 3\) crosses above or below the current trendline value. In both of these cases, the averages could not be calculated until the end of the trading session because none of the three component values would be known until then.
\section*{Using the Trendline for Signals}
The purpose of the trendline is to smooth erratic price moves and uncover the underlying direction of prices. Then it seems more reasonable to use the trendline to generate the trading signal.
- Buy when the change in the trendline is up.
Sell short when the change in the trendline is down. The penalty for using the trendline as a trading signal is its lag. Figure 8.3 shows that, using a 40 -day moving average, prices cross above the trendline during July a few days ahead of the point where the trendline turns up. The benefit using the trendline as the signal is that there are far fewer false signals (as in July and November); therefore, it has a higher percentage of profitable trades and lower cost. As we will see later, using the price cross will be best for short-term trading and the trend direction for longer-term trading.
As an example, Table 8.2 shows five calculation periods for Amazon beginning with 5 days and doubling the period for each test. This maintains the percentage
change in the calculation period and gives a better distribution sample (this is discussed further in Chapter 21). The two columns headed Number of Trades shows that the trendline method has from \(26 \%\) to \(37 \%\) fewer trades and, for the most part, better performance. The Profit Factor is a performance ratio equal to the gross profits divided by the gross losses.
\section*{TABLE 8.2 Comparison of entry methods for 10} years of Amazon (AMZN). Signals using the trendline direction are shown on the left, and price penetration on the right.
\begin{tabular}{|l|l|l|l|l}
\hline & \multicolumn{2}{|c|}{ Signal Using Trendline } & \multicolumn{1}{c}{ Signal } \\
\begin{tabular}{l}
Trend \\
Calculation \\
Period
\end{tabular} & \begin{tabular}{l}
Total \\
Profit/Loss
\end{tabular} & \begin{tabular}{c}
Profit \\
Factor
\end{tabular} & \begin{tabular}{l}
Number \\
of \\
Trades
\end{tabular} & \begin{tabular}{l}
Total \\
Profit/L
\end{tabular} \\
\hline 80 & 48.24. & 1.34 & 84 & 57.16. \\
\hline 40 & .94 .42. & 1.46 & 120 & .32 .21. \\
\hline 20 & 111.97 & 1.45 & 196 & \((7.31)\) \\
\hline 10 & \((87.67)\) & 0.81 & 292 & \((90.82)\) \\
\hline 5 & \((90.31)\) & 0.84 & 439 & \((49.15)\) \\
\hline
\end{tabular}
Using the trendline for signals is better in all but the fastest trend. But the fast trends are not the best choice for tracking fundamental price moves. It is very possible that, for faster trading, the lag in the trendline is too much of a burden to overcome and the price penetration is better. This will be discussed further in Chapter 16, "Day Trading." It is always necessary to confirm the results by testing other markets.
\section*{Anticipating the Trend Signal}
Consistency is important. The system that is tested and the one that is traded should be the same. In this book the closing price is used for most of the calculations; however, any combination of open, high, low, and close could be substituted. The normal process for generating a trading signal is to wait until prices close, then calculate the new moving average or trendline value, then see whether a crossing occurred or the direction of the trendline changed according to the basic buy and sell rules. But using the closing price for the calculation of the entry signal means that you could not enter a new trade on the close, unless you can anticipate the signal; otherwise, you must execute the trade in the after-hours market or on the next open. That means your trading performance is not going to match the way you tested.
One solution to this dilemma is to capture the prices shortly before the close, generate the trading signals, then enter the buy and sell orders for execution on the close. Occasionally the order will be wrong because prices changed direction in the last few minutes of trading, but the cost of exiting the trade will usually be small compared to the improvement in overall execution. As a general rule, entering sooner is better.
The other alternative is to calculate, in advance, the closing price that will generate a signal using either the trendline method or the price crossing method. For an \(n\) day moving average the calculation is simple - the new moving average value will be greater than the previous value if today's price is greater than the price dropped off
\(n\)-days ago. Because all the other values in the average remain the same except for the first and last, the answer only needs those two values. If a 40-day average is used and the oldest price \(P_{t-40}\) was 30.25 , then any price greater than 30.25 today would cause the trendline to move up. Then an order can be placed shortly before the close to buy at 30.26 stop. There is more on projecting prices at the end of this chapter.
\section*{Not All Entries Should Be Anticipated}
How important is this? A lot depends on the trending nature of the market. In Chapter 1 the discussion of market noise showed that the short-term interest rates had the lowest amount of noise and the equity index markets had the most noise. Using the Eurodollar interest rates and S\&P 500 futures as extreme examples, the method that used the trendline signal was compared when entries were taken on the current close, the next open, and the next close to assess the sensitivity of the total profits to entry delays. Table 8.3 shows the results.
All but one of the Eurodollar results were more profitable entering sooner. Longer trend periods were generally more profitable, reflecting the fundamentals of government policy. This is also seen in the profit factors, which measure reward to risk rather than only total profits.
The S\&P favors waiting until the next close. In addition, short-term trends are not profitable. Both of these can be attributed to higher noise. Even after the sustained bull market that began after 2008, S\&P daily prices will
rarely move in the same direction three days in a row.
To help find which markets are best entering quickly and which should be delayed, review the section "Measuring Noise" in Chapter 1. It is a concept that has been applied to smart execution.
\section*{Profile of a Simple Moving Average System}
Using the moving average trendline as the basis for system signals, we chose an 8o-day calculation period because it represents a typical macrotrend system. The profile of results is typical of any moving average system. Figure 8.4 shows the NASDAQ 100 futures from March through June 2018. Buy and sell signals are generated from the direction of the trendline; there were no transaction fees.
TABLE 8.3 Comparison of entries on the close, next open, and next close. Based on 10 years of S\&P and Eurodollar interest rate futures, backadjusted, ending in February 2011.
Eurodollar Interest Rates
\begin{tabular}{l|l|l|l}
\hline Today's Close & Next Open & Next \\
\hline
\end{tabular}
\begin{tabular}{|c|c|c|c|c|c|}
\hline \begin{tabular}{|l|}
\hline Calculation \\
Period
\end{tabular} & \begin{tabular}{|c|}
\hline Total \\
Profit \\
or \\
Loss
\end{tabular} & Profit & \begin{tabular}{c}
Total \\
Profit \\
or \\
Loss
\end{tabular} & Profit & \begin{tabular}{|c|c|c|c|}
Total \\
Profit \\
or Loss
\end{tabular} \\
\hline 80 & 16150 & 2.87 & 16325 & 2.89 & 15630 \\
\hline 40 & 9603 & 1.61 & 9050 & 1.55 & 9383 \\
\hline 20 & 7745 & 1.37 & 6258 & 1.29 & 3850 \\
\hline
\end{tabular}
\begin{tabular}{|c|c|c|c|c|r|}
\hline 10 & 10773 & 1.40 & 8765 & 1.31 & 1165 \\
\hline .5 & 3368 & 1.09 & -1715 & 0.96 & -870 \\
\hline
\end{tabular}
\section*{S\&P 500}
\section*{Today's Close Next Open Next}
\begin{tabular}{|c|c|c|c|c|c|}
\hline \begin{tabular}{l}
Calculation \\
Period
\end{tabular} & \begin{tabular}{c}
Total \\
Profit \\
or \\
Loss \\
\hline
\end{tabular} & \begin{tabular}{l}
Profit \\
Factor
\end{tabular} & \begin{tabular}{c}
Total \\
Profit \\
or \\
Loss
\end{tabular} & \begin{tabular}{l}
Profit \\
Factor
\end{tabular} & \begin{tabular}{c}
Total \\
Profit \\
or Loss
\end{tabular} \\
\hline 80 & -12325 & 0.87 & -10463 & 0.89 & 16363 \\
\hline 40 & -29138 & 0.75 & -26013 & 0.78 & 5013 \\
\hline 20 & 13088 & 1.12 & 13900 & 1.13 & 22738 \\
\hline 10 & -27925 & 0.83 & -22738 & 0.86 & -12550 \\
\hline .5 & -21725 & 0.90 & -19588 & 0.91 & -56350 \\
\hline
\end{tabular}
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0603.jpg?height=592&width=1328&top_left_y=1125&top_left_x=65)
FIGURE 8.4 A trend system for NASDAQ 100 futures, using an 80-day moving average and taking the trading signals from the direction of trendline results.
The trading signals in Figure 8.4 show that a strong uptrend was captured with only a minor loss exiting and reentering in September. After a strong January 2018, prices increase in volatility and begin a sideways pattern. The trend system holds its long position until the beginning of May, when it gets a series of losing trades searching for a new trend.
The profile of this NASDAQ example, using data from 1998 through June 2018, is shown in Table 8.4. It is typical of longer-term trend-following systems and also shows the bullish bias of the U.S. equities market. Of the 210 trades over 20 years, only \(36 \%\) were profitable. Those profits and the profitable trades greatly favored the long positions.
\section*{TABLE 8.4 Performance statistics for NASDAQ futures, 1998 -June 2018.}
\begin{tabular}{|l|c|c|c|}
\hline & \begin{tabular}{c}
All \\
Trades
\end{tabular} & \begin{tabular}{c}
Long \\
Trades
\end{tabular} & \begin{tabular}{c}
Short \\
Trades
\end{tabular} \\
\hline Total Net Profit & \(\$ 1,584,665\) & \(\$ 1,868,520\) & \((\$ 283,855)\) \\
\hline Profit Factor & 1.47 & 2.22 & 0.85 \\
\hline Roll Over Credit & \(\$ 0.00\) & \(\$ 0.00\) & \(\$ 0.00\) \\
\hline Open Position P/L & \(\$ 0.00\) & \(\$ 0.00\) & \(\$ 0.00\) \\
\hline \begin{tabular}{l}
Total Number of \\
Trades
\end{tabular} & 201 & 101 & 100 \\
\hline Percent Profitable & \(36.32 \%\) & \(46.53 \%\) & \(26.00 \%\) \\
\hline \begin{tabular}{l}
Avg. Trade Net \\
Profit
\end{tabular} & \(\$ 7,884\) & \(\$ 18,500\) & \((\$ 2,839)\) \\
\hline Avg. Winning & \(\$ 67,844\) & \(\$ 72,226\) & \(\$ 59,921\) \\
\hline
\end{tabular}
\begin{tabular}{|l|c|c|c|}
\hline Trade & & & \\
\hline Avg. Losing Trade & \((\$ 26,312)\) & \((\$ 28,261)\) & \((\$ 24,889)\) \\
\hline \begin{tabular}{l}
Ratio Avg. \\
Win:Avg. Loss
\end{tabular} & 2.58 & 2.56 & 2.41 \\
\hline \begin{tabular}{l}
Consecutive \\
Winning Trades
\end{tabular} & 5 & 5 & 3 \\
\hline \begin{tabular}{l}
Consecutive Losing \\
Trades
\end{tabular} & 11 & 5 & 12 \\
\hline \begin{tabular}{l}
Avg. Bars in \\
Winning Trades
\end{tabular} & 47.3 & 54.11 & 35 \\
\hline \begin{tabular}{l}
Avg. Bars in Losing \\
Trades
\end{tabular} & 10.09 & 11.06 & 9.38 \\
\hline
\end{tabular}
Of added interest are the number of bars in the winning and losing trades. Again, this shows a strong upward bias in prices, even though the 20 years included the disastrous NASDAQ "dot.com" sell-off in 2000 and the financial crisis in 2008. The average winning trade was held 47 days and the losing trades held 10 days. This supports the trend-following adage "cut your losses and let your profits run." The performance picture is that trend following gets in and out quickly when it has a loss but holds the trades whenever trends and profits develop. This category of strategy is called conservation of capital.
We can generalize the moving average trend-following profile as:
- The percentage of profitable trades is low - about \(35 \%\).
- The average winning trade must be significantly larger than the average losing trade; given only \(35 \%\) profitable trades, the ratio must be greater than 10:3.5 to be profitable.
The average winning trades are held much longer than losses.
Because there is a high frequency of losing trades, there are also long sequences of losing trades.
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0606.jpg?height=124&width=144&top_left_y=616&top_left_x=65)
There are many analysts trying to improve these statistics; that is, capturing the long-term trend by trading pieces of it. But doing that will change the risk characteristics of trend-following systems. For example, if you add profit-taking or stop-losses (Chapter 23), then you reduce or eliminate the chance of capturing the fat tail, which will be necessary for a long-term profit. Still, many traders do not like the idea of holding the trades for such a long time and giving back so much of the unrealized profits when the major trend changes direction. Different traders make different choices.
Other trending methods, such as a breakout, will have different profit and risk profiles. It is always best to know the alternatives first. A program to test the trend method, entry rules, and execution options, including long-only, is TSM Trends, available on the Companion Website.
\section*{Timing the Order}
The timing of execution orders when following a system
will affect its results over the long term. The use of a simple trend system or one with a band (discussed in the next section) will identify a change of trend, but it is also a point of uncertainty. Buying or selling at the exact time of the new trading signal often places the trader in a new trend at a loss, especially if the market is noisy. In an attempt to overcome these problems, a number of rules can be used:
- If the trade is triggered by an intraday signal, wait until the close to execute the order.
- Buy (or sell) on the next day's open following a signal on the close.
Buy (or sell) with a delay of 1,2 , or 3 days after the signal.
Buy (or sell) after a price retracement of \(50 \%\) of the daily range (or some other value) following a signal.
Buy (or sell) when prices move to within a specified risk level relative to a reversal or exit point.
The object is to enter a new position and see an immediate profit, or reduced risk. Some of these rules can be categorized as timing and others as risk management. If intraday prices are used to signal new entries and exits, a rule may be added that states:
Only one order can be executed in one day: either the liquidation of a current position or an entry into a new position.
While better entry points will improve overall performance, an entry rule that is contingent on price
action, such as a pullback, risks the possibility of not entering at all. A contingent order that is missed is guaranteed to be a profitable trade. It might be better to combine the entry order, for example:
\section*{Buy (or sell) after prices reverse by \(0.50 \times\) ATR or enter on the next close.}
Once you have decided on a timing rule, you must test it carefully. The perception of improvement does not always live up to expectations. In tests of trend-following systems conducted over many years, positions calculated on the close but delayed until the next open improved execution prices about \(75 \%\) of the time but resulted in smaller overall total profits. Why? Fast breakouts that never retrace result in missed trades. Therefore, while three out of four executions returned a better price by a small amount, those improvements were often offset by the profitable breakouts that were never entered.
\section*{BANDS AND CHANNELS}
A good way to improve the reliability of signals without altering the overall trend profile is by constructing a band, or channel, around the trendline. It can be used to effectively slow down trading without sacrificing the biggest profits and gives the trend time to develop. The time of trend change is also the time of greatest indecision.
\section*{Bands Formed by Highs and Lows}
The most natural band is one formed from the daily high
and low prices. Instead of applying the \(n\)-day moving average to the closing prices, it is applied separately to the highs and lows. Long positions are entered when today's high crosses the average of the highs and short sales when today's lows cross the average of the lows. To get a broad view of whether this is an improvement to entry points, the two most extreme markets (the Eurodollar considered the trendiest and the S\&P the noisiest) are tested for the volatile 10 years from 2001 through 2011 with the five calculation periods used in an earlier example. Results are shown in Table 8.5.
TABLE 8.5 Results of using a moving average of the highs and lows, compared to the closes.
\section*{Eurodollar Interest Rates}
Close
High-Low
Close Cri
\begin{tabular}{|c|c|c|c|c|c|}
\hline \begin{tabular}{|l|}
\hline Calculation \\
Period
\end{tabular} & \begin{tabular}{|c|}
\hline Total \\
Profit \\
or \\
Loss \\
\hline
\end{tabular} & Profit & \begin{tabular}{|c|}
\hline Total \\
Profit \\
or \\
Loss
\end{tabular} & Profit & \begin{tabular}{c}
Total \\
Profit \\
or Loss
\end{tabular} \\
\hline 80 & 16320 & 2.94 & 13842 & 2.18 & 30027 \\
\hline 40 & 16035 & 2.18 & 15000 & 2.02 & (10337) \\
\hline 20 & 10172 & 1.44 & 5167 & 1.20 & 5987 \\
\hline 10 & 2727 & 1.08 & 3667 & 1.11 & (49000) \\
\hline 5 & 7812 & 1.20 & (337) & 0.99 & (106950) \\
\hline
\end{tabular}
For a highly trending market, such as the Eurodollar interest rates, entering later on a penetration of either the highs or lows is not as good as entering on a price
penetration of the close. Just the opposite is seen in the S\&P results. Waiting longer to enter improves results noticeably and, in the case of the 40-day trend, it turns a loss into a profit.
We can conclude that a band can be a profitable variation to a simple trend system, but not for all markets. The next question is, "Are there other bands that work better?"
\section*{Keltner Channels}
One of the original band calculations was by Keltner, \({ }^{1}\) which goes as follows:
\[
\begin{array}{ll}
\text { (Average daily price) } & A P_{t}=\left(H_{t}+L_{t}+C_{t}\right) / 3 \\
\text { (10-Day moving average) } & M A_{t}=\operatorname{average}\left(C_{t}, 10\right) \\
\text { (Upper band) } & U B_{t}=M A_{t}+A P_{t} \\
\text { (Lower band) } & L B_{t}=M A_{t}+A P_{t}
\end{array}
\]
It would be best to substitute the true range, rather than the high-low range, as a better measure of volatility.
\section*{Percentage Bands}
Another simple construction is a percentage band, formed by adding and subtracting the same percentage of price from a trendline based on the closing prices. If \(c\) is the percentage to be used (where \(c=0.03\) means \(3 \%)\), then:
\section*{(upper band) \(B_{U}=(1+c) \times M A_{t}\) \\ (lower band) \(\quad B_{L}=(1-c) \times M A_{t}\)}
where
\section*{\(M A_{t}=\) today's moving average value.}
Therefore, if the moving average value for Merck (MRK) is \(\$ 33\), and the band is \(3 \%\), then the upper band is 33.99 and the lower band is 32.01 . Because the moving average is much smoother than the price series, the band will be uniform around the moving average, narrowing and widening slightly as prices decline and rise.
The band can be more sensitive to change if the current price \(P_{t}\) is used to calculate the band instead of the moving average trendline. The bands are then:
\[
\begin{array}{ll}
(\text { upper band }) & B_{U}=(1+c) \times p_{t-1}+M A_{t} \\
(\text { lower band }) & B_{L}=(1-c) \times p_{t-1}+M A_{t}
\end{array}
\]
The band is still centered around the moving average trendline to give it stability. In both cases above we used the current moving average value and price, which will be applied to the next day's price. Remember that percentages can't be used for back-adjusted futures.
Avoid using a fixed value, such as a \(\$ 1\) band. That would make it very sensitive at higher prices and less sensitive at lower prices.
\section*{Volatility Bands}
Trying to put rules to volatility can be difficult. In general, stock prices are more volatile when they are low while commodity price volatility remains about the same. Yet both markets can be quiet or volatile for weeks at a time. By constructing a band that changes with volatility, we attempt to keep the sensitivity of the trend signals the same.
Most bands need to be scaled. Scaling is accomplished by using a constant value or scaling factor as a multiplier to increase or reduce the sensitivity of the band. If \(s\) is a scaling factor and \(c\) is a fixed percentage, then the following bands can be constructed:
\[
\begin{array}{ll}
B_{t}=M A_{t} \pm c \times M A_{t} & \text { (percentage of trendline) } \\
B_{t}=M A_{t} \pm c \times P_{t} & \text { (percentage of price) } \\
B_{t}=M A_{t} \pm s \times A T R_{t} & \text { (average true range) } \\
B_{t}=M A_{t} \pm s \times s t d e r_{t} & \text { (standard deviation of ret }
\end{array}
\]
(standard deviation of returns or differences)
When \(s=1\), the full band is equal to \(2 \times\) ATR or \(2 \times\) stdev \(\cdot M A\) was used to indicate a moving average, but any method of calculating the trend can be substituted, such as an exponential smoothing or a regression. Figure 8.5 shows the four types of bands applied to the S\&P futures. All use a scaling factor of 2, which may be too close for some methods and too far for others. The ATR and stdev are based on 20 days. When using futures, the standard deviation uses price
differences instead of returns. The purpose of the chart is to show the relative shape of the bands and distance from the prices.
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0613.jpg?height=562&width=1327&top_left_y=272&top_left_x=63)
FIGURE 8.5 Four volatility bands around a 20-day moving average, based on (a) \(2 \%\) of the trendline, (b) \(2 \%\) of the price, (c) 2 x average true range, and (d) annualized 20 -day volatility.
In Figure 8.5 the center line is a 20-day moving average. The first two methods of calculating bands, the percentage of trendline and percentage of price, are almost identical, very smooth, and are the farthest from the center. The next band closer to the moving average is the average true range. It moves slightly farther apart when prices are more volatile. The band closest to the trendline is the standard deviation, which is more sensitive to price volatility. Because the same scaling factor produces bands that are different for each method, their benefits are difficult to compare. By changing the scaling factors, we might make them all look alike.
It may be convenient to have separate exit and entry
bands, the entries less sensitive than the exits so that the strategy exits quickly but enters slowly. Or, if the entry occurs on a penetration of the band, but the exit is based on the trendline, then trades are not reversed from long to short. That improves slippage because only half the number of shares or contracts are traded on each order and some false signals may be avoided. When trading, be sure to use yesterday's trend calculations with today's prices to get a signal.
\section*{An Adaptive Band for Mean Reversion}
Developed by Lee Leibfarth in 2006, this method creates a band using a double-smoothed exponential that works well for identifying mean-reversion trades. \(\underline{\underline{2}}\) Volatility is measured using an adaptive range, the 5-day EMA of the 5-day EMA of the daily high minus the daily low. Figure 8.6 shows that the bands, called the Adaptive Price Zone (APZ), touch the highs and lows when volatility increases, providing an opportunity for a mean-reversion trade.
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0614.jpg?height=596&width=1332&top_left_y=1327&top_left_x=63)
FIGURE 8.6 Adaptive bands constructed using double exponential smoothing shows points where a meanreversion trade can be entered.
\section*{Bollinger Bands}
Both the ATR and the standard deviation of returns or price differences provide the best measures of volatility. The most common calculation period is 20 days. John Bollinger has popularized the combination of a 20-day moving average with bands formed using 2 standard deviations of the price changes over the same 20-day period. They are frequently called Bollinger bands. \({ }^{3}\) Because the standard deviation represents a confidence level, and prices are not normally distributed, the choice of two standard deviations equates to an \(87 \%\) confidence band (if prices were normally distributed, two standard deviations would contain \(95.4 \%\) of the data). Bollinger bands are combined with other techniques to identify extreme price levels. These are discussed later in this section.
Figure 8.7 shows Ford (F) plotted with a traditional Bollinger band. One of the characteristics of this band is that, once the price moves outside either the upper or lower band, it remains outside for a number of days in a row. This type of pattern was typical of what used to be called high momentum. Note that the width of the band varies considerably with the volatility of prices and that a period of high volatility causes a "bubble," which extends past the period where volatility declines. These features and more about volatility will be discussed in Chapter 20.
Figure 8.7 was created using the TradeStation indicator Bollinger Bands, which lets you vary both the calculation period for the trend and the number of standard deviations. But then, if it's not a 20-day average and 2 standard deviations, it's not a Bollinger band.
Bollinger bands can also be applied effectively to multiple time frames. An excellent example that uses a combination of weekly and daily data applied to the S\&P 500 is seen in Figure 8.8. The price pattern follows the weekly Bollinger band higher, where the daily and weekly prices come together during the week of July 14.
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0616.jpg?height=570&width=1329&top_left_y=775&top_left_x=64)
FIGURE 8.7 Bollinger bands applied to Ford.
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0617.jpg?height=1095&width=1327&top_left_y=62&top_left_x=63)
FIGURE 8.8 Combining daily and weekly Bollinger bands.
Source: Chart created using The Fibonacci Trader, by Robert Krausz. Used with permission from Fibonacci Trader Corporation, St. Augustine, FL, www.fibonaccitrader.com.
\section*{Modified Bollinger Bands}
One of the significant problems with Bollinger bands, as well as any volatility measure based on historic data, is that the bands will expand after increasing volatility but are slow to narrow as volatility declines. An excellent correction \({ }^{4}\) for this requires the following calculations
for the center line, \(D\) :
\[
\begin{aligned}
M_{t} & =\alpha \times C_{t}+(1-\alpha) \times M_{t-1} \\
U_{t} & =\alpha \times M_{t}+(1-\alpha) \times U_{t-1} \\
D_{t} & =\frac{(2-\alpha) \times M_{t}-U_{t}}{1-\alpha}
\end{aligned}
\]
where \(C\) is the closing price and \(\alpha\) is the smoothing constant, set to 0.15 to approximate a 20 -day moving average. To correct the bulge in the bands following a volatile period, the upper and lower bands ( \(B U\) and \(B L\) ) are calculated as:
\[
\begin{aligned}
m_{t} & =\alpha \times\left|C_{t}-D_{t}\right|+(1-\alpha) \times m_{t-1} \\
u_{t} & =\alpha \times m_{t}+(1-\alpha) \times u_{t-1} \\
d_{t} & =\frac{(2-\alpha) \times m_{t}-u_{t}}{1-\alpha} \\
B U_{t} & =D_{t}+f \times d_{t} \\
B L_{t} & =D_{t}-f \times d_{t}
\end{aligned}
\]
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0618.jpg?height=126&width=146&top_left_y=1707&top_left_x=66)
where \(f\) is the multiplier for the width of the band, suggested at 2.5 compared to Bollinger's 2.0. Figure 8.9 shows the modified Bollinger bands along with the
original (lighter lines) for gold futures during the first part of 2009. While the new bands do not remove the bulge, they are faster to correct and more uniform in the way they envelop prices. Programs to calculate and display the original and modified bands are TSM
Bollinger bands and TSM Bollinger Modified, available on the Companion Website.
\section*{Rules for Using Bands}
Regardless of the type of band that is constructed, rules for using bands to generate trading signals are similar. The first decision to be made is whether trading strategy is a reversal strategy, changing from long to short and back again as the bands are penetrated. If so, the following rules apply:
- Buy (close out shorts and go long) when the prices close above the upper band.
- Sell short (close out longs and go short) when the prices close below the lower band.
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0619.jpg?height=640&width=1323&top_left_y=1315&top_left_x=65)
FIGURE 8.9 Modified Bollinger bands shown with original bands (lighter lines), applied to gold futures, February-August 2009.
Buy when prices move up through band
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0620.jpg?height=732&width=1109&top_left_y=270&top_left_x=281)
FIGURE 8.10 Simple reversal rules for using bands.
This technique is always in the market with a maximum risk equal to the width of the band, which changes each day (see Figure 8.10). Alternatively, you may prefer to exit from each trade when prices cross the trendline midway between the bands.
- Buy (go long) when prices close above the upper band. Close out longs when prices reverse and close below the moving average trendline (the center of the band).
- Sell short when prices close below the lower band. Cover your shorts when prices close above the moving average trendline.
The band is then used to enter into new long or short
trades, and the trendline at the center of the band is used for liquidation. If prices are not strong enough to penetrate the opposite band on the close of the same day, the trade is closed out but not reversed. The next day, penetration of either the upper or lower band will signal a new long or short trade, respectively. If you are trading a trending market, then using the high of the day for the longs and the lows for the shorts should produce some extra profits.
This technique allows a trade to be reentered in the same direction in the event of a false trend change. If a pullback occurs after a close-out while no position is being held (as shown in Figure 8.11), an entry at a later date might be at a better price. It also reduces the order size by \(50 \%\), which is likely to improve the execution price and add liquidity for large traders.
Using the trendline as an exit, risk is limited to half of the full band width. If the bands are narrow, there is a greater chance that an entry on an intraday high might also see an exit below the trendline on the close of the same day.
\section*{The "Squeeze"}
Bollinger band squeeze is a variation on compression but measures the narrowing of the Bollinger bands. Wait until the Bollinger band compresses to some percentage of the average, for example, \(50 \%\), then buy or sell a new breakout through the bands. Compression has a history of success as a filter and trading on the same side as the trend often shows an improvement in performance. 5
\section*{Bollinger on Bollinger Bands}
While most trading strategies buy when there is an upward penetration of the top band and sell when prices move below the lower band, the use of Bollinger bands is usually mean-reverting, or counter to the price direction. This can be risky, especially when prices are volatile. To reduce this risk, Bollinger recommends confirming a downside penetration using other indicators, primarily those based on volume and market breadth. If prices are moving lower but volume is not increasing, and negative breadth is not confirming the downward move, then a buy signal is realistic. 6
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0622.jpg?height=960&width=1329&top_left_y=852&top_left_x=64)
FIGURE 8.11 Basic rules for using bands.
Bollinger uses the concept that volatility is cyclic, but
without a regular period. He sees very low volatility as a forecast for high volatility and very high volatility forecasting low volatility, similar to the way traders use VIX, the CME Volatility Index. He calls this "extreme seeking." Based on this, a major price rally with dramatically higher volatility, which expands the bandwidth to extremes, should be sold when the bandwidth begins to narrow. This only applies to upward price moves.
\section*{Combining Bollinger with Other Indicators}
Williams \({ }^{7}\) suggests that other indicators can be combined to capture volatile moves after a price contraction:
1. A standard 20-day, 2 standard deviation Bollinger band
2. A 20-day Keltner Channel
3. A 21-day Chaikin Oscillator to monitor the flow of funds
To enter a long position, the following conditions must be satisfied:
- The Bollinger bands narrow so they are fully inside the Keltner Channel while the Chaikin oscillator is below zero.
■ The Chaikin Oscillator crosses above the zero line. For short sales:
- The Bollinger bands narrow so they are fully inside the Keltner Channel while the Chaikin oscillator is
above zero.
- The Chaikin Oscillator crosses below the zero line.
\section*{The Compromise between Reliability and Smaller Profits}
As with most trading techniques, the benefits of one approach can also have negative factors. The use of a band around a trendline improves the reliability of the trading signal and reduces the total number of signals. The wider the band, the fewer signals. Both of these characteristics are significant benefits. But wider bands mean delayed entries; therefore, you cannot capture as much of the trend and the average profits will be smaller. If the bands are too wide, then profits can disappear. The use of wider bands also means greater risk on each trade. It will be necessary to trade smaller positions or capitalize the account with a larger investment.
These are serious choices that must be made with every trading program. Although there are classic solutions to this problem discussed in Chapters 23 and 24, traders must choose the methods that complement their risk preference.
\section*{CHOOSING THE CALCULATION PERIOD FOR THE TREND}
For any trend technique, the selection of the calculation period - the interval over which you will define the trend - is the most important decision in the ultimate success of the trading system. Entry rules, profit-taking, and
volatility filters are improvements, but will rarely change a losing trend into a profitable one. Deciding the calculation period is more important than the method of identifying the trend. You can be profitable using a simple moving average, regression, breakout, or any other technique - if you can settle on the right calculation period.
The previous sections have used examples of calculation periods without any claim that one interval was better than another. We have discussed that the long-term trend tracks government interest rate policy or economic growth; therefore, there is good reason to choose a longer calculation period. We also saw that the trends were clearer when looking at a weekly chart rather than daily, and it was not clear that an intraday chart had any persistent trends. But for most traders, the risks associated with using a longer time frame are unacceptable; they prefer smaller profits and smaller losses associated with faster trading. Most strategy development software makes it easy to test a range of calculation periods to find the one that performed best in the past. This technique is called optimization and is discussed in Chapter 21. But the power of the computer is not always as good as human reasoning and common sense. The computer is best for validating an idea, not for discovering one.
Before the computer, analysts struggled with the same problem of finding the best calculation period. At first the trend period was based on multiples of calendar periods, such as a week or a month, expressed as trading days. Before 1980, these approaches were very
successful. Many traders still subscribe to the idea that certain time intervals have intrinsic value. The most popular calculation periods have been: 3 days, the expected duration of a short price move; 5 days, a trading week; 20 to 23 days, a trading month; 63 days, a calendar quarter; and of course, 252 days, a calendar year. Implied volatility calculations traditionally use 20 days. It is not clear where the 200-day moving average, used for stocks, came from, but even numbers have always been popular.
More recently, a class of adaptive trends has appeared. These attempt to change the speed of the trend based on a characteristic of price movement, such as volatility or noise. These techniques are another alternative to optimization and are discussed in Chapter 17.
\section*{A FEW CLASSIC SINGLE-TREND SYSTEMS}
The following section includes classic examples of wellknown systems that use a single trend.
\section*{A Simple Momentum System}
In Chapter 7 the \(n\)-day momentum was defined as the change in price over \(n\) days. The simplest trend system is the one that buys when the \(n\)-day change is positive and sells when the \(n\)-day change is negative. For large values of \(n\), the results will be surprisingly similar to a simple moving average system using the same entry and exit rules; therefore, we will not give examples here. Keep in
mind that momentum can be effective even as it is very simple.
\section*{A Step-Weighted Moving Average}
In 1972, Robert Joel Taylor published the "Major Price Trend Directional Indicator" (MPTDI), which was reprinted in summary form in the September 1973 Commodities Magazine (now Modern Trader). The system was tested in 1972 on historical data provided by Dunn and Hargitt Financial Services in West Lafayette, Indiana. It was one of the few well-defined published systems and served as the basis for much experimentation.
MPTDI is a moving average with a band. Its unique feature is that the calculation period and band width changed based on price volatility, defined as the current trading range. Because the method has distinct trading range thresholds (called steps), the method is called a step-weighted moving average. It is unique in its complete dependence on incremental values for all aspects of the system: the moving average, entry, and stop-loss points. For example, Table 8.6 shows what conditions might be assigned to gold.
\section*{TABLE 8.6 MPTDI Variables for gold.*}
\begin{tabular}{|l|c|c|c|c|}
\hline \begin{tabular}{l}
Average \\
Trading \\
Range
\end{tabular} & \begin{tabular}{c}
Number of \\
Days in \\
Calculation
\end{tabular} & \begin{tabular}{c}
Weighting- \\
Frogrestors
\end{tabular} & \begin{tabular}{c}
Entry \\
Signal
\end{tabular} & AI \\
\hline \(50-150\) & \(2-5\) days & TYPE A & 100 pts & \\
\hline \(150-250\) & 20 days & TYPE B & 200 pts & \\
\hline
\end{tabular}
\begin{tabular}{|l|c|c|c|c}
\hline \(250-350\) & 15 days & TYPE C & 250 pts & \\
\hline \(350-450\) & 10 days & TYPE D & 350 pts & \\
\hline \(450+\) & .5 days & TYPE E & 450 pts & \\
\hline
\end{tabular}
\({ }_{-}^{*} 100\) points \(=\$ 1\) per ounce.
If gold were trading in an average range of 250 to 350 points each day ( \(\$ 2.50\) to \(\$ 3.50\) per ounce, but remember this was 1972), the weighting factor for the moving average would be TYPE C, indicating medium volatility (TYPE A is lowest). Using TYPE C with a 15 -day moving average, the most recent 5 days are given the weight 3 , the next 5 days 2 , and the last 5 days are weighted by 1 . The entry signals use the corresponding penetration of 250 points above the moving average for a buy and 250 below for a sell. The intraday highs or lows are used to trigger the entry based on values calculated after the close of trading on the prior day. A stop-loss is fixed at the time of entry equal to the value on the same line as the selected volatility. The penetration of the stop-loss will cause the liquidation of the current trade. A new signal in the reverse direction will serve as both the exit for the current trade and the entry for a new trade.
There is a lot to say in favor of the principles of MPTDI. It is individualized with respect to markets and selfadjusting to changing volatility. Prices are step-weighted, given more importance to more recent data. The stoploss limits the risk of the trade. The fixed risk differs from moving averages using bands based on volatility because they back away as volatility increases. But there
are some rough edges to the system. The incremental ranges for volatility, entry points, and stops seem to be a crude measure. Even if they are accurate in the center of the range, they must get less accurate at the extremes where volatility causes an abrupt change in parameter values when it moves from one range to another.
MPTDI sets the groundwork for a smoother, more adaptive process. Before such a process can be developed, however, it is necessary to study price movement at discrete levels, such as those shown in MPTDI. From discrete relationships it is possible to generalize a continuous relationship. These adaptive methods are covered in Chapter 17.
\section*{The Volatility System}
Another method that includes volatility and is
computationally simple is the Volatility System. \({ }^{8}\) It is an early use of the average true range (ATR). Signals are generated when a price change is an unusually large move relative to the ATR, calculated over \(n\) days as:
\[
A T R_{t}=\frac{1}{n} \sum_{\mid=1=n+1} T R_{l}
\]
where \(T R_{i}\) is the true range on day \(i\). The average true range was defined in Chapter 5. For a calculation period of \(n\) days, the trading rules are given as:
Sell if the close drops by more than \(k \times \mathrm{ATR}_{t-1}\) from the previous close.
Buy if the close rises by more than \(k \times \mathrm{ATR}_{t-1}\) from the previous close.
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0630.jpg?height=122&width=142&top_left_y=228&top_left_x=66)
The value of \(k\) is generally about 2.0 . There are few trades but high reliability. What is particularly interesting about the volatility system is that the trend is defined only by a large move. When there is a price shock, the following movement is in the direction of the shock. You can test this using TSM Volatility System on the Companion Website.
\section*{The 10-Day Moving Average Rule}
The most basic application of a moving average system was proposed by Keltner in his 1960 publication, How to Make Money in Commodities. His choice of a moving average calculation period was based solely on experience. The system itself is simple, a 10-day moving average applied to the average of the daily high, low, and closing prices, with a band on each side formed from the 10-day moving average of the high-low range (similar to a 10-day average true range). A buy signal occurs when the price crosses above the upper band and a sell signal when the price crosses below the lower band; positions are always reversed.
The 10-Day Moving Average Rule is an early example of a volatility band. Keltner preferred this particular technique because it identifies minor rather than medium- or long-term trends, and there are some performance figures that substantiate his conclusion. A side benefit to the selection is that the usual division
required by a moving average calculation can be substituted by a simple shift of the decimal place; in an era before the pocket calculator, who knows how much impact that convenience had on Keltner's choice?
The price history now shows us that price movement was much smoother up to the end of the 1970s and has been getting noisier ever since. A 10-day moving average, supplemented by a volatility band, was truly the state-ofthe-art technology. While the shorter calculation periods are not generally successful for current price moves, the use of volatility to create bands has held up well over time.
\section*{TRIX , Triple Exponential Smoothing}
A triple exponential smoothing technique that was first described by Hutson \({ }^{9}\) has gained popularity over the years. Called TRIX, it first takes the natural log of the price to account for growth and then applies an exponential smoothing three times using the same smoothing constant. A buy signal is generated when the triple-smoothed trendline rises for two consecutive days; a sell signal occurs when the trendline falls for two days in a row. The exponential smoothing process usually starts by setting the initial trend value to the current price, \(E 1_{0}=P_{0}\), but in this case \(E 1_{0}=\ln p_{0}\). The rest of the process is:
\[
\begin{aligned}
E 1_{t} & =E 1_{t-1}+s \times\left(\ln p_{t}-E 1_{t-1}\right) \\
E 2_{t} & =E 2_{t-1}+s \times\left(E 1_{t}-E 2_{t-1}\right) \\
E 3_{t} & =E 3_{t-1}+s \times\left(E 2_{t}-E 1_{t-1}\right) \\
T R I X & =\left(E 3_{t}-E 3_{t-1}\right) \times 10000
\end{aligned}
\]
This original approach has seen some variations over the years. The most significant is not using the natural log of prices but changing the final step to a percentage change. The percentage change at the end speeds up the process. The smoothing constant should represent a short time period, between 3 and 20 days but recommended as 6 days. The number of days is converted to a smoothing constant using \(s=2 /(n+1)\). The alternative calculation is:
\[
\begin{aligned}
E 1_{t} & =E 1_{t-1}+s \times\left(p_{t}-E 1_{t-1}\right) \\
E 2_{t} & =E 2_{t-1}+s \times\left(E 1_{t}-E 2_{t-1}\right) \\
E 3_{t} & =E 3_{t-1}+s \times\left(E 2_{t}-E 1_{t-1}\right) \\
T R I X_{t} & =\left(E 3_{t}-E 3_{t-1}\right) / E_{t-1}
\end{aligned}
\]
A signal line is created by taking the 3 -day moving average of the TRIX values. A buy occurs when TRIX crosses above the signal line and a sell when it crosses below the signal line. Using a signal line is a technique
that will be seen with other momentum indicators, such as the MACD.
A 9-day TRIX is shown in the lower part of Figure 8.12 corresponding to the price of euro currency futures in 2013. The final step that takes the difference between the current and previous TRIX value removes the lag that would be expected, yet it is still reasonably smooth. Price peaks and TRIX peaks are nearly at the same place. The effect of the weighting on price data caused by double and triple smoothing was discussed in Chapter 7.
Readers who are interested in similar methods should refer to Blau's True Strength Index and True Directional Movement.
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0633.jpg?height=584&width=1327&top_left_y=903&top_left_x=63)
FIGURE 8.12 A 9-day TRIX based on euro futures shows that a triple smoothing does not create the lag that would be expected.
\section*{COMPARISON OF SINGLE-TREND SYSTEMS}
Trend strategies dominate the world of algorithmic trading and managed futures in particular. But which method is the best? There are many rules that can be added to a basic trend strategy, including stop-losses, profit-taking, and entry timing, that change both the return and the risk profile. There are cases where an underlying losing strategy can be turned profitable by risk management or clever timing rules; however, it is always best to start with a sound trend-following method that is profitable without add-ons and has the risk characteristics most acceptable to you.
This chapter will not draw conclusions about which trending method is best. It may be that there is no best strategy, only trade-offs between risk and reward, fast or slow. By testing a small sample of markets for the same data interval and of the same calculation period, we can understand how the major trending methods differ, especially in their risk profiles. The most popular approaches, two event-driven trends (discussed in Chapter 5) and four time-driven trends, are:
1. \(M\), an \(N\)-day momentum
2. \(M A\), a simple moving average
3. EXP, exponential smoothing
4. \(B O, N\)-day breakout
5. \(S W G\), swing breakout
6. LRS, linear regression slope
The markets used will be IBM, Ford, and Bank of America representing the equities, and Eurodollar
interest rates, the emini S\&P, the euro currency, and crude oil futures markets. The data for equities has been adjusted for splits and the futures are continuous, backadjusted contracts. Neither of these data adjustments affects the trend calculations or trading signals. The time period will be 1991 to 2018 for futures and 2000 to 2018 for stocks. Position sizes will be variable based on an investment of \(\$ 25,000\) for futures and \(\$ 10,000\) for stocks. A cost of \(\$ 8\) per trade for stocks and \(\$ 8\) per side per contract for futures will reduce the returns.
In Chapter 21 we will explore testing in depth, looking at the pattern of returns for different stocks and futures,
and selecting the best parameters. Here, we are interested in the risk-and-reward profiles of these methods. It is one way a trader can decide if she can feel comfortable trading that system. A different calculation period will be used for some of the markets because some trend better than others.
\section*{Trading Rules}
To see the characteristics of each system, the trading rules will be as simple as possible. Only the basic buy and sell signals will be used (where sell is both exiting longs and selling short). All six systems are always in the market. There are no stop-losses or other risk controls; therefore, each system will show its own, natural risk profile. All entries and exits are done at the current closing price. While it is more realistic to trade stocks on the next open, futures trade nearly 24 hours each day and you cannot run your system, produce trading signals, and execute orders before the next open, which
is 30 minutes after the close. Understanding that, an execution on the current close will be the fairest way to compare systems across markets.
The following is a brief description of the type of system, calculation method, and trading rules. Note that, for MA, EXP, and LRS, the trading signal is based on the direction of the trendline.
1. \(M, N\)-day momentum
a. Buy when close \(_{t}>\) close \(_{t-n}\)
b. Sell when close \(_{t}<\) close \(_{t-n}\)
2. MA, Simple moving average
a. Buy when \(M A_{t}>M A_{t-1}\)
b. Sell when \(M A_{t}<M A_{t-1}\)
3. EXP, Exponential smoothing
a. Buy when \(\operatorname{Exp}_{t}>\operatorname{Exp}_{t-1}\)
b. Sell when \(\operatorname{Exp}_{t}<\operatorname{Exp}_{t-1}\)
4. \(B O, N\)-day breakout
a. Buy when
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0636.jpg?height=98&width=998&top_left_y=1562&top_left_x=274)
close \(_{t}>\) close \(_{t-1}\)
b. Sell when low \(<\) lowest(low, \(t-1\), and close \(_{t}<\) close \(_{t-1}\)
5. SWG, Swing breakout
a. Buy when the current swing high \(>\) previous swing high
b. Sell when the current swing low < previous swing low
6. \(L R S\), Linear regression slope
a. Buy when Slope(close,t,n) > 0
b. Sell when Slope(close,t,n) < 0
In the rules described above, the functions highest, lowest, and slope use the parameters (price, current day, calculation period), then highest(high, t.-.1, n) will return the highest high for the \(n\) days ending on the previous day, t.-.1.
\section*{Spreadsheet Calculations}
A spreadsheet is an easy way to see the returns of all but the swing method. The function OFFSET allows the calculation period (located in F3) to be changed, resulting in all calculations and returns changing. It is a simple way of allowing different calculation periods to be tested. The calculations for the other five systems can be done in a single column, using the following setup and instructions:
1. Column A is the date.
2. Columns B, C, D, and E are the open, high, low, and closing prices.
3. F3 has the calculation period that will be used for all
five strategies.
4. Column F calculates the momentum as \(=\mathrm{E} 163\) OFFSET(E163,-\$F\$3+1,o). Calculations begin in row 163 because there will be a maximum of 160 days allowed.
5. Column G is the moving average =AVERAGE(E163:OFFSET(E163,-\$F\$3+1,o)).
6. Column H is the exponential smoothing, \(=\mathrm{H} 162+\$ \mathrm{H} \$ 3 *\) (E163-H162). Cell \$H\$3 = 2/(F2 + 1), the standard conversion from days to smoothing constant.
7. Column I is the regression slope =SLOPE(E163:OFFSET(E163,\$F\$3+1,o),A163:OFFSET(A163,-\$F\$3+1,o)).
8. Column \(J\) records if the most recent breakout is up \((+1)\) or down \((-1)\)
\(=\) IF(E163 \(>\) MAX(E162:OFFSET(E162,\$F\$3+1,o)),1,IF(E163<MIN(E162:OFFSET(E162,\$F\$3-1,o)),-1," ")).
The next five columns, \(\mathrm{K}-\mathrm{O}\), show the continuous trend direction ( +1 or -1 ) based on the calculations in \(\mathrm{F}-\mathrm{J}\). Then cell K164 (momentum) \(=\operatorname{IF}(\mathrm{F} 164>\mathrm{F} 163,1,-1)\). Once there is an initial direction, the cells are either +1 or -1 . The breakout strategy, column J, takes 77 days before the first trend can be identified.
![](https://cdn.mathpix.com/cropped/2024_08_17_855fb8e7f19577e922fag-0638.jpg?height=133&width=142&top_left_y=1734&top_left_x=66)
The last five columns give the cumulative profit or loss in points; that is, there is no conversion to dollars. Cell P165=K164*(\$E165-\$E164)+P164. For the
Eurodollar interest rates, the futures market conversion is \(\$ 2,500\) per big point. Then a move from 97.00 to 98.00 is worth \(\$ 2,500\). Results for one futures market and one stock, the S\&P and AAPL, can be found in three spreadsheets, TSM Trend Systems Comparisons SP and TSM Trend Systems Comparisons AAPL, available on the Companion Website. The programs TSM Trends, TSM Swing, and TSM Momentum were used to produce the results that follow.
\section*{Results for Futures}
Table 8.7 is a summary of the futures market results. The calculation periods, shown with the system name in column B, are different for most of the markets. Those with stronger trends have longer periods, although all are quite long. The swing filter varies the most and is larger when a market has more noise and smaller when it has more trend. In column K, the ratio is the Total PL ( Col C) divided by the Max Drawdown ( col J ). It is a good measure of success.
\section*{TABLE 8.7 Summary of futures market results.}
\begin{tabular}{|c|c|c|c|c|c|c|c|c|c|c|}
\hline A & B & C & D & E & F & G & H & 1 & J & K \\
\hline & System & Total PL & Long PL & Short PL & Profit & Trades & \begin{tabular}{|l|}
\%Prof \\
Trades
\end{tabular} & \begin{tabular}{l}
Days \\
Held
\end{tabular} & Max Draw & Ratio \\
\hline \multirow[t]{6}{*}{ Eurodollars } & MA 160 & \$7,982,720 & \$6,779,769 & \$1,202,951 & 4.61 & 102 & 34.3 & 69.4 & \((\$ 670,906)\) & 11.90 \\
\hline & BO 160 & \$7,526,277 & \$6,972,466 & \$553,811 & 7.33 & 20 & 65.0 & 349.3 & \((\$ 700,168)\) & 10.75 \\
\hline & LRS 160 & \$6,806,003 & \$6,368,009 & \$437,994 & 4.53 & 26 & 50.0 & 269.3 & \((\$ 1,030,097)\) & 6.61 \\
\hline & EXP 160 & \$6,797,150 & \$6,002,226 & \$794,924 & 3.68 & 140 & 22.1 & 50.8 & \((\$ 808,109)\) & 8.41 \\
\hline & Swing 2\% & \$3,905,013 & \(\$ 4,231,857\) & \((\$ 326,844)\) & 1.64 & 282 & 37.2 & 25.7 & (\$732,784) & 5.33 \\
\hline & MOM 160 & \$7,629,409 & \$6,943,497 & \$685,913 & 4.79 & 101 & 34.6 & 68.4 & (\$641,178) & 11.90 \\
\hline \multirow[t]{6}{*}{ emini S\&P } & MA 160 & \$2,332,118 & \$3,321,853 & \((\$ 989,735)\) & 1.62 & 181 & 28.7 & 39.6 & (\$1,352,180) & 1.72 \\
\hline & BO 160 & \(\$ 2,888,153\) & \$3,645,825 & (\$757,672) & 2.37 & 27 & 44.4 & 256.0 & \((\$ 1,240,622)\) & 2.33 \\
\hline & LRS 160 & \(\$ 5,182,348\) & \$5,359,980 & \((\$ 177,632)\) & 4.28 & 30 & 43.3 & 233.8 & \((\$ 1,664,422)\) & 3.11 \\
\hline & EXP 160 & \$1,832,050 & \$3,061,964 & \((\$ 1,229,914)\) & 1.38 & 287 & 15.0 & 25.3 & ( \(\$ 990,873\) ) & 1.85 \\
\hline & Swing 9\% & \$3,399,836 & \$3,093,387 & \$306,449 & 5.55 & 22 & 45.4 & 293.3 & \((\$ 896,000)\) & 3.79 \\
\hline & MOM 160 & \$1,878,236 & \(\$ 2,813,001\) & (\$934,765) & 1.51 & 179 & 29.0 & 37.2 & \((\$ 1,338,172)\) & 1.40 \\
\hline \multirow[t]{6}{*}{ Euro } & MA 120 & \$2,658,518 & \$1,116,006 & \$1,542,512 & 1.62 & 210 & 33.8 & 34.2 & (\$1,039,919) & 2.56 \\
\hline & BO 120 & \$2,927,716 & \$1,629,240 & \$1,298,477 & 2.16 & 34 & 47.1 & 206.1 & \((\$ 1,219,941)\) & 2.40 \\
\hline & LRS 120 & \$3,462,645 & \$1,593,347 & \$1,869,299 & 2.33 & 52 & 48.1 & 135.1 & \((\$ 1,080,985)\) & 3.20 \\
\hline & EXP 120 & \(\$ 3,075,915\) & \$1,635,219 & \$1,440,696 & 1.58 & 362 & 17.4 & 20.3 & \((\$ 1,195,265)\) & 2.57 \\
\hline & Swing 2\% & \$4,852,806 & \(\$ 2,608,670\) & \(\$ 2,244,136\) & 2.18 & 159 & 47.2 & 44.3 & (\$699,124.50) & 6.94 \\
\hline & MOM 120 & \$2,609,894 & \$1,148,758 & \$ \(\$ 1,461,136\) & 1.61 & 209 & 33.4 & 34.2 & \((\$ 1,032,175)\) & 2.53 \\
\hline \multirow[t]{6}{*}{ Crude } & MA 100 & \$4,871,166 & \$3,439,154 & \$1,432,012 & 2.01 & 259 & 35.1 & 27.8 & (\$1,342,802) & 3.63 \\
\hline & BO 100 & \$5,258,306 & \$4,064,040 & \$1,194,266 & 3.11 & 36 & 33.3 & 192.6 & \((5976,864)\) & 5.38 \\
\hline & LRS 100 & \$4,13