We’ll analyze MSFT stock in Python, calculate some basic Trading Indicators and plot the OHLC chart.

For a more complex analysis check this article our Python for Stock Market

Intro

This is the sixth article in a series of Stock Market Analysis in Python in which I will try to cover the basics you need to get started in stock market analysis.

Let’s start with the basics. In this article you will learn:

  • the easiest way to get the stock data in Python
  • what are trading indicators and how to calculate them
  • how to plot the stock data with OHLC chart


Here, I will help to install TA-LIB on your PC/Laptop. It should be easy going for y’all!

Install TA-LIB on Windows PC

Ta-lib installation is different from other python libraries as it is not available to install directly using pip install. officially available.

After that, we can install it using pip install as given below.

pip install <filename.whl>

Install TA-LIB on MacOS

You can directly type this command, and it you will be successful in installing TA-LIB

$ brew install ta-lib

Install TA-LIB on Google Colab

This a mutli step process, but you will be able to install it in few second.

url = ‘https://launchpad.net/~mario-mariomedina/+archive/ubuntu/talib/+files'!wget $url/libta-lib0_0.4.0-oneiric1_amd64.deb -qO libta.deb!wget $url/ta-lib0-dev_0.4.0-oneiric1_amd64.deb -qO ta.deb!dpkg…

In this project, we’ll analyse data from the stock market.

Again, we’ll use Pandas to extract and analyse the information, visualise it, and look at different ways to analyse the risk of a stock, based on its performance history.

Here are the questions I’ll try to answer:

  • What was the change in a stock’s price over time?
  • What was the daily return average of a stock?
  • What was the moving average of various stocks?
  • Why are the moving averages important?
  • What are techincal indicators and how to use them.
  • What was the correlation between daily returns of different stocks?
  • What…


Facebook’s Prophet

Prophet is a procedure for forecasting time series data based on an additive model where non-linear trends are fit with yearly, weekly, and daily seasonality, plus holiday effects. It works best with time series that have strong seasonal effects and several seasons of historical data. Prophet is robust to missing data and shifts in the trend, and typically handles outliers well.

The most commonly used models for forecasting predictions are the autoregressive models. Briefly, the autoregressive model specifies that the output variable depends linearly on its own previous values and on a stochastic term (an imperfectly predictable term).

The mathematical…


After largely successfully LSTM Model, lets try to recreate that success with an ARIMA Model. First a little about Time series and then we’ll discuss the implementation of ARIMA on Microsoft stock price dataset of over 20 years. Let’s do it!

Time-series & forecasting models

Traditionally most machine learning (ML) models use as input features some observations (samples / examples) but there is no time dimension in the data.

Time-series forecasting models are the models that are capable to predict future values based on previously observed values. Time-series forecasting is widely used for non-stationary data. Non-stationary data are called the data whose statistical properties…


At work we visualise and analyze typically very large data. In a typical day, this amounts to 65 million records and 20 GB of data. The volume of data can be challenging to analyze over a range of many days. The size of the data forces our analyses to be performed over a shorter period than we would like.

I recently discovered the Dask library, hence I wanted to write an article on it for anyone who wants to get started on this amazing tool.

We use the typical Python data toolkit for our ETL jobs. The sheer volume of…


Time-series & forecasting models

Traditionally most machine learning (ML) models use as input features some observations (samples / examples) but there is no time dimension in the data.

Time-series forecasting models are the models that are capable to predict future values based on previously observed values. Time-series forecasting is widely used for non-stationary data. Non-stationary data are called the data whose statistical properties e.g. the mean and standard deviation are not constant over time but instead, these metrics vary over time.

These non-stationary input data (used as input to these models) are usually called time-series. Some examples of time-series include the temperature values over…


Is it possible to predict where the AAPL price is headed?

Yes, let’s use machine learning regression techniques to predict the price of one of the most talked about companies of the world Apple Inc.

We will create a machine learning linear regression model that takes information from the past AAPL prices and returns a prediction of the AAPL price the next day.

Import the libraries and read the data

First things first: import all the necessary libraries which are required to implement this strategy.

Then, we read the past 13 years of daily AAPL price data and store it in Dataframe. We remove the columns…


Embedding code in Medium is pretty easy. There are two ways to primarily do it — by embedding the code directly on to medium or embedding it using Github Gist.

1. Embed directly in medium

To embed code directly in medium, see the following options:-

  • Mac: Control + Option+ 6
  • Windows: Control + Alt + 6
  • Linux: Control + Alt + 6

When you press these keys, a grey box as below will come up, inside which you can paste your code.

<paste your code here>

2. Embed using Github Gist

Github Gist is a much more appealing and readable option compared to directly embedding using Medium.

How this works…


It’s time to convert my literary blogs into tech blogs. I been inspired by my How to create Stock correlation matrix, which has received many responses by y’all. So let’s start a multi-part tech blog series!

To achieve this goal, I used Django, an extensible web framework that is built on top of Python, which I’m already familiar with. This article is for people with similar goals who are new to Django, Python, and or web frameworks, who are looking for projects to build out in the new reality we are finding ourselves in.

SETUP

We’ll set up Django, your project…

Rohan Kumar

Poet | Story writer | Blogger "I took a walk in the woods and came out taller than the trees."~ Henry David Thorea

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store