Download as pdf or txt
Download as pdf or txt
You are on page 1of 30

EFFECTIVE TRADING IN

FINANCIAL MARKETS USING


TECHNICAL ANALYSIS

This book provides a comprehensive guide to effective trading in the financial markets
through the application of technical analysis through the following:

• Presenting in-depth coverage of technical analysis tools (including trade set-ups)


as well as backtesting and algorithmic trading
• Discussing advanced concepts such as Elliott Waves, time cycles and momentum, volume,
and volatility indicators from the perspective of the global markets and especially India
• Blending practical insights and research updates for professional trading, investments,
and financial market analyses
• Including detailed examples, case studies, comparisons, figures, and illustrations from
different asset classes and markets in simple language

The book will be essential for scholars and researchers of finance, economics and management
studies, as well as professional traders and dealers in financial institutions (including banks)
and corporates, fund managers, investors, and anyone interested in financial markets.

Smita Roy Trivedi is Assistant Professor, International Banking and Finance Group at the
National Institute of Bank Management, Pune, India. She has been engaged in teaching,
training, and research in international banking, technical analysis, and algorithmic trading.
Her publications include the book Financial Economy: Evolutions at the Edge of Crises
(co-authored with Sutanu Bhattacharya, 2018). Her research has been published in Empirical
Economics, Economic Papers, and Asia-Pacific Financial Markets.

Ashish H. Kyal is Founder of Waves Strategy Advisors, based in Mumbai, India, a Chartered
Market Technician (CMT) and member of CMT-USA. He has worked with leading invest-
ment banks such as Lehman Brothers and Nomura Holdings. His articles have appeared in
newsletters of CMT-USA, International Federation of Technical Analysts (IFTA-London)
Reuters, and Bloomberg and a research paper in the Journal of the Society of Technical Analysts.
He is a frequent speaker on CNBC TV18, ET NOW, Bloomberg Quint, Rajya Sabha TV,
and National Institute of Bank Management.
‘Investors ignore technical analysis near the end of bull markets, when buy and hold
is in vogue. Today the approach is at a nadir of interest, just when people need it
most. Get ahead of the next rush to understand and apply technical analysis. In
their comprehensive overview, Roy Trivedi and Kyal first introduce you to the key
terms of financial markets and then elucidate all established aspects of the technical
analysis field. If you start with this book, you will have a foundation for deciding
the next step to take in expanding your knowledge.’
– Robert R. Prechter, Elliott Wave theorist, author and
co-author of 14 books, including Elliott Wave Principle,
and Conquer the Crash (New York Times best seller, 2002)

‘There are lots of books about technical analysis available, but almost all of them are
written by practitioners. Thus, a collaboration of academic and practitioner, as seen
in this book, is rare but welcome. The lacking interest of academics in technical
analysis is driven by the wide acceptance of the efficient market hypothesis. It seems
very intuitive that financial market actors trade on the information available to
them and that this leads to adjusted prices. Any other behavior would be irrational.
Moreover, such behavior would be punished by future price developments of
financial prices so that these markets reinforce rational behavior.
Seen from this perspective, the price of a financial asset depends on its future returns,
discounted by interest rates and considering its riskiness. The role of fundamental anal-
ysis is then trying to learn about these determinants. In this world, there is no role for
technical analysis. What should we learn from looking backwards if the price is only
determined by future developments? At least this is the world of finance as it should
be in principle. In reality, however, we know that markets are imperfect. This book
rightly discusses in its Chapter 1, imperfections which may “justify” the use of techni-
cal analysis. Overall, there are good theoretical and empirical reasons why technical
analysis can be a useful tool to forecast financial market developments (e.g., Hsu et al.,
2016). However, as is true for fundamental analysis, the use of an analytical tool – and
technical analysis is such a tool – requires expertise. This book provides some academic
background in the beginning and then introduces and explains the main concepts of
technical analysis. The presentation is clear and applied, providing many examples and
also links to programming. Thus, I highly welcome this book which contributes to
compile and spread expertise on technical analysis in financial markets.’
– Lukas Menkhoff, head of department, International Economics,
DIW Berlin (the German Institute for Economic Research)

‘Those who dismiss technical analysis as unscientific have to confront the long and
consistently profitable track records of legendary traders such as Linda Raschke.
Whether you are studying technical analysis as a skeptic or a believer, Roy Trivedi
and Kyal’s book will serve as a comprehensive guide. The chapter on algorithmic
trading is particularly helpful to those who plan to implement technical analysis in
an automated program.’
– Ernest P. Chan, author of Quantitative Trading, Algorithmic Trading:
Winning Strategies and Their Rationale and Machine Trading:
Deploying Computer Algorithms to Conquer the Markets

‘In the last four decades, “Technical Analysis” (TA) has become an important tool
in the hands of analysts, researchers and practitioners in any financial /commodity
markets. While fundamental analysis continues to be the mainstay of traditional
market analysts, advent of technology has made the role of TA as important as that
of fundamental analysis, if not more.
Given this trend, I feel that the book on TA by Smita and Ashish will be a very
handy guide to any intending market specialist. The USP of this book is that it
helps the reader in climbing up the learning curve on the subject in a smooth glide
path but at the same time, without compromising on the thoroughness. Start-
ing from the basic principles, the book traverses through a large canvas which
includes study of patterns (reversal and continuation), candlesticks, moving aver-
ages, momentum, volume, and volatility indicators and finally concludes with a
glimpse of algorithmic trading. The authors employ a very simple and lucid style
to explain even difficult concepts with appropriate illustrations. I am sure the book
will evoke an enthusiastic response from the readers.’
– G. Mahalingam, whole time member, Securities and
Exchange Board of India, and former executive director,
Reserve Bank of India

‘This book is an amazing toolkit to understand trading/investing as a data-driven


science. The toughest act in money making is the art of keeping emotions aside,
and this book explains the calibrated techniques and tools in a simplified manner.’
– Kamlesh Jain, MRICS, CA, founder, Innovation India in
and the Attention Institute, and former executive director,
Nomura, head of Global Equities
‘The timing of this book’s publication – amid the global COVID-19 financial crisis
of 2020 – is perfect for introducing a new generation to the value of technical
analysis. The chapter on Elliott waves provides a solid review of the basic principles
of wave analysis using recent examples and easy-to-understand summaries of
important points. Long-term investors who read this book will be well prepared
for the next secular bear market. And short-term traders will gain a quick return
on the time invested in reading it.’
– Mark Galasiewski, chief equity analyst for Asia and
Emerging Markets, Elliott Wave International

