Backtesting of Algorithmic Cryptocurrency Trading Strategies.pdf

(2495 KB) Pobierz
Master’s Thesis
Backtesting of Algorithmic Cryptocurrency
Trading Strategies
Jan Frederic Spörer
First supervisor: Prof. Dr. Philipp Sandner
Second supervisor: Vahe Andonians
Submitted by: Jan Frederic Spörer
1
Frankfurt, April 28, 2020
Abstract
This thesis presents a tool for backtesting algorithmic trading strate-
gies for cryptocurrencies. The tool, called
quantbacktest,
provides a
convenient way to automatically run comparisons of multi-dimensional
parameter spaces for algorithmic trading strategies. The tool supports
any algorithmic strategy to be simulated and any parameter spaces to
be tested and optimized with minimal adjustments. Also, arbitrary
trading frequencies can be tested, from intraday to long-term strate-
gies. Many standard return metrics, risk metrics, and robustness test
functionalities come out-of-the-box in CSV format and as diagrams.
Users can provide signals and price data via CSV or Excel files. Signal
processing does not require a technical (code-level) understanding of
the backtesting tool on behalf of the user.
Keywords:
Distributed Ledger Technology, Blockchain, Cryptocur-
rency, Algorithmic Trading, Backtesting
JEL classification:
G12, G17
1
Master in Applied Data Science student at Frankfurt School of Finance & Management | Address:
Hermann-Löns-Straße 5, 57250 Netphen, Germany | Student ID: 8405672 | Email: jan@spoerer.me |
Cell number: +49 171 5395666 | linkedin.com/in/janspoerer
BACKTESTING ALGOR. CRYPTOC. TRADING STRATEGIES
II
1
Acknowledgment
First, I would like to thank my first thesis advisor Prof. Dr. Philipp Sandner
2
,
the head of the Frankfurt School Blockchain Center. Naturally, he gave me domain-
specific guidance; but even more importantly, he connected me with blockchain
practitioners that used the software presented here. The momentum that these
projects caused was vital for me to stay focused and develop
quantbacktest
quickly.
Second, I am grateful to Vahe Andonians
3
, Senior Lecturer at Frankfurt School
and an expert on software development and AI, for agreeing to be the second super-
visor for this thesis. He gave crucial technical guidance concerning time complexity
optimizations of
quantbacktest
and helped me to make critical design decisions.
He drew on his professional experience in algorithmic trading for a hedge fund.
Third, I would like to thank Jian Guo
4
, a fellow student of mine from the
Master in Applied Data Science at Frankfurt School, for his practical contributions
to the source code. He supported me with urgently needed analyses for Immutable
Insight GmbH. Also, he set up the time complexity monitoring for this software and
presented it at a code review event for feedback from other software developers. In
addition to that, he implemented various financial metrics, notably the maximum
drawdown function, capitalizing on his background in the hedge fund industry.
Fourth, I express my gratitude to Immutable Insight GmbH
5
, a startup in the
field of blockchain technology, and its founders Katharina Gehra
6
and Dr. Volker
Winterer
7
. They assigned me the task of performing backtests and hyperparameter
scans on one of their proprietary trading algorithms that will become part of the
Blockchainfonds initiative. I am thankful for the trust and commitment that they
put into this project already at the very beginning of my research.
2
3
frankfurt-school.de/en/home/research/staff/Philipp-Sandner, linkedin.com/in/philippsandner.
andonians.com, frankfurt-school.de/en/home/research/staff/Vahe-Andonians.
4
linkedin.com/in/jian-guo-57390981.
5
blockchainfonds.com.
6
linkedin.com/in/katharinagehra.
7
linkedin.com/in/volker-henning-winterer-17b93ab.
BACKTESTING ALGOR. CRYPTOC. TRADING STRATEGIES
III
Lastly, I would like to thank everyone who was involved with proofreading
and technical advice: Leon Berghoff
8
, Tobias Burggraf
9
, Frederic Herold
10
, Nicholas
Herold
11
, and Sascha Wildgrube
12
.
linkedin.com/in/leon-berghoff-753b52128.
linkedin.com/in/tobias-burggraf-966001138.
10
linkedin.com/in/frederic-herold-182034148.
11
linkedin.com/in/nicholas-h-7518aa128.
12
wildgrube.com, linkedin.com/in/sascha-wildgrube-4135b64.
9
8
BACKTESTING ALGOR. CRYPTOC. TRADING STRATEGIES
IV
2
List of Figures
1
Overview of research coverage of different asset pricing factors for
equity markets and cryptocurrency markets. . . . . . . . . . . . . . .
9
2
3
4
The high-level backtesting workflow in six steps.
The low-level backtesting workflow in three steps.
. . . . . . . . . . . 18
. . . . . . . . . . 19
Standardized and benchmarked (portfolio value = 1 and Bitcoin price
= 1 at
t
0
) equity curve for a white noise (random) strategy with daily
rebalancing, in USD, logarithmic scale.
. . . . . . . . . . . . . . . . 40
5
Standardized and benchmarked (portfolio value = 1 and Bitcoin price
= 1 at
t
0
) equity curve for a 14-day moving average strategy with ex-
ponentially decaying long exposure increases, 14-day moving average
included in the visualization, in USD, logarithmic scale.
. . . . . . . 42
6
Standardized and benchmarked (portfolio value = 1 and Bitcoin price
= 1 at
t
0
) equity curve for a sentiment-based strategy. 14-day moving
average included in the visualization, in USD, logarithmic scale. . . . 44
7
8
A visual example of selection bias.
. . . . . . . . . . . . . . . . . . . 50
Standardized and benchmarked (portfolio value = 1 and Bitcoin price
= 1 at
t
0
) equity curve that serves as an example of out-of-the box
visualizations from
quantbacktest,
in USD, linear scale.
. . . . . . 59
9
10
Heatmap for time interval robustness visualization. . . . . . . . . . . 59
Heatmap for parameter robustness visualization.
. . . . . . . . . . . 60
Zgłoś jeśli naruszono regulamin