Stock Technicals Lab


Overview

Using the Intrinio Financial Data API (application programming interface) we can programmatically retrieve a variety of stock price technicals such as Simple Moving Average, Bollinger Bands, On-balance Volume, Stochastic Oscillator and numerous others.

We will use the Get Security Stock Prices and Bollinger Bands API end-points to retrieve stock price and Bollinger Band values throughout this lab.

In this lab we will cover:

  • Retrieving 1 year of Bollinger Bands for Apple Inc. (AAPL) using Python or R
  • Charting Bollinger Bands

Code Examples

Code examples in Python and R are provided throughout this lab.

All code examples can be run in your browser using a Jupter Notebook. To launch the Jupyter Notebook for any code example simply click the Run Jupyter Notebook button at the top of the code example.

If you wish to run the code examples in your own development environment, be sure to first install the Intrino SDK for the language of your choice:

API Keys

In code examples throughout this lab you will be asked to provide your API Key.

The API keys assigned to you are available below.

For the purposes of this lab, be sure to use your Production API key

Production
To view your API keys, click here to log in.

Section 1

Retrieving 1 year of Bollinger Bands for Apple Inc.

In this section we use the Get Security Stock Prices API end-point to retrieve stock prices for Apple Inc. from January 1st, 2019 through January 1st, 2020.

Then, we'll use the Bollinger Bands stock technicals endpoint to retrieve Bollinger Band values for the same time frame.

Run the code below to see the result...

Section 2

Charting Bollinger Bands

Building on our previous work, now let's graph the stock prices prices we retrieved as well as the lower, middle, and upper Bollinger Bands.

Run the code below to see the result...

Going further...
  • Simple Moving Average crossovers are frequently used as buy / sell trading signals - can you use the
    Simple Moving Average API end-point to add SMA 50 and SMA 100 lines to the graph?
  • Try writing a function which uses SMA 20 and SMA 50 crossovers to find stocks with strong technical purchase signals.