‘Smita and Ashish have put together a comprehensive piece of work on how to
effectively use technical analysis (TA) in today’s financial markets. The book is
thoroughly researched, and a lot of references and credits are made to academic
studies and well-respected technical analyses by authors throughout. They start with
laying out the groundwork and foundations of financial markets and trading (infra)
structure, especially in India, before even touching on analyses techniques which
give the reader a solid foundation for understanding the TA concepts further on.
The main part of the book on TA, covers the most important and popular
approaches in the field. Starting with various charting formats, then moving on to
more subjective analyses tools like trends, price patters, indicators and even Elliott
Wave, to finish with more quantitative tools and rules-based trading using tools like
Excel and Python.
Although the majority of examples and explanations are geared towards the
Indian markets, the language of technical analysis is universal. I recommend this
book for every aspiring Technical Analyst who wants to get a solid understand-
ing of the general TA framework and the various technical analysis tools that the
authors discuss.’
– Julius de Kempenaer, senior technical analyst at Stockcharts.com,
director of RRG Research, and the creator of Relative
Rotation Graphs(R)
EFFECTIVE TRADING IN
FINANCIAL MARKETS
USING TECHNICAL
ANALYSIS

Smita Roy Trivedi and


Ashish H. Kyal
First published 2021
by Routledge
2 Park Square, Milton Park, Abingdon, Oxon OX14 4RN
and by Routledge
52 Vanderbilt Avenue, New York, NY 10017
Routledge is an imprint of the Taylor & Francis Group, an informa business
© 2021 Smita Roy Trivedi and Ashish H. Kyal
The right of Smita Roy Trivedi and Ashish H. Kyal to be identified
as authors of this work has been asserted by them in accordance with
sections 77 and 78 of the Copyright, Designs and Patents Act 1988.
All rights reserved. No part of this book may be reprinted or reproduced or
utilised in any form or by any electronic, mechanical, or other means, now
known or hereafter invented, including photocopying and recording, or in
any information storage or retrieval system, without permission in writing
from the publishers.
Research, analyses, or other information contained in this book are for
educational purposes only, and do not constitute investment advice.
Authors have made every effort to provide accurate information and web
addresses but neither the authors or the publisher are responsible for any
errors or changes occurring after publication. Authors or the publisher
do not assume any responsibility for third-party websites or the content
therein.
Trademark notice: Product or corporate names may be trademarks or
registered trademarks, and are used only for identification and explanation
without intent to infringe.
British Library Cataloguing-in-Publication Data
A catalogue record for this book is available from the British Library
Library of Congress Cataloging-in-Publication Data
A catalog record for this book has been requested
ISBN: 978-0-367-31354-8 (hbk)
ISBN: 978-0-367-31355-5 (pbk)
ISBN: 978-0-429-31648-7 (ebk)
Typeset in Bembo
by Apex CoVantage, LLC
Visit the eResources: www.routledge.com/9780367313555
CONTENTS

List of figures xii


List of tables xviii
List of abbreviations xix
Prefacexx
Acknowledgementsxxv

1 Introduction to technical analysis 1


1.1 Technical analysis and trading in the financial markets 1
1.2 Evidence on the use of technical analysis 3
1.3 Technical analysis profitability and the efficient market
paradigm 4
1.4 What explains the profitability of technical analysis? 5
1.5 Financial markets: the trader’s playground 7
1.5.1 Functions of financial markets 7
1.5.2 Types of financial markets 8
1.5.3 Infrastructure of trading 10
1.6 Key takeaways 15

2 Basic principles of technical analysis 17


2.1 Introduction 17
2.2 Time frame of the chart 18
2.3 Types of charts 20
2.3.1 Bar chart 20
2.3.2 Line chart 20
2.3.3 Point and figure chart 21
viii Contents

2.3.4 Candlesticks 23
2.3.5 Heinken Ashi candlestick 23
2.4 Dow Theory and its application 26
2.4.1 Basic tenets of technical analysis 26
2.4.2 Main criticisms of Dow Theory 28
2.5 Trend analysis 29
2.5.1 Definition of trend 29
2.5.2 Drawing trend lines 29
2.5.3 Support and resistance 32
2.5.4 Potential support and resistance patterns 32
2.6 Use of trend analysis in trading 34
2.6.1 Fan principle 34
2.6.2 Channel line 35
2.6.3 Retracements 37
2.6.4 Case studies 39
2.7 Key takeaways 42

3 Classical reversal and continuation patterns 44


3.1 Introduction 44
3.2 Reversal patterns 44
3.2.1 Head and Shoulders 45
3.2.2 Double Top and Bottom 48
3.2.3 Triple Tops and Bottoms 50
3.2.4 Saucers and spikes 51
3.3 Continuation patterns 52
3.3.1 Triangles 53
3.3.2 Flags and pennants 56
3.3.3 Wedges 57
3.4 Gaps 59
3.4.1 Breakaway Gaps 59
3.4.2 Runaway Gaps 59
3.4.3 Exhaustion Gaps 61
3.4.4 Island Reversals 61
3.4.5 Case studies: combining Gaps with other
patterns 63
3.5 Key takeaways 65

4 Candlesticks patterns and their use in trading strategies 67


4.1 Introduction 67
4.2 Concept of candlesticks 68
4.2.1 Long candlesticks 70
4.2.2 Short candlesticks 70
Contents ix

4.2.3 Doji candlesticks 71


4.2.4 Long upper shadows only 71
4.2.5 Long lower shadows only 71
4.2.6 Candles with both long upper and lower
shadows 71
4.3 Reversal patterns 73
4.3.1 Hanging Man and Hammer 73
4.3.2 Engulfing pattern (tsutsumi) 75
4.3.3 Dark cloud cover (kabuse) 76
4.3.4 Piercing line (kirikorni) 79
4.3.5 Evening Star and Morning Star 80
4.3.6 The Three Black Crows and the Three Advancing
White Soldiers 82
4.3.7 Harami pattern 82
4.3.8 Tweezers tops and bottoms 86
4.3.9 Belt Hold lines (yorikiri) 86
4.3.10 Three Mountains and Three Rivers 86
4.4 Continuation patterns 88
4.4.1 Windows 88
4.4.2 Bullish Rising Three Methods and the Bearish
Falling Three Methods 88
4.4.3 Separating lines 90
4.5 Key takeaways 92

