Algorithmic Trading A Rough and Ready Guide
Algorithmic Trading A Rough and Ready Guide
Algorithmic Trading A Rough and Ready Guide
Algorithmic Trading
Version 1.0
Vivek Krishnamoorthy
Ashutosh Dave
A QuantInsti Publication
January 2020
CONTENTS
Preface iii
About the Authors vii
2 Terminology 4
2.1 Algorithmic Trading and Automated Trading 4
2.2 Quantitative Trading 4
2.3 High Frequency Trading (HFT) 5
2.4 What is a Trading System? 5
2.5 Quants, Traders and Market Makers 6
7 Algorithmic Strategies 28
7.1 Classification of Algorithmic Trading Strategies 28
7.2 Momentum Based Strategies 28
7.3 Mean Reversion Based Strategies 30
10 Conclusion 43
11 Reading List 45
11.1 Books 45
11.2 Research Papers 46
11.3 Online Resources 47
12 References 48
ii
Preface
The trading industry, like virtually every other industry in sight, has gone through a drastic
technological shift in the last few decades. More people now have access to the markets than ever
before. However, succeeding consistently in the financial wild is a different story.
With the advent of quantitative trading, it is imperative that we traders, whether greenhorns or
seasoned players, whether institutional or retail, get a wide understanding of the modern financial
marketplace. In order to do that, using contemporary tools and adding a quantitative dimension to our
trading style is essential.
It is our endeavor here at QuantInsti to bring the knowledge and tools to anyone who wants to learn
about and be a part of the algorithmic and quantitative trading industry.
We hope that this book will serve as an introductory guide for such curious readers and inspire them to
take their first steps towards it.
Until mid-2019, we had a collection of essays on quantitative trading compiled into a book titled ‘A
Beginner’s Guide to Learn Algorithmic Trading’. It was well-received, but we felt that it didn’t go far
enough or deep enough. As content creators in the domain that literally justifies our existence, we had a lot
more to say. So, we took some parts of our older book, added a lot more updated and relevant material to
weave it together into a (hopefully!) coherent story. And that’s what this book is, really.
The book provides an initiation into the principles, practices and components of algorithmic trading. It
also discusses the career pathways to be a part of this industry.
● University students,
● Technology professionals,
● Retail traders of different hues (e.g. professional traders, or hobbyists who like to actively
manage their personal portfolio),
iii
What Are the Prerequisites?
We write assuming our readers do not have a background in programming. While an understanding of
finance, mathematics or computer science is not necessary, having a moderate grasp on any/some/all of
them will make this book an easier read.
Book Structure
We first introduce the reader to the domain of algorithmic trading by briefly exploring its history and
then its terminology. We then proceed to discuss the pros and cons of automated trading. Further, we
elaborate, with illustrative examples, on the components needed to create a robust trading system. We
also briefly cover some key algorithmic trading strategies. to give you a taste of what’s in store for the
more interested among you. We dwell on the skill sets you need to build a career in this domain or to
start your own desk. Finally, we close out our work with a recommended reading list and resources for
diving deeper.
Copyright License
This book is licensed under the Creative Commons Attribution-ShareAlike 4.0 International License and
the image below denotes it.
You can view a copy of the license here. Simply put, you can use, share or modify our work (even
commercially) as long as you attribute to us. If you use this book in a class or university setting, we
would appreciate being informed about it. While doing so, wherever appropriate please cite us as
“Krishnamoorthy, V. & Dave, A. (2020), A rough and ready guide to Algorithmic Trading, QuantInsti”.
iv
Acknowledgments
We owe a great deal to many pioneers from the financial markets and trading community for taking time
out of their busy lives and reviewing our work at short notice. Their comments on our book draft have
immensely helped us improve its quality. We include the Twitter handles of each of them in parentheses
here.
Robert Carver (@investingidiocy) and Wayne Himelsein (Twitter handle @WayneHimelsein) conducted
an extraordinarily thorough review and pointed out typos, errors and inconsistencies in certain sections.
We found their comments to be extremely helpful.
We were stoked to receive suggestions and words of encouragement from Larry Tabb (@ltabb), James
Long (@CMastication) and Tom Basso (@basso_tom).
Harry Tucker’s (@harrytucker) feedback made us reconsider and eventually change the title of our book
to reflect its contents more accurately.
The Options Cafe (@future_nifty), Andreas Clenow (@clenow), R Balakrishnan (@balakrishnanr), Alok
Dharia (@alok_dharia), Dave Bergstrom (@dburgh), Brian (@quantfiction), wantonwallet
(@wantonwallet), Alok Churiwala (@alokgbc), Suri Duddella (@surinotes), Matt Davio (@MissTrade),
fiquant (@fiquant), Subhadip Nandy (@SubhadipNandy), Rob Smith (@robintheblack), and Tim Racette
(@eminimind) all provided valuable feedback on the draft.
We are also grateful to our friends and colleagues from QuantInsti and iRage whom we mention below.
For old content which we are reusing: Many colleagues and ex-colleagues from iRage & QuantInsti
For creating the book design and cover: Paresh Ramtekkar and Shaival Diwan
For proofreading and helpful comments: Rekhit Pachanekar, Viraj Bhagat and Smiti Khandelwal
For overseeing the digital marketing and distribution of this book to far-flung corners of the internet:
Our other colleagues at QuantInsti deserve a mention here for creating a wonderful atmosphere at our
office with a mix of their great lunches (which we mooched on), their bad jokes (which we bore the
brunt of) and their infectious energy and enthusiasm (which we fed off).
Finally, we are thankful to the hundreds of students and traders (often the same people) we regularly
interact with that helped shape this book.
v
Vivek’s acknowledgements:
I would like to acknowledge the love and support of my family - my parents, Krishnamoorthy and Vanaja,
my brother, Vishwesh, and my spouse Neha’s parents, Drs. Rupa and Nitin Pandit.
They often ask me about the field that I work (read as ‘am obsessed with’) in and would like a detailed
answer.
The book you’re reading is that answer, and I’d like to dedicate it to them. I can now show them the book
and shame them into reading it. :)
A special shout-out to my friend, Anirban Sanyal (“Ban”) whose suggestions have benefited me in ways that
are hard to express on paper (and I hope he knows how much it has).
And last, but by no means the least, I’d like to thank my spouse, Neha, who puts up with my atrocious work
habits (at home) among other things. She mostly does this with affection and a lightness of heart that I
cannot fathom. I love her more than I think she realizes and certainly more than I say it. There. I’ve said it
in a book in front of my readers.
Ashutosh’s acknowledgements
I would first like to thank my family, especially my parents, Dr Shubhada and Deepak, my sister, Radhika
and brother-in-law, Devesh for the continuous love and support they have given me through thick and thin;
I could not have done it without them.
Second, I would like to thank my dear wife, Deepika, for all the love, comfort, and guidance she has given
me. I would like to dedicate this work to her.
I want to thank Nitesh Khandelwal for creating and leading the excellent knowledge-sharing platform that
is QuantInsti. This book would not be a reality without it.
I want to express my gratitude to Vivek Krishnamoorthy, for his incredible advice and guidance (academic
and otherwise) through the course of writing this book.
Lastly, my fellow content creators at QuantInsti needs to be acknowledged for making my experience in
QuantInsti truly pleasurable, for offering continuous assistance and for enriching me as a member of the
community.
vi
About the Authors
Vivek Krishnamoorthy is the Head of Content & Research at QuantInsti. He teaches Python for data
analysis, building quant strategies and time series analysis to our students across the world. He comes
with over a decade of experience across India, Singapore and Canada in industry, academia and
research. He has a Bachelors' in Electronics & Telecom Engineering from VESIT (Mumbai University), an
MBA from NTU Singapore and a Graduate Certificate in Public Policy from The Takshashila Institution.
You can reach out to Vivek on LinkedIn.
Ashutosh Dave is a Senior Associate, Content & Research at QuantInsti. Apart from contributing to the
overall content development for our flagship programme EPAT, he also looks after the Outreach
activities at QuantInsti. He has worked as a derivatives trader specializing in trading interest rates and
commodities with a proprietary trading firm in London for several years before joining QuantInsti. His
key areas of interest include applying advanced data science and machine learning techniques to
financial data. He holds a Masters in Statistics with distinction from the London School of Economics
(LSE) and is a Certified FRM (GARP). You can reach out to Ashutosh on LinkedIn.
vii
1 A Really Brief History of Financial Trading
As of 2018, an estimated 60% to 80% of daily traded US equities (by volume) on average were
accounted for by Automated Trading.1 Algorithmic trading accounts for more than a third of the total
volume on Indian cash shares and almost half of the volume in the derivatives segment.2
In this chapter, we will take a little peek at the history of financial trading and at the events that shaped
the current trading and investing landscape.
New asset classes began to be traded over time encompassing stocks, bonds, currencies and
commodities. By the eighteenth and nineteenth century, these practices spread across continents and
into the major financial capitals of the world.
This setup consisted of brokers and traders being physically present in the pit and shouting prices at
which they were willing to buy and sell. Participants used hand signals to convey their intentions to
other traders and execute the trades.
1
1.3 Growth of Financial Markets in the Twentieth Century
The story of the financial markets is the story of the changing economy. The ‘open-outcry’ model
gradually began to give way to telephone trading and eventually to electronic trading.
Computerization of the order flow in financial markets began in the early 1970s, with some landmarks
being the introduction of the New York Stock Exchange’s “designated order turnaround” system (DOT,
and later SuperDOT), that routed orders electronically to the proper trading post, to execute them
manually. The “opening automated reporting system” (OARS) aided the market specialist in determining
the market clearing opening price (SOR; Smart Order Routing).
In 1981, Michael Bloomberg, who was a general partner of Salomon Brothers, was given $10 million as
partnership settlement. Having designed in-house computerized financial systems for Salomon
Brothers, Bloomberg built his own Innovative Market Systems (IMS). Merrill Lynch invested $30 million
in IMS to help finance the development of the Bloomberg terminal computer system and by 1984 IMS
was selling machines to all Merrill Lynch clients. This led to the development of the famous Bloomberg
terminal that is being widely used by traders till date.
By 1998, the US Securities and Exchange Commission (SEC) authorized electronic exchanges paving the
way for computerized High Frequency Trading (HFT). HFT was able to execute trades more than a
thousand times faster than a human.
The year 2011 took the latency game in trading to another level. A firm called Fixnetix developed a
microchip that could process orders in 740 nanoseconds (one nanosecond is one billionth of a second).
A $300 million transatlantic cable was built in 2015 just to shave 0.006 seconds off transaction times
between New York City and London.
3 https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3743071/
4 https://www.technavio.com/report/global-algorithmic-trading-market-analysis-share-2018
2
With HFT came the concept of co-location. Co-location essentially means that computers owned by HFT
firms and proprietary traders are kept in the same premises as the exchange’s computer servers. This
enables HFT firms to access price data a split second faster than other market participants. Co-location
has become a lucrative business for exchanges, which charge HFT firms millions of dollars for the
privilege of “low latency access”.
To cater to the demands of the HFT industry, companies like CoreSite offer a service where traders can
install “co-located” computers right in the heart of Washington DC.
The idea is to get access to federal data milliseconds faster than those traders waiting patiently for it to
travel at the speed of light up the fiber optic lines to markets in New York, New Jersey and Chicago. All of
it—the information’s transmission, translation, and trading in a journey from Washington DC to market
servers in New Jersey, New York and Chicago happens faster than the speed of human thought.
It takes a person 300 milliseconds to blink an eye. But the firms involved in this telecommunications
arms race view a single millisecond as a margin of victory or defeat.
The monitoring of social media by the FBI and the virtually instant impact of social media reactions on
security prices led the SEC to place restrictions on public company announcements through social media
in April 2013.
Just two days after this, Bloomberg Terminals incorporated live tweets into its economic data service.
Bloomberg now even has a tracker called Bloomberg Social Velocity (BSV) that tracks abnormal spikes
in chatter about specific companies on social media.
A noteworthy example of the impact of tweets on stock markets is from 23rd April 2013. On that day, a
tweet sent from a hacked Associated Press Twitter account said “Breaking: Two Explosions in the White
House and Barack Obama is injured”. Immediately the Dow Jones index plummeted 143 points (1%) in 3
minutes. Associated Press issued an urgent clarification about their account being hacked and the news
being fake after which the markets recovered in six minutes.
In 2019, a note by Bank of America said that since 2016, there is a high correlation between negative
stock market returns and the days on which US President Trump tweets frequently.5
5https://www.cnbc.com/2019/09/03/on-days-when-president-trump-tweets-a-lot-the-stock-market-falls-investment-
bank-finds.html
3
2 Terminology
A critical part of understanding and engaging with any field of study is to learn its field-specific
vocabulary. This is applicable to quantitative trading just as much as it is to medicine or quantum
mechanics or a programming language. Once we understand the semantics of quantitative trading, we
will be able to do two things. One, to read and appreciate books, articles and other works on it without
getting too bogged down with unfamiliar jargon—two, to reason critically and communicate
meaningfully with members of the quant trading community.
This chapter introduces some basic terminology and lays a foundation for subsequent chapters and your
life in quantitative trading.
In algorithmic trading, the trades can be placed into the market either manually or by semi/fully
automating the order placement and execution process.
The key feature of algorithmic trading is the lack of human intervention in making trading decisions.
Automated trading (or fully automated trading) is a subset of algorithmic trading wherein computers
are used to generate the trading signals and to manage the flow of orders in the markets without human
intervention.
One of the major benefits of using a quantitative approach is the removal of subjectivity, as the decisions
are based on quantifiable information.
Quantitative models can incorporate elements from both technical as well as fundamental analysis. For
instance, one can design a quantitative model based on the cross-over of technical indicators such as RSI
or Bollinger bands. Someone else with a good understanding of fundamental data such as stock earnings
can design a quantitative model to incorporate these numbers. Examples of quantitative systems include
various momentum, mean-reversion and statistical arbitrage-based strategies. We will see a couple of
examples of a quantitative trading strategy later in this book.
4
More often than not, quantitative strategies are employed in an algorithmic or automated way.
Additionally, the usage of these terms and the meanings ascribed to them by different writers have been
a little uneven. So, the terms ‘algorithmic trading’, ‘quantitative trading’ and ‘automated trading’ are
used interchangeably in many places including here.
To be competitive in the HFT space, the participants need to minimize the time it takes to send orders
and execute trades, also called ‘latency’. This means heavy investments in the infrastructure in terms of
hardware, network connectivity and co-locating the servers in the exchange premises. Co-location
means that your server is in the same premises and on the same local area network as that of the
exchange. Most exchanges provide colocation facility nowadays.
Higher costs of HFT presents barriers that are simply too high for some retail traders. This type of
trading is particularly popular with trading and market-making firms with substantial budgets at their
disposal.
When talking about a trading system, we try to be specific and answer the following questions with
respect to entering and exiting a trade:
For example, if a trader wants to be invested in the technology sector, she may decide to buy certain
individual stocks in that sector or buy a technology index. The same could also be achieved by buying
derivatives such as options and futures on the stocks of technology companies.
All these different instruments carry different risk and reward profiles. One has to select what to trade
in, based on prior knowledge, risk/reward expectations and risk appetite.
5
When to Buy/Sell?
One has to specify the conditions under which a trade will be entered into. The conditions and timing
have to be clearly specified before trading starts. For example, a trader might decide to buy the S&P 500
index at the start of the fourth day, if it has closed negatively for the previous three successive days.
By an alpha-seeking strategy, we mean a profitable trading strategy that can consistently generate
returns over and above the risk-adjusted returns. To the layperson, quantitative trading strategies can
appear inscrutable and hence algo trading is often called ‘black box’ trading.
Quants comes in different stripes depending on the role and the organization they work for. They are
usually employed to create, validate and optimize different pricing and risk management models by
investment banks, hedge funds and other financial institutions.
There are many trading styles and hence many types of traders. For example, a technical trader is one
who relies on past patterns in the data to make trading decisions whereas a fundamental trader bases
her decisions on fundamental factors such as the quality of a firm’s management, its earnings etc.
Manual or discretionary traders execute their trades themselves based on a mix of trading rules and
experience. Proprietary traders (or prop traders), in general, are traders who use the capital of a
proprietary trading firm or a brokerage firm to trade and take a cut from the profits. Retail traders
usually sit in the comfort of their homes and take positions in the markets.
Market makers profit by charging higher offer prices than bid prices. This difference is called the spread.
The spread compensates the market makers for the risk inherited in such trades. To be clear, the risk
they ride is the price movement against their own held position.
For example, a market maker may purchase 1000 shares of IBM for $100 each (the ask price) and then
offer to sell them to a buyer at $100.05 (the bid price). The difference between the ask and bid price is
only a nickel, but by trading millions of shares a day, she manages to pocket a significant chunk of
change to offset her risk.
Traditional market makers are usually under contractual arrangements with the stock exchange to
provide these services. This increases liquidity and makes that exchange an attractive platform for
transacting. High frequency traders can also act as market makers and play a vital role in the overall
ecosystem.
Market makers are known by different names. Earlier in the eighties, market makers were called jobbers
on the London Stock Exchange. On the New York Stock Exchange, they were known as 'specialists’
earlier but are now referred to as Designated Market Makers.
A high frequency trader could also be a market maker and perform quantitative analysis at the same
time. So, a trading strategy could be using quantitative methods, but the trader may be executing it using
automated systems or semi-automated systems or manually.
There can be a significant overlap or distinction in terms of who does what while trading and hence
knowing the context is important.
7
3 Why Go Algo: The Case for Algorithmic Trading
A natural question that crosses the minds of budding and even expert discretionary traders is why one
should choose automation and develop quantitative trading skills.
In this chapter, we will discuss the advantages and drawbacks of algorithmic/automated trading and
answer the above question.
Accuracy
Machines are accurate every single time it comes to dealing with operational aspects of trading. For
example, while filling in the order details, humans can commit errors due to loss of concentration or
other factors. Some of the most significant losses in trading history have happened due to what traders
call a 'fat-finger', which is just another name for sending in an incorrect or unintended order ticket by
mistake.
8
Backtesting
Automation is not only limited to the execution of trades but is widely used for validating strategies. Any
strategy used in live markets is tested and tried on historical data to evaluate its performance. This is
called backtesting the strategy. Backtesting gives vital feedback about the past performance of the
strategy.
Now let us discuss some drawbacks and constraints of automated trading to get a fuller picture.
Infrastructure Costs
The infrastructure required for an automated setup can act as the other barrier to entry.
High performance computers, robust network connectivity, power backups, and maintaining reliable
hardware including servers can lead to substantial overheads. For HFT, the costs are even higher due to
the additional cost of colocation, leased line & other types of network connectivity, etc.
With the advent of cloud computing and affordable managed private servers, these costs are dropping.
However, this is an overhead one should be cognizant of.
Mental Makeup
A lot of traditional discretionary traders are habituated to controlling their trades or acting on their
instincts. They are unable to trust a computer program to do the job. This makes it tougher for them to
make the transition.
Some think that algo trading involves just setting it all up and going on a vacation. With a heavy heart,
we must inform you that this is a misconception, as an algo trading system requires considerable
oversight. An algo trader still must monitor the performance of the algorithm periodically and needs to
tweak it if the market conditions change significantly. It is essential to monitor any major deviations
between the model and the actual performance and to ensure that the system is behaving as expected.
9
Underestimating the Role of Humans in an Automated Trading Environment
Given the advantages of automated trading, one might conclude that machines have made humans
completely obsolete in an automated trading setup, but this is far from the truth. Algorithmic trading is a
means of efficient allocation of tasks to resources that are most capable of performing them.
Although humans can't beat computers in many tasks related to efficiency, speed or accuracy, there are
certain tasks where humans are superior.
Humans have the creativity to look at the markets in ways a machine cannot. They can respond to
situations which have not been anticipated or planned for and hence not programmed into the
computer.
● Brokerage firms
● Hedge Funds
This has had a domino effect on each other as these institutions are interconnected which makes it even
more imperative for retail and discretionary traders to start acquiring quantitative and technical skills.
11
4 System Architecture of an Algorithmic Trading
System
This chapter can be a little heavy on technical jargon for some of our readers. We still recommend going
through the whole chapter once and revisiting it occasionally to further your understanding.
The data from the exchange or external data vendors is received by the market data adapter (MDA)
module. The market data that is received typically provides the system with the latest snapshot of the
order book. It might contain some additional information like the volume traded until then, the last
traded price and quantity for a stock. However, to make a trading decision, the trader might need to look
at historical values or derive certain indicators from past data. For such needs, a conventional system
would have a database to store past market data and tools to analyze it. It would have another database
for storing the trading decisions. Lastly, there is a GUI interface for the trader to view all this information
on the screen.
The entire trading system can be broken down into three parts:
● The server
12
Thus, the traditional system architecture would look like:
The architecture shown above is often sufficient to carry out low to medium frequency automated
trading. The difference, however, is that the human trader is replaced by the machine, which makes its
own trading and execution decisions.
So, there is a need to adapt and develop various parts of the architecture to reduce this latency and deal
with the increased scale and complexity. Let us now see how this process unfolds.
Any algorithmic trading system, at its core, is a computational block that interacts with the exchange on
two different streams, first, to receive market data from the exchange and second, to send order
requests and receive replies from the exchange. All the computations related to the strategy must
happen between these two interactions. Thus, any automated trading system consists of three major
components which are shown in the diagram below:
13
Market Data Adapter (MDA) for Data Feed
The Market Data Adapter receives the data from the exchange or the data vendor in their own respective
formats. The algorithmic trading system may not understand that format. The exchange provides an API
which allows the user to program and create her own adapter to convert the data format into one that
the system can understand.
In the algorithmic trading system, we define a complex event as a set of incoming events that cause the
order book to change. These include stock trends, geopolitical events, news or change in market
conditions etc. The HFT algorithm would usually react to such events and place or cancel orders based
on them. Complex event processing is performing computational operations on the incoming events in a
short time. The operations can include detecting patterns, building correlations and relationships such
as causality and timing between many incoming events.
In a fully automated HFT architecture, the decision-making moves from the trader side application to a
complex event processing server (CEP). CEP systems process events in real time. The faster the
processing of events, the better a CEP system is.
The two primary components of any CEP system are the CEP engine and the set of CEP rules. The CEP
engine processes incoming events based on rules. These rules and the events that go as an input to the
CEP engine are determined by the trading system (trading strategy) applied.
A separate calculation engine can be attached to the CEP to which it offloads computationally intensive
calculations. For example, suppose a hundred different trading strategies are being run over a single
market event. In this case there might be computations common to all of them such as the calculation of
greeks for options. If each strategy were to run independently, each unit would do the same
computation and wastefully using up processor resources. In order to cut redundancies of this nature,
such computations are typically hived off to the said calculation engine.
14
A quant will spend most of her time on the CEP system block formulating trading strategies, running
backtests, optimizing parameters, and position-sizing among other things. This ensures the viability of
the trading strategy in real markets.
No single strategy can guarantee everlasting profits. Hence, quants and algo traders are required to
monitor and fine-tune existing strategies on a regular basis and to come up with new ones when needed
to maintain an edge in the markets.
Let’s now take a slightly different and more detailed view of the architecture of an automated trading
system. We will then closely inspect some of its key blocks.
15
Thus, there are two places where Risk Management is handled in algo trading systems:
1) Within the trader-side application – We need to ensure that wrong parameters are not set by the
trader.
2) Before generating an order in OMS – Before the order flows out of the system we need to make
sure it goes through some risk management system. This is where the most critical risk
management check happens.
The presence of standard protocols makes it easy to integrate with third party vendors, for analytics or
market data feeds as well. As a result, the market becomes very efficient as integrating with a new
destination/vendor is no more a constraint.
In addition, simulation becomes as easy as receiving data from the real market and sending orders to a
simulator is just a matter of using the FIX protocol to connect to a simulator. The simulator itself can be
built in-house or procured from a third-party vendor. Similarly, recorded data can be replayed with the
adaptors being agnostic to data being a live feed or pre-recorded.
Incorporating these two aspects, our system architecture now looks like this:
16
We show above an indicative design of an automated trading system. Organizations create their own
custom designs based on their requirements and the exchanges they are dealing with.
17
5 A Stepwise approach to Algorithmic Trading
This chapter takes you through the various steps in the development of an algorithmic trading strategy.
To design a hypothesis which can be tested, one needs to determine the specifics such as
● The markets (Equities/ Equities Index/ Bonds/ FX or Commodities) and instruments (asset
itself/ Futures/ Options etc.) to trade in.
● The rules or the strategy itself: These involve the trigger that will cause us to enter or exit a
trade, the reasoning for setting stop loss and take profit levels.
For example, a trader might think that following certain rules, money can be made in the crude oil
market. This might involve buying crude oil futures in one exchange based in London and selling them
on another exchange based in New York. Such specifics need to be predetermined.
In case you don’t program, you can always hire someone to do it for you. It is also possible to use
software tools that allow you to build your strategy, within defined complexity constraints, with
minimal code writing. Such functionalities are increasingly being integrated within trading platforms,
which may be offered to you by your broker or through a software vendor.
5.3 Backtesting
Backtesting is the process of validating our strategy by testing its performance on historical data. It
helps us to gauge the past performance of the strategy. Backtesting also gives us the opportunity to
optimize the strategy parameters.
18
Through backtesting, we can measure strategy performance based on certain metrics such as dollar PnL,
percentage of profitable trades, Sharpe ratio (a measure of risk-adjusted returns), maximum drawdown
(maximum fall in the value of the asset from a peak value), etc.
Algorithmic traders spend most of their time researching and backtesting their trading strategies using
historical market data and other datasets as required by the strategy.
One of the aspects to be considered in backtesting is the ‘backtesting window’ or how far back in the
past should we go to test our strategy. In the case of HFT, we generally don’t go back to even the past 5
or 10 years of data because the market microstructure changes much faster. For example, if you are
trying to backtest a simple strategy on data from 2007 when algorithmic trading was not allowed in
India, then the results that we get will not be very useful. Typically, the backtesting window for high
frequency trading strategies is short compared to the backtesting window for low frequency strategies
that may range from a few years to few decades.
These days there are various platforms available which provide functionalities to perform backtesting
on historical data. The important points to consider before selecting a backtesting platform are:
Backtesting allows us to test our strategies before actually implementing them in the live market.
However, the maxim ‘past performance does not necessarily guarantee future returns’ should be kept in
mind while backtesting.
In the latter case, our next goal is to optimize the strategy parameters. We need to keep in mind that our
strategy should work well on out-of-sample data (new data or live trading data) and avoid ‘overfitting’.
Overfitting means that our strategy parameters have been fine-tuned to maximize profits on historical
data that we used to build and backtest our strategy but will perform poorly on new or live data.
To avoid this issue, we need to forward-test our strategy on real market data (but NOT in the real
market!) in a demo account. Most of the algorithmic trading platforms come with a simulated
environment that you can use for this kind of forward testing. This is the same as doing paper trading
using real or live market data. Paper trading involves simulating the performance of the strategy by
noting down positions and PnL, instead of actual buying and selling. Once you're satisfied with the
strategy performance, you can finalize it along with the optimized parameters.
19
5.5 Live Execution and Risk Management
Once you are satisfied with your algorithm, let it do its job in live markets! Deployment in the real time
environment requires multiple aspects to be managed. Although the computer takes care of the
execution part, an algo trader needs to keep an eye on the following aspects:
● Market Risk
Monitor the performance of your algo continuously in terms of profit and loss (PnL). If the
algorithm is not performing as expected, then you would need to review the logic used or tweak
the strategy parameters.
● Operational Risk
Operational factors such as the connection with the broker/exchange API and robust hardware
play an important role in our success, so we should keep an eye on these factors and perform
regular checks. We should plan to deal with all the things that can conceivably go wrong. For
example, if the power goes out when a large number of orders are pending, then how should we
go about handling this situation? Also, there can be a situation where an individual or a group of
individuals try to manipulate the markets by sending orders that are declared to be illegal by the
exchange. A good system must have risk checks for all such scenarios and raise flags/alerts in
such cases.
● Regime Changes
We have to keep an eye on the larger economy/sector for structural shifts, also called regime
changes. In case of a regime change we might have to alter or scrap our strategy altogether. For
example, say, a trader wants to test a strategy based on the notion that Internet IPOs outperform
the overall market. If you were to test this strategy during the dotcom boom years in the late
90s, the strategy would outperform the market significantly. However, trying the same strategy
after the bubble burst would result in dismal returns.
In short, we need to invest time, effort and resources in research and development to make our
algorithms and systems more competitive and up to date. We should look to enhance and update both
our domain knowledge and technical skills required to act on that knowledge/information.
20
6 The Elements of Algorithmic Trading
Success in algorithmic trading is determined not only by your quantitative skills but also the process and
the tools you select for analyzing, devising, and executing your strategies.
In this chapter, we discuss some of the essential aspects one needs to take care of before starting to
trade quantitatively.
It is essential that the data we get and use in our analysis is ‘high quality’ which means it should be:
● Consistent
● Reliable
● Unbiased
Trading and market data can be obtained from the broker and in some cases directly from the exchange.
Historical data for backtesting and analysis can be obtained from the exchanges, data vendors or from
the financial portals that give access to historical market data.
For real-time market data, depending on geography and exchange, a trader can get it from the broker for
free or at a cost. In case one can’t get it from the broker, it can also be obtained from the
exchange/vendors. Live market data from the broker or vendor can be streamed using their respective
APIs. But one needs to check for the lag that might occur due to network latency. Also, some exchanges
in certain geographies charge an additional fee (called exchange data fee) to access or stream market
data.
Some data vendors provide data-feed only, while others provide charting platforms and other analytics
for creating watch lists, tracking different markets, strategy development, generating buy/sell signals,
etc. A trader can connect to such platforms with her broker’s platform via a bridge, and have the orders
executed. Data vendors usually list the broker partners on their websites, and the compatibility of their
feed with different charting platforms.
Although there are a few sources for free financial data, one should use them with caution. There is the
problem of data granularity. Most free sources provide daily price data only, whereas we might require
data at much shorter time intervals to conduct our analysis and backtest our strategies.
Here is a list of some free and paid data vendors for reference:
Free Sources:
● Yahoo Finance
21
● Google Finance
● FXCM
● Quandl (free)
● Bloomberg
● Global Datafeed
● Trading Economics
● Thomson Reuters
● Quandl (paid)
OHLC data can be easily visualized in the form of ‘candles’ for trading or analysis purposes. Each
candlestick in a candlestick chart is used to describe high, low, opening and closing price movements of
a security, derivative, or currency for a specific period.
The color scheme of the candle represents whether the price has gone up or down in the period for
which candles are formed. For e.g. if we are looking at a chart of 5-minute candles for the price of a
stock, then a green candle represents that the stock has closed at a higher price compared to the opening
price in that 5-minute window. The color schemes may vary in charts from different sources.
22
6.2.2 Levels of Data for Trading
The market data that the exchange shares with market participants for trading typically contains the
following basic information:
● Best bid price: highest price among the various participants bidding to buy
● Best ask price: lowest price among the various participants offering to sell
Level 1 data includes the Best bid and Best ask, plus the Bid size and the Ask size.
Level 2 provides market depth data up to 5 best bid and ask prices and level 3 provides market depth
data up to 20 best bid and ask prices.
23
6.2.3 Snapshot Data
The snapshot of the top ‘n’ buy and sell prices in each instrument are provided to all market participants
every ‘t’ time frame. The market participants are thus totally in the dark between two snapshots.
However, if the time frame is very small like half of a second, it would be good enough for basic level of
trading.
● Brokerage cost
● Speed and reliability of the trading platform (if offered by the broker)
24
Some brokers provide APIs in Python and other programming languages to connect with them after
authenticating your credentials.
As an algorithmic trader, you can execute your strategies in live markets via charting platforms that
connect to your broker or through the gateway APIs offered. The available APIs are usually listed by the
broker on their websites.
Some brokers offer platforms which are a set of simple HTTP APIs built on top of their exchange-
approved web based trading platform. This enables users to gain programmatic access to data such as
profile and funds information, order history, positions, live quotes, etc.
In addition, it enables users to place orders and manage portfolio at their convenience using any
programming language of their choice (such as Excel VBA, Python, Java, C#).
Thus, for a prospective trader it is essential that she gets herself acquainted with the workings of an API
and other relevant features offered by the broker’s platform.
Some of the popular brokers and vendors for the Indian markets include:
● Interactive Brokers
● MasterTrust
● Composite Edge
● Zerodha
External Platforms
Your broker might provide you with its own trading platform as discussed in the previous section. If that
is not the case, then you can use an external trading platform and pay for it separately. These days there
are various trading platforms available with advanced charting, analytics and backtesting features. Some
popular trading platforms among traders include:
● NinjaTrader
● AmiBroker
● TradeStation
Before subscribing to a platform, it is also vital that a trader understands the pricing policy, as these
platforms in addition to the software charges can also charge for data-feed, exchange fees, and third-
party add-ons separately. A trader should choose a platform based on her trading style, features and
pricing.
25
6.4 Programming
Algorithmic trading involves devising & coding strategies by analyzing the historical/real-time data
which is procured from the data vendors. Some of the trading platforms mentioned above have their
own scripting language which can be used for coding & backtesting strategies in the platforms itself.
Algorithmic traders around the globe use Python, R, Java and MATLAB extensively for trading on trading
platforms. There are hundreds of external analytical packages that can be used in these languages, which
aid in developing various trading strategies. Traders use external wrappers to implement codes into the
trading platform.
It is vital to have sound programming knowledge to trade successfully in the markets. Algo trading
aspirants must learn not only the basics of programming, but also to devise different strategies for
various markets using these languages.
A trader can purchase a suitable workstation based on her requirements (i.e. trading frequency, strategy
complexity, etc.), or by consulting someone with sound knowledge of computer hardware & technology.
One can add multiple screens to the system if required. In case of HFT, it is advisable to go for best-in-
class equipment only.
All market participants (banks, investment firms, funds, agents, brokers, traders, systems, etc.)
operating in a given country must adapt to them, and the country’s regulatory agency is responsible for
enforcing and supervising the participants’ compliance.
For example, In India, there are well-defined rules that are laid down by SEBI and the exchanges relating
to algorithmic trading. In Europe, the regulators have introduced new regulations in the last few years
which have had a considerable impact on the trading industry as a whole. These regulations include
MiFID2 (Markets in Financial Instruments Directive), MiFIR (Markets in Financial Instruments
Regulation) and MAR (Market Abuse Regime). They are an attempt to update the regulation to new
technological advances and although the scope is Europe, it has common aspects to other countries or
serves as a reference to others as well.
In case a trader is trading through a broker, she must consult with the broker and get the required
approvals before automating strategies using any platform.
Asia
27
7 Algorithmic Strategies
In this chapter we give you a high-level understanding of the concepts behind some popular algorithmic
strategies along with some examples. We begin with momentum trading and the moving average
crossover strategy. Then we discuss the statistical concept of mean reversion and how it can be used to
devise trading strategies like pairs trading. Lastly, we briefly discuss the role of machine learning and
Artificial intelligence in trading.
Traders spend a lot of time and effort to determine the strength of these trends, before they take a
position to ride them.
There are various technical indicators that have been designed to gauge the strength and direction of
these trends using different approaches. Examples of such indicators include:
● Stochastic oscillator
Different automated trading strategies can be designed using these indicators and the current price
series of the asset. We will now discuss one of the most common examples of momentum based
algorithmic trading strategy called “Moving average crossover” strategy.
28
7.2.1 Simple Moving Average
Simple Moving Averages are the averages of a series of numeric values. They have a predefined length
for the number of values to average at each step called the ‘window size’. Given a series of numbers and
a fixed window size, the first element of the MA series is obtained by taking the average of the first
subset of the number series whose size equals the window.
The next value in MA series is obtained by averaging the set of values when the window moves by one
place i.e. excluding one data point from the left and including one from the right and so on.
Consider the example mentioned below to understand the calculation of simple moving averages. Let
the average be calculated for five data points (fixing the window size as 5).
Daily price series for an asset: 7, 12, 2, 14, 15, 16, 11, 20, 7, 10, 23
Then, the first value of the MA series is the average of first 5 data points= (7 + 12 + 2 + 14 + 15) / 5 = 10
and so on.
Let us look at a simple example of a moving average crossover strategy on the NIFTY index (a major
Indian equity index).
The strategy involves moving average indicators of different durations. An average of the shorter look-
back window is called SMA and the one with the longer look-back window is called LMA. Popularly used
SMA-LMA pairs include 20-40, 20-60 and 50-200. We show below the SMA-LMA plot along with the
adjusted close price for Nifty.
29
Trading rules are simple. Buy the asset when the SMA crosses above LMA and sell the asset when SMA
crosses the LMA from above. The idea is to capture the trend and profit from it as discussed above.
In terms of the coding logic, we shall buy the asset when SMA(today) > LMA(today) and SMA(yesterday)
< LMA(yesterday). Similarly sell the asset when SMA(today) < LMA(today) and SMA(yesterday) >
LMA(yesterday).
The parameters of this strategy are the SMA and LMA lookback windows that need to be optimized. For
example, 20-day SMA and 50 day LMA pair (20-50) may perform better than a 15-50 pair. Decisions
about strategy parameters can only be taken after backtesting the strategy on past data and forward
testing it on real time data.
Such strategies can be easily coded, visualized, backtested and executed using programming languages
such as Python.
30
Consider a hypothetical example of a commodity whose price has stayed around USD 100 per tonne for
the last ten years. Now, if one day it’s price increases by USD 40 without any significant news or factor
behind this rise, then by the principle of mean reversion, we can expect the price to fall in the coming
days. In such a case, the mean reversionist would sell the commodity, in anticipation of the price falling
in the following days. She would make profits by buying back when the price has fallen back to its mean
of USD 100. The risk involved in this trade is that the price may keep drifting away from the mean or
stay away from the mean longer than a trader can hold her position.
Loosely speaking, a time series is stationary if its mean and variance are time invariant (constant over
time). A stationary time series will be mean reverting in nature, i.e. it will tend to return to its mean and
fluctuations around the mean will have roughly equal amplitudes. A stationary time series will also not
drift too far away from its mean.
A non-stationary time series, on the contrary, will have a time varying variance or a time varying mean
or both, and will often not revert back to its mean.
In the following diagram the blue line represents a non-stationary time series, whereas the red line
represents a stationary time series.
31
In the financial industry, traders take advantage of stationary time series by placing orders when the
price of a security deviates considerably from its historical mean, speculating the price to revert back to
its mean.
For example, let us consider the stocks of two oil companies A and B, which are fairly similar in terms of
size, company structures, markets and risk exposures. After quantitative analysis, we have observed that
the spread between the prices of these stocks has remained fairly constant with a mean of zero in the
past five years, with occasional divergences. We have performed statistical tests that have confirmed
that the two price series are cointegrated i.e. the spread is mean reverting.
32
spread=(Price of stock A) - (Price of stock B)
We devise our strategy such that buy and sell signals (for the spread) will be generated if the value of
breaches is -2 and +2 respectively.
33
Now suppose suddenly the price of stock A increases considerably without any apparent reason or
market news, whereas stock B continues to trade around its original price. This increases the spread
between the two securities, significantly away from its mean value of zero to a value of +2.5.
According to our strategy we need to sell the spread. To do so, we can then sell the overpriced asset (A)
and buy the underpriced asset (B) to enter into a pairs trade and wait for the spread to come back to its
historic mean value of 0.
This strategy can easily be automated using a programming language such as Python. We can write a
program to fetch price data for different stocks and conduct co-integration checks using available
libraries and functions. Then, we can generate trading signals to buy the underpriced security and sell
the overpriced security, when the spread breaches some threshold values. We can also set appropriate
stop-losses and profit booking commands in place.
34
8 Careers in Algorithmic Trading
This chapter addresses some common concerns of individuals who want to make a career in algorithmic
trading. It also discusses ways to build a career in the field.
In the past, entry into the quantitative trading domain used to be heavily tilted towards PhDs in the hard
sciences like Physics, Mathematics, or Engineering.
However, in recent years, there are a surfeit of alternative choices that are available. You have Masters’
programs in quant finance, financial engineering, etc. offered by universities worldwide and similarly
structured online courses offered elsewhere. The latter has the added benefit of flexibility and
affordability.
At QuantInsti, we have crafted the EPAT specifically to train aspiring algorithmic traders and quants.
The algorithmic trading domain has now opened up for individuals from diverse backgrounds. This is
also reflected in the professional backgrounds of the participants who regularly enroll for the EPAT.
Here’s a breakdown of the professional background of our EPAT participants:
35
8.2 Avenues of Employment
Here are some types of companies that employ quantitative finance professionals:
● High Frequency Trading firms (e.g. IRage capital, DRW, XTX, Citadel etc.)
● Algorithmic trader/HFT trader- Generate and execute profitable strategies for proprietary
trading firms and hedge funds
● Execution Trader - Execute trades for financial institutions such as Investment banks
● Desk Quant - Implement pricing models that are directly used by traders
● Front Office Quants (FOQs) - Develop and manage models for calculating the price of assets on
the markets
36
● Research Quant - Research and create new approaches for pricing
● Model Validation Quant - Implement pricing models to validate Front Office models
● Statistical Arbitrage Quant - Identify data patterns and suggest automated trades based on the
findings
● Capital Quant - Model the bank’s credit exposures and capital requirements
In addition, quantitative skills are also in huge demand for risk management profiles in various financial
institutions.
Trading Philosophy
We need to decide on the trading philosophy we’ll adapt. The most common trading philosophies
include execution-based strategies where the focus is to get the best price for execution rather than
focusing on Alpha. Then there are High frequency strategies which are extremely latency sensitive and
mainly include market making, scalping, and arbitrage. Then there is market sentiment based, machine
learning based and news-based trading algorithms which can be relatively less sensitive to latency as
compared to HFT.
37
Access to Market
There are different kinds of memberships which exchanges offer- clearing members, trading members,
trading cum clearing members, professional clearing members, etc. If we don’t want to go for direct
membership in the exchange, we can also go through a broker. This involves lesser compliance rules and
regulatory requirements. However, the flip side is that we have to pay brokerage and most HFT
strategies are highly sensitive to transaction cost.
Infrastructure Requirements
Main focus areas under this head are colocation, hardware, network equipment and network lines.
Colocation means that your server is in the same premises and on the same local area network as that of
the exchange. Most exchanges provide colocation facility now. In some cases when exchanges do not
provide colocation facility, there are vendors who provide co-location or proximity hosting facility. Since
everything related to individual retail trading is connected over the internet, one needs to pay attention
to opt for the best network connections to trade fast that are capable of providing really fast speeds,
without any breaks, disturbances or shortfalls. For professional traders, it is advisable to go for leased
line connections with the relevant exchange(s).
Risk Management
While manual trading mostly deals with market risk, algorithmic trading has a high degree of
operational risk in it. The primary reason being that the machines do not possess the power of common
sense that a human mind has. So, we have to make sure that there is common sense in algorithms before
we take them to the market. Also, exchanges give a detailed checklist of risk management parameters
that one must adhere to before starting to trade algorithmically.
38
9 Learning Algorithmic Trading
The global algorithmic trading market is growing rapidly, with a rising need for individuals familiar with
its inner workings.
This chapter will serve as a beginners’ guide to the skills one needs to develop to trade algorithmically.
We will also discuss the means and resources that can be used to do so.
Key Skills
Algorithmic trading is an interdisciplinary field which requires knowledge in multiple domains. Here is a
list of vital skills and knowledge you need to develop.
● Quantitative Analysis
● Programming
● Data Management
● Risk Management
Quantitative Analysis
With so much of financial data being generated each day, a good grip on key topics (we spell that out
further ahead) in math and statistics are a prerequisite to any kind of quantitative analysis.
Some of the topics that you should build on in no particular order are : Probability, Calculus, Linear
Algebra, Inferential Statistics, Financial Econometrics including Time Series Analysis.
39
Programming
In 2019, if one is associated in any shape or form with the knowledge economy, not having basic
programming skills can be a disadvantage. A quantitative trader uses programming at one or more
stages (such as formulating and testing hypotheses, data download and manipulation, back-testing,
execution) in the trading workflow depending on her comfort with the tool. In our land of quantitative
trading, Python is arguably the most popular programming language and a great place to get initiated
into programming if you’ve never done it before.
That being said, the requirements of the job profile and the trading system one uses will affect the choice
of programming language one would prefer to learn. For a retail level algo trader, an open source
language like Python or R are the preferred choices. On the other hand, for a trader working in HFT,
lower level languages like C or C++ are the way to go.
The best way to learn to program is by writing code. We enlist some of our favorite resources in the
recommended reading section to get you started.
One way to consider this is to learn the ideas pertaining to what we want to trade in. The list below
should give you a flavor of what we mean:
● Asset and derivative pricing models (for e.g. Black Scholes option pricing model, CAPM etc.)
● Risk management (metrics to monitor risk such as VaR limits, position limits etc.)
Data Management
Getting access to quality data is important for any kind of trader. While there are ample sources of data
available for daily price data, access to historical intraday data can be restricted. It is important to
understand the patterns of data from across various markets and exchanges across the globe. One of the
most important tasks for a trader/analyst is cleaning the data, structuring it to be uniform with the
database (e.g. converting integers, floating decimals, etc.), and then using it to identify patterns, create
and optimize strategies.
40
Risk Management
Trading strategies will help us to make money, but the risk management system is the one that is
responsible for preserving it. In any kind of trading, market risk is something that a trader tries to
mitigate through various means. In the case of automated trading, mitigating operational risk takes
center-stage. We often tell our EPAT course participants that when you are trading manually, you have a
very powerful risk management tool with you, which is common sense. When it comes to a machine, that
critical part is missing, and you have to take care of that by carefully adding the appropriate risk checks
in your strategy and overall code base.
Simply speaking, machine learning is the science of deriving insights from data using statistical models.
For example, linear regression is a low-level machine learning algorithm in which the machine learns
the relationship between two variables based on some statistical criterion.
Today we have much more complex methods and algorithms, such as artificial neural networks (ANN)
and ensemble learning methods such as random forests.
ML and AI are increasingly being used in designing quantitative strategies for trading.
These tools are being used in new and creative ways to model the market movements. For example, a
collection of satellite images of oil tankers at sea can be used to predict movements of crude oil prices.
Social media feeds data is increasingly being used to gauge the sentiments about a particular stock using
the power of Natural Language Processing (NLP), a subset of machine learning.
ML and AI are vast topics unto themselves and one needs to put time and effort to appreciate and gain
expertise in them.
41
In the case of HFT, it is also important to know about the components such as adapters, Complex Event
Processing (CEP) engine, etc.
42
10 Conclusion
In this final chapter, we bust some common myths about algorithmic trading and leave you with some
parting thoughts.
However, it’s still worth your while to get acquainted with statistics, programming and system
architecture gradually to expand your repertoire as an algorithmic trader. Most long-term thriving
practitioners start slowly with what they know and keep picking up skills along the way to improve the
quality and sophistication of their strategies.
Myth 2: Retail Traders can never compete against the technical advantages of
big HFT firms.
The reality is that High Frequency Traders do not compete with retail traders; instead, they compete
amongst themselves. Given that most of the markets are made (market-making) by HFT desks, and since
they target collecting a few pennies on average per trade, any sudden event/news can cause significant
losses. Being in a colocation facility and using other forms of technology ensures that they can update
their orders to the fair price within a very short time. This ensures that they can offer much better
quotes, resulting in significant savings in transaction cost for an average retail trader.
Thus, the presence of HFT firms potentially benefits the retail traders as the bid-ask spread is reduced,
and they can execute their orders at a better price in general.
Myth 3: Big players exploit every possible market opportunity leaving little
scope for retail investors.
Large firms usually do not seek to exploit market inefficiencies or short-term opportunities if they are
not scalable enough. This creates an opening for retail level traders to design strategies to exploit them.
Also, keep in mind that a big institution whether an HFT firm or a hedge fund has to comply with
investment mandates and regulatory concerns which prevents them from profiting from certain
anomalies they spot. Fortunately, retail investors can capitalize on them.
43
10.2 Parting Thoughts
Over the course of the book, we’ve attempted to provide you a tour of the algorithmic trading domain.
We learned how trading systems have evolved over the years to eventually arrive at the modern
quantitative trading system. While doing so, we walked through what it takes to create viable trading
strategies and touched upon the knowledge and skills needed to be good quant traders. We explained
how the quant trading approach combines contemporary advances in applied computer science (like
high level programming languages, machine learning, artificial intelligence and the like) with financial
markets know-how and big data.
The Reading List, Research Papers and other links that we share below and elsewhere are for you to see
how deep this rabbit hole runs.
Please feel free to reach out to us with your thoughts, feedback, questions or even a hello on
contact@quantinsti.com. We’d love to hear from you.
We hope this book has inspired you to get started on a journey to consistent alpha returns!
44
11 Reading List
11.1 Books
Algorithmic Trading/Quantitative Trading Strategies
● Algorithmic Trading: Winning Strategies and Their Rationale by Chan, E.
● Quantitative Trading – How to Build Your Own Algorithmic Trading Business by Chan, E.
● Algorithmic Trading and DMA: An introduction to direct access trading strategies by Johnson, B.
● High frequency trading: A practical guide to algorithmic strategies and trading systems by
Aldridge, I.
● Systematic Trading: A unique new method for designing trading and investing systems by Carver,
R.
● Trading Evolved: Anyone can Build Killer Trading Strategies in Python by Clenow, A.
● Quantitative Methods for Trading and Investment by Dunis, C.L, Laws, J, Naim, P.
● Algorithmic and high frequency trading by Cartea, Á., Jaimungal, S., and Penalva, J.
● Python Basics, With Illustrations from the Financial Markets by Krishnamoorthy, V., Parmar, J.,
and Pena, P. M.
Market Microstructure
● Trading and Exchanges: Market Microstructure for Practitioners by Harris, L.
● The Handbook of Portfolio Mathematics – Formulas for Optimal Allocation and Leverage by Vince,
R.
Technical Analysis
● Technical Analysis of the Financial Markets: A Comprehensive Guide to Trading Methods and
Applications by Murphy, J.
● Technical Analysis Explained: The Successful Investor’s Guide to Spotting Investment Trends and
Turning Points by Ping, M.
45
● Evidence-Based Technical Analysis – Applying the Scientific Method and Statistical Inference to
Trading Signals by Aronson, D.
Derivatives
● Options, Futures, and Other Derivatives by Hull, J.
● Financial Decision Making Using Computational Intelligence by Doumpos, M., Zopounidis, C. and
Pardalos, P.
● The Elements of Statistical Learning by James, G., Witten, D., Hastie, T. and Tibshirani, R.
● Krauss, C. (2017). Statistical arbitrage pairs trading strategies: Review and outlook. Journal of
Economic Surveys, 31(2), 513-545.
● Jegadeesh, N., & Titman, S. (1993). Returns to buying winners and selling losers: Implications for
stock market efficiency. Journal of Finance, 48(1), 65-91.
● Okunev, J., & White, D. (2003). Do momentum-based strategies still work in foreign currency
markets? Journal of Financial and Quantitative Analysis, 38(2), 425-447.
● Balvers, R. J., & Wu, Y. (2006). Momentum and mean reversion across national equity
markets. Journal of Empirical Finance, 13(1), 24-48.
● Di Graziano, G. (2014). Optimal trading stops and algorithmic trading. Available at SSRN
2381830.
● Jiang, Z. (2016). Currency Returns in Different Time Zones. Available at SSRN 2613592.
● Cartea, Á., Donnelly, R., & Jaimungal, S. (2017). Algorithmic trading with model
uncertainty. SIAM Journal on Financial Mathematics, 8(1), 635-671.
● Takeuchi, L., & Lee, Y. Y. A. (2013). Applying deep learning to enhance momentum trading
strategies in stocks. In Technical Report. Stanford University.
46
● Zemke, S. (2002, July). On developing a financial prediction system: Pitfalls and possibilities.
In Proceedings of the First International Workshop on Data Mining Lessons Learned (DMLL-
2002) (pp. 8-12). sn.
● QuantInsti Blogs
https://blog.quantinsti.com/
● Quantstart.com
https://www.quantstart.com/
● Quantocracy.com
https://quantocracy.com/
● Dr E. P. Chan’s Blog
http://epchan.blogspot.com/
● PyQuant News
http://pyquantnews.com/
47
12 References
https://www.cnbc.com/2018/12/05/sell-offs-could-be-down-to-machines-that-control-80percent-of-
us-stocks-fund-manager-says.html
https://dea.gov.in/sites/default/files/NIFM%20Report%20on%20Algo%20trading.pdf
https://faculty.haas.berkeley.edu/odean/papers/Day%20Traders/Day%20Trading%20and%20Learni
ng%20110217.pdf
https://www.technavio.com/report/global-algorithmic-trading-market-analysis-share-2018
https://www.cnbc.com/2019/09/03/on-days-when-president-trump-tweets-a-lot-the-stock-market-
falls-investment-bank-finds.html
48