13.08.2022 Views

advanced-algorithmic-trading

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Contents

I Introduction 1

1 Introduction To Advanced Algorithmic Trading . . . . . . . . . . . . . . . . . 3

1.1 The Hunt for Alpha . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

1.2 Why Time Series Analysis, Bayesian Statistics and Machine Learning? . . . . . . 3

1.2.1 Bayesian Statistics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

1.2.2 Time Series Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

1.2.3 Machine Learning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

1.3 How Is The Book Laid Out? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

1.4 Required Technical Background . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

1.4.1 Mathematics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

1.4.2 Programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

1.5 How Does This Book Differ From "Successful Algorithmic Trading"? . . . . . . . 8

1.6 Software Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

1.6.1 Installing Python . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

1.6.2 Installing R . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

1.7 QSTrader Backtesting Simulation Software . . . . . . . . . . . . . . . . . . . . . 9

1.7.1 Alternatives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

1.8 Where to Get Help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

II Bayesian Statistics 11

2 Introduction to Bayesian Statistics . . . . . . . . . . . . . . . . . . . . . . . . . 13

2.1 What is Bayesian Statistics? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

2.1.1 Frequentist vs Bayesian Examples . . . . . . . . . . . . . . . . . . . . . . 14

2.2 Applying Bayes’ Rule for Bayesian Inference . . . . . . . . . . . . . . . . . . . . . 17

2.3 Coin-Flipping Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

3 Bayesian Inference of a Binomial Proportion . . . . . . . . . . . . . . . . . . . 23

3.1 The Bayesian Approach . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24

3.2 Assumptions of the Approach . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24

3.3 Recalling Bayes’ Rule . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25

3.4 The Likelihood Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25

3.4.1 Bernoulli Distribution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25

3.4.2 Bernoulli Likelihood Function . . . . . . . . . . . . . . . . . . . . . . . . . 26

3.4.3 Multiple Flips of the Coin . . . . . . . . . . . . . . . . . . . . . . . . . . . 27

3.5 Quantifying our Prior Beliefs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27

1

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!