5 Moving averages and their use for trading strategies 94


5.1 Introduction 94
5.2 Concept of moving averages 95
5.2.1 Types of moving averages 97
5.2.2 Choice of period 102
5.3 Using moving averages to understand the trend, support
and resistance 104
5.3.1 Which moving averages to use? 105
5.4 Crossover technique 106
5.4.1 Double crossover 106
5.4.2 Triple crossover technique 108
5.5 Case studies: using moving averages for trading 109
5.6 Key takeaways 111

6 Momentum indicators and stochastics 113


6.1 Introduction 113
6.2 Momentum and Rate of change 114
6.3 RSI 119
x Contents

6.4 MACD 122


6.5 Stochastics 124
6.6 HA Stochastic 125
6.7 Case studies: framing trading strategies with momentum
indicators 127
A. State Bank of India 127
B. Nifty 50 128
6.8 Key takeaways 133

7 Volatility and volume indicators 135


7.1 Introduction 135
7.2 Volatility indicators 137
7.2.1 Moving average envelopes 137
7.2.2 Bollinger Bands® 138
7.2.3 ATR 141
7.3 Volume-based indicators 143
7.3.1 Volume oscillators 143
7.3.2 The Chaikin Money Flow Index 144
7.4 Case studies: using volatility indicators for trading
decisions 146
A. Reliance industries 146
B. Nifty 50 147
7.5 Key takeaways 148

8 Elliott Wave Principles 150


8.1 Introduction 150
8.1.1 What is a ‘wave’? 151
8.2 The Fibonacci sequence 151
8.2.1 The golden ratio 151
8.3 Understanding impulse patterns 151
8.3.1 Rules of impulse patterns 152
8.3.2 Understanding degrees 154
8.3.3 Variations to the impulse pattern 154
8.4 Corrective waves 160
8.4.1 Zigzag correction (5–3–5) 160
8.4.2 Flat correction pattern 164
8.4.3 Triangle 170
8.4.4 Diametric pattern: new patterns discovered by
Glenn Neely (1995) of NEoWave 173
8.5 Channelling 179
8.6 Key takeaways 183
Contents xi

9 Time cycles 185


9.1 Introduction 185
9.2 Characteristic of cycles 186
9.2.1 Period 187
9.2.2 Amplitude 187
9.2.3 Phase 187
9.3 Left and right translation 187
9.4 Principles of cycles 188
9.4.1 Principle of summation 188
9.4.2 Principle of harmonicity 188
9.4.3 Principle of synchronicity 188
9.4.4 Principle of nominality 188
9.4.5 Principle of variation 189
9.4.6 Principle of proportionality 189
9.4.7 Principle of commonality 189
9.5 Detecting the cycles 190
9.5.1 Observational analysis 190
9.5.2 Selecting oscillator indicator parameters 192
9.5.3 Detrending for cycle identification 192
9.5.4 Envelopes 194
9.6 Combining time cycles with an Elliott Wave 196
9.7 Key takeaways 202

10 Introduction to backtesting and algorithmic trading 203


10.1 Introduction 203
10.2 Concept of algorithmic trading 204
10.3 Using Excel for algorithmic trading 207
10.3.1 Getting data for backtesting and live signal
generation 207
10.3.2 Basic Excel functions to know 207
10.3.3 Coding trading strategies 210
10.4 Introduction to Python 221
10.4.1 Basics in Python 222
10.4.2 Using Python for backtesting 229
10.5 Key takeaways 244

11 Conclusion 246

References254
Index260
FIGURES

2.1 GBP/USD movement, 2015–2019 (monthly chart). Created


with Eikon, Refinitiv 19
2.2 GBP/USD movement, 2019 (daily chart). Created with
Eikon, Refinitiv 19
2.3 Construction of a bar 20
2.4 Line chart of GBP/USD. Created with Eikon, Refinitiv21
2.5 Construction of candlesticks 23
2.6 Candlesticks chart of GBP/USD. Created with Eikon, Refinitiv 25
2.7 Heiken Ashi candlesticks chart of GBP/USD. Created with
Eikon, Refinitiv 26
2.8 Drawing the trend line 30
2.9 Tentative and valid trend line 31
2.10 Support and resistance 33
2.11 Support and resistance trend line in the Nifty (daily chart).
Created with Amibroker 33
2.12 Role reversal of support and resistances 34
2.13 Fan principle 35
2.14 Channel line 36
2.15 Channels in the Nifty (hourly chart). Created with Amibroker 36
2.16 DJIA daily chart analysis. Created with Amibroker 37
2.17 Fibonacci retracements on a Nifty daily chart. Created
with Amibroker 38
2.18 Bar technique on Altria Group Inc. daily chart. Created
with Amibroker 39
2.19 Analysis of crude oil futures in INR (continuous contract;
weekly chart). Created with Amibroker41
2.20 DJIA (daily chart). Created with Amibroker 41
Figures xiii

3.1 Head and Shoulders pattern 45


3.2 Head and Shoulder pattern on the Nifty (hourly chart). Created
with Amibroker 46
3.3 Inverse Head and Shoulder pattern on MCX crude oil (weekly
chart). Created with Amibroker 47
3.4 Inverse Head and Shoulder pattern on Alcoa Corp (weekly
chart). Created with Amibroker 48
3.5 Double Top pattern 49
3.6 Double Bottom formation on MMM (daily chart). Created
with Amibroker 49
3.7 Triple Top pattern 50
3.8 Triple Bottom pattern on EUR/USD (weekly chart). Created
with Amibroker 51
3.9 Saucer 52
3.10 Inverse ‘V’ spike at market top 52
3.11 Continuation pattern: Symmetrical Triangle 53
3.12 Ascending Triangle 54
3.13 Descending Triangle 54
3.14 Symmetrical Triangle pattern on USD/INR (daily chart).
Created with Amibroker 55
3.15 Descending Triangle pattern on the DJIA (daily chart). Created
with Amibroker 55
3.16 Continuation pattern: flags 56
3.17 Continuation pattern: pennants 56
3.18 Wedge 57
3.19 Wedge pattern on the Nifty Index (daily chart). Created with
Amibroker58
3.20 Flag, pennants, and wedge on the DJIA (daily chart). Created
with Amibroker 58
3.21 Breakaway Gap 60
3.22 Runaway Gap 60
3.23 Island Reversal 61
3.24 Runaway Gap, Exhaustion Gap, Island Reversal,
and Breakaway Gap 62
3.25 Gaps on Facebook (daily chart). Created with Amibroker 63
3.26 Gap, wedge, and flag on the Nifty (daily chart). Created
with Amibroker 64
3.27 Analysis of channels and gaps on Apple Inc. (daily chart).
Created with Amibroker 65
4.1 Candlesticks: the anatomy 68
4.2a Long-body candles 69
4.2b Marubozu candles 70
4.3 Short candlesticks (spinning tops) 71
4.4 Doji candlesticks 72
xiv Figures

