The Quantitative Investor 1.52

Page 1

”Macro-scale quantitative market analysis”

T Quantitati In `tor MARCH 26, 2021

VOL.I. . . No.52

Abstract By BENJAMIN J. COWEN, PHD

BC ANALYTICS, LLC

The introduction on PineScript will show how to code up a fairly basic indicator. Learning some of the basic principles can be a huge barrier, but perhaps slowly walking through them together will help people obtain the confidence they need to begin exploring the idea of creating their own indicators. I understand that this type of weekly report/video will not be useful to everyone, but hopefully enough people will find value in a discussion on PineScript. First, you will want to define the study (Fig. 2). As shown in the figure, I am using PineScript version 4.

You have jumped into the cryptoverse! Welcome to the 52nd edition of The Quantitative Investor, a weekly newsletter for those who want to dive deep into the metrics of various financial markets, with a focus on cryptocurrencies, and visualize data not often presented elsewhere. The main objectives of this newsletter are to graph key metrics, identify any trends or correlations, and present the data which will help the reader understand long-term price movements. This report is strictly not financial advice and should not be treated as such. Instead, it is focused on analyzing historical data, presenting the data in a manner which is informative, and making a few projections Figure 2: Bitcoin bull market support PineScript. based on mathematics alone. The reader is still expected to do their own research when it comes to investing, especially within Then we can define our inputs (Fig. 3). Note that this part the cryptocurrency asset class. can be made more simplistic if you do not want the variables to be inputs that the user can change.

Trading View Pine Script

This week I have decided to do an introduction to the programming language used by Trading View, called Pinescript. This is just a rudimentary introduction, but it should at least be enough to get started. In the weekly video we show how to recreate the Bull Market Support Band Indicator (Fig. 1). If you are new to programming, I recommend just following along. While making an indicator may seem complicated, it Figure 3: Bitcoin bull market support PineScript. is actually quite easy once you get the hang of it. You simply need to define things and then plot them (generally speaking). Of course, you are free to make things as complicated or as Then we simply plot it all (Fig. 4). I’ve also added a line to simplistic as you want. change the background color anytime there is a cross between the two moving averages.

Figure 4: Bitcoin bull market support PineScript.

Figure 1: Bitcoin bull market support indicator.

The discussion on creating this indicator can be found in the weekly video, with the source code shown in Fig. 5.


Turn static files into dynamic content formats.

Create a flipbook
Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.