4.5 Candles with long shadows 72


4.6 Doji on the Nifty (hourly chart). Created with Eikon, Refinitiv 73
4.7 Hammer and Hanging Man 75
4.8 Hanging Man and Hammer on EUR (weekly chart). Created
with Eikon, Refinitiv 75
4.9 Engulfing pattern 76
4.10 Bearish engulfing on HDFC Ltd. Created with Amibroker 77
4.11 Bullish engulfing on HDFC Bank. Created with Amibroker 77
4.12 Bullish and bearish engulfing on the Nifty (daily chart). Created
with Eikon, Refinitiv 78
4.13 Dark cloud cover 78
4.14 Piercing line 79
4.15 Piercing line on Hindustan Zinc (daily chart). Created with
Amibroker79
4.16 Evening Star 80
4.17 Morning Star 80
4.18 Evening Star on the Nifty (daily chart). Created with
Eikon, Refinitiv 81
4.19 Morning Star on AUD (daily chart). Created with Eikon, Refinitiv 82
4.20 Three Black Crows 83
4.21 Three White Soldiers 83
4.22 Three White Soldiers on Raymond. Created with Amibroker 84
4.23 Three Black Crows on Raymond. Created with Amibroker 84
4.24 Harami pattern on CAD. Created with Eikon, Refinitiv 85
4.25 Bearish Harami on Maruti. Created with Amibroker 85
4.26 Tweezers tops and bottoms 86
4.27 Belt Hold: bullish and bearish 87
4.28 Bullish Belt Hold and Evening Star on GBP (daily chart).
Created with Eikon, Refinitiv 87
4.29 Three Mountain Tops on GBP (weekly chart). Created with
Eikon, Refinitiv 87
4.30 Tasuki gaps 89
4.31 Rising Three Methods 89
4.32 Rising Three Methods on GBP (daily chart). Created with
Eikon, Refinitiv 90
4.33 Falling Three Methods 91
4.34 Separating lines 91
4.35 Separating lines on GBP (weekly chart). Created with
Eikon, Refinitiv 92
5.1a 30-period moving average on the Euro. Created with
Eikon, Refinitiv 96
5.1b 30- and 60-period moving averages on the Euro. Created with
Eikon, Refinitiv 96
5.2 SMA and EMA on the Euro. Created with Eikon, Refinitiv 99
Figures xv

5.3 AMA and EMA on the Euro. Created with Eikon, Refinitiv 101
5.4 Moving average as support and resistance. Created with Eikon,
Refinitiv104
5.5 Comparing AMA, centred moving average, and EMA. Created
with Eikon, Refinitiv 104
5.6 Double crossover on the State Bank of India (30-minute chart).
Created with Eikon, Refinitiv 107
5.7 Sideways movement and moving averages. Created
with Eikon, Refinitiv 107
5.8 Triple crossover. Created with Eikon, Refinitiv 108
5.9 Using moving averages: EUR/USD (daily chart). Created with
Eikon, Refinitiv 110
5.10 Gold futures in INR (daily chart). Created with Amibroker 111
6.1 Movement of prices reflected by moving average and momentum 116
6.2 Moving average and momentum on the GBP (daily chart).
Created with Eikon, Refinitiv 117
6.3 RSI: negative divergence. Created with Eikon, Refinitiv 121
6.4 RSI: positive divergence. Created with Eikon, Refinitiv 121
6.5 MACD. Created with Eikon, Refinitiv 123
6.6 MACD with MACD forest. Created with Eikon, Refinitiv 124
6.7 %D and %K line on EUR chart. Created with Eikon, Refinitiv 125
6.8 SBI combined analysis. Created with Amibroker 127
6.9 Nifty 50 index (monthly chart). Created with Eikon, Refinitiv 129
6.10 Nifty daily chart analysis (May–July 2019). Created with Eikon,
Refinitiv129
6.11 Nifty 50 Index (weekly chart). Created with Amibroker 130
6.12 Nifty daily chart analysis (July 2019–April 2020). Created with
Amibroker131
6.13 Nifty 50 Index (hourly chart). Created with Amibroker 132
7.1 Moving average envelopes. Created with Eikon, Refinitiv 137
7.2 Bollinger Bands (EUR hourly chart). Created with
Eikon, Refinitiv 139
7.3 Bollinger Bands overbought and oversold levels
(EUR hourly chart). Created with Eikon, Refinitiv 140
7.4 Bollinger Bands (Nifty daily chart). Created with Amibroker 141
7.5 ATR (EUR hourly chart). Created with Eikon, Refinitiv 142
7.6 Volume and volume ROC on SBI (daily chart). Created with
Eikon, Refinitiv 144
7.7 Chaikin Money Flow Index on SBI (daily chart). Created with
Eikon, Refinitiv 145
7.8 Reliance industries (daily chart). Created with Amibroker 146
7.9 Nifty 50 (daily chart). Created with Amibroker 148
8.1 The basic pattern 152
8.2a Wave 2 completely retraced wave 1: not allowed 153
xvi Figures

8.2b Wave 3 is the shortest among impulse waves: not allowed 153
8.2c Wave 4 enters the territory of wave 1: not allowed 154
8.3 Degrees of waves 155
8.4 Wave 3 extended and subdivided 156
8.5 Impulse pattern (Nifty hourly chart). Created with Amibroker 156
8.6 Ending diagonal pattern 157
8.7 Ending diagonal pattern (Nifty daily chart). Created
with Amibroker 158
8.8 Fifth failure pattern 159
8.9 Fifth failure pattern (Maruti weekly chart). Created
with Amibroker 160
8.10 Zigzag pattern 161
8.11 Zigzag pattern (Nifty daily chart). Created with Amibroker 162
8.12 Double zigzag pattern 163
8.13 Triple zigzag pattern 163
8.14a Flat pattern correcting up move 164
8.14b Flat pattern correcting down move 165
8.15a Irregular flat correcting up move 166
8.15b Irregular flat correcting down move 166
8.16 Running flat correction 167
8.17a Double flat correction 168
8.17b Double flat correction 168
8.17c Triple flat correction 169
8.18 Double zigzag correction (EUR/USD weekly chart). Created
with Amibroker 169
8.19 Triangular pattern 170
8.20a Triangular pattern with an irregular wave B 171
8.20b Irregular triangle pattern in a bear market 172
8.21 Triangle pattern (ICICI Bank weekly chart). Created
with Amibroker 172
8.22a Bow-Tie Diametric pattern in a bear market 173
8.22b Diamond-shaped Diametric pattern in a bull market 174
8.23 Bow-Tie Diametric pattern (Facebook daily chart). Created
with Amibroker 174
8.24 Alternation between wave 2 and wave 4 175
8.25a Double combination pattern 176
8.25b Double combination pattern 176
8.26a Triple combination pattern 177
8.26b Triple combination pattern 177
8.26c Triple combination pattern 178
8.27 Triple zigzag pattern (Nifty daily chart). Created with Amibroker 178
8.28 Channels (Maruti weekly chart). Created with Amibroker 181
8.29 Application of an Elliott wave (DJIA weekly chart). Created
with Amibroker 181
Figures xvii

8.30 Impulse pattern (DJIA weekly chart). Created with Amibroker 182
9.1 Characteristic of cycles 187
9.2 Nested cycles 190
9.3 Time cycles (Nifty daily chart). Created with Amibroker 191
9.4 Cyclicality (DJIA weekly chart). Created with Amibroker 192
9.5 Cyclicality with momentum indicator (DJIA weekly chart).
Created with Amibroker 193
9.6 Detrending using a ratio of price to a 39-month centred
moving average (DJIA monthly chart). Created with Amibroker 194
9.7 39-week centred moving average with 20% envelope (Alcoa
weekly chart). Created with Amibroker 195
9.8 109-day time cycle with a 55-day envelope and detrended
oscillator (Nifty daily chart). Created with Amibroker 196
9.9 86-week time cycle and an Elliott Wave pattern (USD/INR
weekly chart). Created with Amibroker 197
9.10 164-week time cycle and Elliott Wave pattern (Berger Paints
weekly chart). Created with Amibroker 198
9.11 Time cycles and Elliott Waves (USD/INR weekly chart).
Created with Amibroker 199
9.12 Time cycles and Elliott Waves (Nifty daily chart). Created
with Amibroker 201
10.1 Accessing data from Eikon: flow chart 221
10.2 Downloading Python from Anaconda: flow chart 222
10.3 Python output (INR open prices) 236
10.4 Python output (HDFC adjusted close and open prices) 238
10.5 Python output (HDFC adjusted close, EMA 30, EMA 40) 239
10.6 Python output (HDFC adjusted close, EMA 30, EMA 40
using loc) 240
11.1 Global indices at a glance, 2009–2020 (monthly chart).
Created with Amibroker 247
11.2 Crude oil (monthly chart). Created with Eikon, Refinitiv 247
11.3 EUR/USD (monthly chart). Created with Eikon, Refinitiv 248
11.4 The DJIA and the Nifty 50 (daily chart). Created with Amibroker 249
11.5 The DJIA (daily chart) technical outlook before the crash
of October 1987. Created with Amibroker 250
11.6 DJIA (daily chart) technical outlook before the crash of
February 2020. Created with Amibroker 251
11.7 Relative performance of US sectors during 2008 fall. Created
with Amibroker 252
11.8 Relative performance of Indian sectors during 2020 fall.
Created with Amibroker 252
TABLES

  2.1 Price data for point and figure chart 22


  2.2 Intra-day point and figure (reversal size = 2) 22
  2.3 Intra-day point and figure (reversal = 1) 22
  2.4 Calculation of Heiken Ashi candlestick values 24
  5.1 Calculation of three-period moving average 95
  5.2 Calculation of SMA, EMA, and LWMA 97
  5.3 Calculation of KAMA 100
  5.4 Calculation of centred moving average 103
  6.1 Comparison of prices with three-period moving average and
momentum115
10.1 Relative references and absolute references 208
10.2 Data arrangement in Excel sheet ‘Ch10_2’ 210
10.3 Calculation of the average, SMA, and EMA 211
10.4 EMA 10, 20, and the double crossover signal 213
10.5 Transaction prices and returns 214
10.6 Performance metrics of double crossover signals 1 and 2 215
10.7 RSI calculation 216
10.8 Entry and transactions prices 217
10.9 ATR calculation 218
10.10 Calculation of take-profit and stop-loss levels 219
10.11 Calculation of trade running, profit-target hit, and stop-loss hit 219
10.12 Calculation of exit and profit/loss percentage in Excel 219
10.13 Calculation of performance metrics in Excel 220
10.14 Evaluation of the trading strategy 220
10.15 Operators in Python (in ascending order of precedence) 223
ABBREVIATIONS

AMA Adaptive moving average


ATR Average true range
AUD Australian dollar
CAD Canadian dollar
CMA Centred moving average
DJIA Dow Jones Industrial Average
EMA Exponential moving average
ETF Exchange-traded fund
EUR Euro
GBP Great Britain pound
HA Heiken Ashi
HASTOC Heiken Ashi Stochastic
IDE Integrated Development Environment
INR Indian rupee
LWMA Linearly weighted moving average
MACD Moving average convergence divergence
NSE National Stock Exchange
NZD New Zealand dollar
ROC Rate of Change
RSI Relative Strength Index
SMA Simple moving average
USD United States dollar
XLB Materials Select Sector SPDR
XLF Financial Select Sector SPDR Fund
XLP Consumer Staples Select Sect. SPDR
XLV Health Care SPDR
XLY Consumer Discretionary SPDR
PREFACE

It is but human nature to look for patterns. From the movement of the earth to
the starry patterns in the sky, from the waves in the sea to the cycles of life, it is the
quest for pattern, rhythm, and cycles which distinguishes the human relationship
with nature. Is it surprising then that we look for such patterns in our economies
and financial markets? The existence of patterns or the lack thereof (a random
walk, perhaps?) form the core of our analysis of financial markets. Technical analysis
is a quest for such patterns, patterns in the past which would allow us to look into
the future with more certainty. To predict the future movement of the markets, we
look into the canvas of the past for hidden designs. Not surprisingly, Charles Dow,
whose writings lie at the genesis of technical analysis, compared trends of varying
time frames to the tides, waves, and ripples of the sea (Dow and Sether 2009). In
financial markets, it is the existence of these patterns that brings in a structure for
trading decisions. In this book, we take you on a journey to identify those struc-
tures, enabled by the myriad approaches to technical analysis.
Globally, financial markets have faced sharp movements and seemingly unpre-
dictable turns in the last few years. The last 10 years have seen an economic down-
turn, a trade war, and, finally, a pandemic play out in the financial markets. It is
useful to tell ourselves the power of patterns remains undiminished even amongst
the seeming chaos. If you look at the Dow Jones Industrial Average (DJIA) from
the 1987 crash and the chart of the Nifty Index for 2020 so far, the precipitous fall
remains uncannily similar (for relevant charts, see the Conclusion of this book).
Technical analysis in this scenario can give the much-needed tools to traders for
navigating the labyrinth of the volatile financial markets.
That said, there are several books available on technical analysis. From tomes
that every technical analyst has grown up reading, such as John Murphy, Martin
Pring, Robert Prechter, to newer books by Kirkpatrick and Dahlquist, Ernest P
Chan (on algorithmic trading), this book stands on the solid foundation laid by
Preface xxi

other technical analysts. The book owes to the academic research on technical
analysis by economists such as Lukas Menkhoff, Mark P. Taylor, Christopher J.
Neely, George E. Pinches, and Peter Saacke.
Why then this volume? First, this book brings forth a juxtaposition of the aca-
demic and practitioner perspectives on technical analysis. We have combined in
this book a focus on the conceptual clarity associated with each technical approach,
case studies which underline the practical application of these technical analysis
concepts, and snippets of academic research that put the technical analysis approach
in a bigger perspective.
Second, there is always more to say on technical analysis than is available. Each
day brings in newer applications and case studies and a better understanding of what
works in the markets. With the present global pandemic, we have put together
cases from different asset classes and markets demonstrating the purposeful applica-
tion of technical tools.
Third, in our role as teachers, we have felt a need for a structured approach to
learning technical analysis covering each important domain including the backtest-
ing of the technical analysis strategies. This book has a rounded approach to learn-
ing technical analysis to keep up with the changing skill sets required.
We have underlined the practical application by using as many cases as possible
and relating them with the overall context of the market. We showcased trend fol-
lowing methods that traders can adopt to ride the trend, using simple but effective
methods. Last but not least, we have combined advanced methods like the Elliott
Wave with time cycles and other technical indicators in an easy, understandable,
and systematic fashion along with a few trade set-ups.

Structure of the book and resources


Technical analysis is a myriad collection of approaches to predict the future move-
ment in asset prices given the historical movement. We have structured the book
keeping in view this comprehensive approach to technical analysis. Again, the con-
cepts by themselves are not useful without case studies on their application. We
therefore strengthened the conceptual discussion with recent studies, also covering
the market movement in 2020 post the pandemic.
Chapter 1 sets the tone for the book by introducing the readers to a compre-
hensive view of the technical analysis paradigm. It places technical analysis in the
broader framework of trading in financial markets, presenting the rich empiri-
cal evidence on the use of technical analysis by professionals and research on the
profitability of technical analysis. The chapter also discusses the financial market
infrastructure required for trading and compares trading paths: fundamental and
technical analysis.
Chapter 2 takes up the building blocks of technical analysis with an understand-
ing of Dow Theory, the essential foundation on which the different approaches of
technical analysis rests. Technical analysis is based on the understanding of trends,
as the identification of reversals lies at the core of technical analysis. The chapter
xxii Preface

covers in detail the analysis of trend through the definition of trend lines, the draw-
ing of trend lines, and the identification of support and resistance patterns. Focused
case studies on recent market movement are brought in to underline the applica-
tion of trend analysis.
Chapter 3 takes up classical technical analysis which stems from the broad
notion underlying Dow Theory. The classical patterns embody the essentials of
technical analysis, with a belief that patterns are repetitive and can be used to pre-
dict the future price movement. The visual patterns are formations appearing on
the charts, which can help us to predict a reversal or a continuation in the trend.
Price forecasting requires a careful understanding of the prior movement and the
reason behind the formation of the pattern to be able to predict future prices cor-
rectly. The chapter considers in detail the important reversal and continuation pat-
terns with recent case studies.
Candlesticks, traditionally used by traders of the East, go back a long way in his-
tory, to the legendary Munehisa Homma, who used the candlesticks for trading in
the Japanese rice market during the late 18th century. With their introduction to
the Western world, the popularity of the candlestick patterns has immensely grown.
What lies behind the popularity of candlesticks is that it brings in the simplicity of
the patterns with a rich understanding of market psychology. In Chapter 4, we
consider in detail the concept of candlesticks and reversal and continuation pat-
terns. The patterns are supplemented by case studies to explain how candlesticks
patterns can be traded effectively.
Prices demonstrate a tendency to move towards the mean values historically
so that mean reversion is one of the commonly observed phenomena of financial
markets. If prices do indeed tend to move towards the mean, it is important to
understand how this can be used to generate effective trading signals. Chapter 5
details the concept of ‘mean’ or ‘average’ and its use in trading. Moving averages are
frequently used to understand the general trend in the market and act as dynamic
support and resistant to the price movement. The chapter discusses in detail the
various kinds of moving averages and their use in trading. The chapter takes up
the crossover methodology for generating trade signals, discussing the Double and
Triple Crossover strategies as well as the use of moving averages of different time
frames with recent case studies.
This chapter takes up momentum indicators and stochastics, one of the most
popular technical analysis indicators. If moving average shows the direction of the
trend, Momentum gives the strength of the trend. Chapter 6 begins with a dis-
cussion of the concept of Momentum and how it shows the strength in the trend,
by considering a simple momentum indicator: the Rate of Change (ROC). The
chapter then takes up two of the most popular momentum-based indicators: the
Relative Strength Index (RSI) and the Moving Average Convergence Divergence
(MACD). Stochastics which use the position of price in a range to generate trad-
ing signals are discussed next. Stochastics show whether prices are in the upper or
lower end of the trading range and are therefore much suited for swing recognition
and reversal confirmations. Chapter 6 puts together in the last section detailed cases
Preface xxiii

studies on recent market movement to show how the various momentum indica-
tors can be used effectively for trading.
Chapter 7 takes up the volatility indicators most popularly used by traders,
namely Bollinger Bands and the average true range (ATR). Furthermore, the
understanding of volatility is combined with the knowledge of how to use volume
for trading, as there is strong support to the link between volume and volatility.
Chapter 7 takes up two important volumes-based indicators, the volume oscillator
and the Chaikin Money Flow Index, which can help us refine the trading deci-
sions. Chapter 7 ends with recent case studies showing the effective use of volatility
indicators for trading.
Chapter 8 takes up one of the most intriguing technical analysis approaches,
the Elliott Wave theory, which uses the concept of the fractal nature to form an
in-depth understanding of the trend in a market over a long period. Developed by
Ralph Nelson Elliott in the 1930s, in an Elliott Wave, the smallest of the waves
combine together to form higher-degree wave patterns which, in turn, combine
to make a much higher-degree wave construction. This leads to high forecasting
ability of Elliott Wave Theory stretching years ahead. Chapter 8 starts with the
concepts and principles of Elliott Wave Theory. The understanding of impulse and
corrective waves is taken up next, supplemented with cases with detailed analysis
of the patterns. Detailed case studies are used for showing the application of Elliot
Wave techniques.
Chapter 9 gives comprehensive coverage of time cycles and their effective use
for trading. The cycle periodicity can change requiring a trader to keep tweak-
ing the cycle length from time to time to keep it in sync with changing market
dynamics. There are recurring cycles in financial markets, and by identifying the
cyclicality, one can forecast the possible tops or bottoms and accordingly take trad-
ing positions. In this chapter, the foundation is laid with an in-depth understanding
of the concept of time cycles: the characteristic of cycles, left and right translation,
principles of cycles, and detecting the cycle. Chapter 9 then takes up the combin-
ing of time cycles with Elliott Wave Principles, with pertinent case studies, which
correctly used, can be one of the most effective tools for a trader.
The effectiveness of trading on the basis of visual analysis is reduced to the
extent emotions impacts the trader. Algorithmic trading refers to the automation
of the trading process, whereby the generation of buy or sell signals and the execu-
tion of such signals as trades happen on the basis of programmed instructions or
algorithms. It is not surprising therefore that popularity of algorithmic trading has
grown in recent years amongst not only institutional but also retail traders. While
algorithmic trading may be based on either fundamental or technical analysis or
both, the chapter focuses on trading algorithms based on technical analysis, given
the purview of the book. First, a detailed look at the basic concepts behind algo-
rithmic trading is taken up. Chapter 10 then takes up backtesting of trading strate-
gies with Microsoft Excel and Python, two software tools which rank high in terms
of utility and simplicity. For each, the basics of the software are taken up first with
examples, before moving on to the backtesting of trading strategies. The chapter is
xxiv Preface

supplemented with a number of rich eResources which have been crafted keeping
in view the reader who may not have prior knowledge of the two software tools,
Excel and Python.
How best to progress on the journey of learning the technical trading tools? For
the novice trader or new student of technical analysis, we recommend a sequential
read of the chapters. The order of the chapters has been decided by keeping in
mind the escalation of the level of difficulty and time required to master that par-
ticular technical analysis approach. As you learn the concepts in each chapter, we
suggest continued practice on live charts for a thorough understanding.
For the trader experienced in technical trading, we suggest reading Chapters 1
and 2 first for an understanding of the fundamentals of technical analysis. This will
help in getting the maximum out of the book as basic concepts have been clari-
fied in these two chapters to set a strong foundation to the rest of the book. The
remaining chapters in the book can be read standalone as each technical indicator
or approach can be a journey in itself. That said, Chapter 10 (on backtesting and
the introduction to algorithmic trading) requires a knowledge of technical analysis
indicators, so covering Chapters 5, 6, and 7 are prerequisites to its understanding.
Although the book has used a large number of charts for concepts and cases,
charts being the mainstay of technical trading, there are always more resources that
we would want to share with our readers. An understanding of Chapter 10 requires
readers to go through the Excel and Python notebook files which have been used
as examples, included in the eResource on this book’s page on the Routledge
website: www.routledge.com/9780367313555.
An understanding of technical analysis is a continuous process, a journey along
which each application teaches something anew. The process of writing the book
has been elating for us as we appreciated time and again the technical skills required
for recognizing patterns and trends in the market. We hope you find the journey
through the book as exciting!
ACKNOWLEDGEMENTS

Our book stands on the foundation of a rich literature on technical analysis: aca-
demic research, books and articles. We stand in deep appreciation to the legacy of
such work which have shaped our own conception of technical analysis. We find
it extremely encouraging to have received feedback and support from stalwarts in
the field of technical analysis.
We thank Robert R. Prechter (Elliott Wave theorist and author of Elliott Wave
Principle, and Conquer the Crash) for his uncanny observation and guidance espe-
cially for shaping up the Elliott Wave chapter and his minute observations on the
charts. We are touched by his modesty and eagerness to share his knowledge. His
hand-holding during the phase of the book is inspirational for us and vindicates the
fact that we are on correct path and importance of technical analysis is only going
to increase in an impulsive third wave for decades to come!
We thank Lukas Menkhoff (professor and head of department, International
Economics, DIW Berlin, the German Institute for Economic Research) for his
valuable guidance on research directions in technical analysis and his kind support
for the book. His research on technical analysis has remained core to shaping our
understanding of the deeper roots of technical trading profitability as well as helped
to put technical analysis in the bigger perspective of financial market research.
We thank G. Mahalingam (whole time member, Securities and Exchange Board
of India, and former executive director, Reserve Bank of India) for his support and
encouragement for the book. His views and analysis of market events have always
helped to appreciate the underlying currents that shape financial markets. His guid-
ance and mentorship are deeply appreciated.
We thank Ernest P. Chan (author of Quantitative Trading, Algorithmic Trading:
Winning Strategies and Their Rationale and Machine Trading: Deploying Computer
Algorithms to Conquer the Markets) for his encouraging comments on the book.
The future of trading is closely linked to its automation through algorithmic
xxvi Acknowledgements

trading, and his books have guided our perception of application of technical
trading in this field.
We thank Mark Galasiewski (chief equity analyst for Asia and Emerging Markets,
Elliott Wave International), Kamlesh Jain (founder, Innovation India In and The
Attention Institute), Julius de Kempenaer (senior technical analyst at Stockcharts.
com, director of RRG Research, and creator of Relative Rotation Graphs(R)) for
their valuable feedback and review about the book.
A big thank-you to the editorial team of Routledge. Thanks to Shoma
Choudhury for her support and guidance throughout the revision and restruc-
turing of the book. Thanks to Rimina Mohapatra for her patience and prompt
response to our many queries and her constant support through the revision pro-
cess. Thanks to Brinda Sen and Anvitaa Bajaj for their support and cooperation.
Charts in the book have been made using charting tools of Eikon, Refinitiv and
Amibroker: comments on the chart represents the authors’ views. We thank the
anonymous referee(s) for the constructive suggestions which helped immensely
in strengthening the manuscript. Errors, if any, are ours.

Smita Roy Trivedi


I thank my institute, National Institute of Bank Management (NIBM), Pune,
which enabled an academic to develop a passion for and expertise in technical
analysis. I am grateful to Rajiv Abhyankar, former chief general manager, Bank of
Baroda, for his wonderful advice on the manuscript and detailed feedback on select
chapters. In writing the book, I have kept in mind my students at NIBM and the
professional dealers whose ideas, queries, and suggestions have shaped the structure
and flow of the book. I thank them for the continuous feedback and suggestions.
I thank my colleagues at NIBM who motivate me to lean in every day.
I owe greatly to the support of my spouse, Akshoy Trivedi, and daughter, Ashmi:
they are the ‘wind beneath my wings’. Through the demanding months of writing
of this book, it is their unwavering support, understanding and constant encour-
agement that sustained me. Thanks to Akshoy for sharing more than equal house-
hold responsibilities which enabled me to focus on the book. His keen feedback on
my writing, as also invaluable suggestions on the presentation is hugely appreciated.
Ashmi is our blessing and inspiration. Her thoughts and values make me see
the world anew each day. Discussing technical analysis with her and her witty
comments made the writing process easier than it would have been. Our family is
completed by two irrepressible canines: Momo, who appreciates books, and Popo,
who does not. Their lovable presence fills each day with the little joys that makes
writing enjoyable.
I will be always indebted to my mother, Subhra Roy, who passed away dur-
ing the writing of the book. To say she was a constant source of inspiration and
encouragement is an understatement. I am grateful for the presence of my father,
RN Roy, in our lives and his encouragement. Ma was, as always, excited about this
book making to print. I dedicate the book to her fond remembrance.
Acknowledgements xxvii

Ashish H. Kyal
I would like to thank CMT Association as had it not been for them, I would not
have been known in the field of technical analysis. My special thanks to Bob Pre-
chter, whose work has continued to inspire me even now. His perception about
the social causality called socionomics, with a very different way of looking at
cause and effect in financial world, has always intrigued me. Martin Pring, Ralph
Acampora, and Walter Murphy had been instrumental for shaping up my technical
analysis career by acting as guides and mentors at every aspect. I would not have
the knowledge or understanding about financial markets without learning from
Martin’s books. How can I not thank Mark Galasiewski who has again been a
mentor to me, a guide, and, above that, a friend during difficult market situations.
I would like to thank my students, my mentees and subscribers for believing
in me and my work during various phases of market and trusting my ability with
complete faith and acceptance, especially during times like this of pandemic when
the volatility is at historical levels. They have been inspirational for me to keep
going and exploring various aspect of technical analysis.
I would like to bow towards my Guru – Sadhguru Jaggi Vasudev – who has
been a guiding force that has raised my capability to manage multiple facets of
life during the demanding situations without losing the balance. It is rightly said
that without the blessings and grace of my parents we cannot exist. My father –
Harishanker Kyal – has been an epitome of inspiration who has taught me to
never give up and to always keep moving forward irrespective of the situations.
Words cannot describe the compassion and care of a mother – Kiran – who always
pushed me towards being a better human being above everything else. This book
would not have been possible without the support and understanding of my wife –
Munmun, and I would not have seen myself growing in this field if she would not
have been with me when I was too engrossed in technical analysis over anything
else. I worked relentlessly to make this book happen, but without the support of
my entire family, it would not have been possible. I would like to thank my brother,
Somesh, and sister-in-law, Neeta, who have always inspired and pushed me towards
my goals and exploring my full potential. My children – Jash and Pratyush and my
nieces Pritika and Aarna – have taught me how to be joyful while working which
is very important to create anything with best quality.
1
INTRODUCTION TO TECHNICAL
ANALYSIS

The Only Game in Town.


– Mohamed A. El-Erian1

1.1 Technical analysis and trading in the financial


markets
What is your game? The fascination of our times with the financial markets and
efforts to ‘beat the market’ makes trading no less than an adrenalin-pumping sport.
Trading is a game, played solo with the rest of the market! And technical analysis is
the much-needed skill to win consistently in the game of trading.
At the core of trading is the idea that assets are not valued correctly which makes
it possible to buy an undervalued asset (sell an overvalued one) and thereby reap
gains from the price rise (fall). If markets always determined the true value of a
security, as markets would do if they were ‘efficient’, it would be impossible to ‘beat
the markets’. However, the efficiency paradigm of the financial markets has largely
been questioned (Thaler, 2015), and astute traders know that while we cannot be
right in our valuation every time and ‘beat the market’, it is possible, with the right
strategy, to outwit the market and make profits.
Technical analysis is one of the essential strategies, which when rightly used,
can help traders to make profits and win in the trading game. The fascination
with technical analysis as a skill set for trading in markets is reflected in not only
the growing literature on technical analysis but also the copious advice that pours
through blogs and forums to traders. This book is all about using technical analysis
effectively to make our mark in trading.
What is technical analysis? Technical analysis encompasses several loosely held
paradigms, all of which are based on the analysis of a financial asset’s price and
volume data to predict its future movement. Depending on the technical analysis

You might also like