How to obtain stock market data and create visualizations(candlestick, OHLC, PnF etc.) in Python using mplfinance library

Mplfinance is a dedicated data visulization package from matlplotlib for visualizing financial data.
Mplfinance enable visualization of financial data in the form of different types of charts- Candlestick chart, Renko Chart, OHLC chart, Point and Figure chart etc. with very few lines of code.
Mplfinance also facilitates superimposing moving averages on top of charts for decision making by technical analysts.

Getting the data

Typical market data includes OHLCV(Open High Low Close Volume) data. The data can be obtained by using the sites of stock exchanges, financial publications, APIs, web-scrapping etc.

Mplfinace package can be used to plot any dataframe provided the following conditions…


A complete step-by-step tutorial on how to use Yahoo Finance Package for python- yfinance, to obtain share price and other financial data for free

Introduction

Getting data for financial analysis is the major roadblock someone faces when planning to perform some stock analysis.
Not anymore!
The new Yahoo finance API- yfinance has got your back!
yfinance package not just helps to to access the share-price details, it also provides myriad of other financial and non-financial data pertaining to all companies listed in the United States.

yfinance can also be used to obtain data related of bonds, stock indices (S&P 500, Nasdaq, Dow 30 etc.), Commodities (Crude Oil , Gold, Silver etc.), Currencies (EUR/USD, GBP/USD, USD/JPY etc.), International Markets (FTSE 100, Nikkei 225 etc.) …


How to check if a single value is NaN in python. There are approaches are using libraries (pandas, math and numpy) and without using libraries.

NaN stands for Not A Number and is one of the common ways to represent the missing value in the data. It is a special floating-point value and cannot be converted to any other type than float.

NaN value is one of the major problems in Data Analysis. It is very essential to deal with NaN in order to get the desired results.

Finding and dealing with NaN within an array, series or dataframe is easy. However, identifying a stand alone NaN value is tricky. In this article I explain five methods to deal with NaN in python. The first…


A data driven attempt in predicting English Premier League results using xG Statistics

This is an article on my EPL Prediction series. You can check out the prediction for Game Week 24 and how it fared against the actual performance here.

Expected Goals or xG is the parameter used for prediction. If you are interested in understanding the algorithm for prediction, I recommend that you check out this article where it is explained in detail.

Analysis up to Game-week 24

The Premier League seems to be very interesting at the moment. As Klopp said, it appears that City is running away with the title. However the competition is very fierce for the top 4 finish. Just 10 points…


A data driven attempt in predicting English Premier League results using xG Statistics

This is an article on my EPL Prediction series. You can check out the prediction for Game Week 23 and how it fared against the actual performance here.

Expected Goals or xG is the parameter used for prediction. If you are interested in understanding the algorithm for prediction, I recommend that you check out this article where it is explained in detail.

Analysis up to Game-week 22

Image for post
Image for post
EPL Table (Image by Author)

After game week 23, Manchester City are on top of the table with 50 points. Pep Guardiola’s side is 5 points clear of their city rivals, the Red Devils with one game in hand. …


A data driven attempt in predicting English Premier League results using xG Statistics

This is an article on my EPL Prediction series. You can check out the prediction for Game Week 22 and how it fared against the actual performance here.

Expected Goals or xG is the parameter used for prediction. If you are interested in understanding the algorithm for prediction, I recommend that you check out this article where it is explained in detail.

Analysis up to Game-week 22

Image for post
Image for post

After game week 22, Manchester City are on top of the table with 47 points. Pep Guardiola’s side is 3 points clear of the Red Devils with one game in hand.

In the last Game Week, the defending…


Two easy methods for embedding code in your Medium article.

When writing an article about coding, writers often find it difficult to add code to the article. Code in normal text ruins the formatting and does not differentiate the text from the code. Some writers overcome this problem by uploading the screenshot of the code.

In this article I will explain two easy methods to embed code into your Medium article.

To embed code directly in medium, use the following shortcut key:

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

When you press these keys, a grey box as below will appear…


Explaining what is Quadrant Analysis and where is it employed. Step by step guide on how to do it in python using pandas, matplotlib and seaborn libraries.

A Quadrant Analysis chart is a very common tool used for decision making especially in business setting.
A Quadrant chart is technically a scatter plot that is divided into four sections or quadrants, hence the name. In a quadrant analysis, performance under two parameters are assessed for each entity. Depending on how an entity performs under either of the KPIs, the entity is grouped into either of the quadrants.
After identifying which quadrant the entity belongs to, actions can be taken to improve performance under relevant KPIs.

Preparation of Quadrant Analysis in data visualization tools like Power BI and Tableau…


A data driven attempt in predicting English Premier League results using xG Statistics

This is an article on my EPL Prediction series. You can check out the prediction for Game Week 21 and how it fared against the actual performance here.

Expected Goals or xG is the parameter used for prediction. If you are interested in understanding the algorithm for prediction, I recommend that you check out this article where it is explained in detail.

Analysis up to Game-week 21

Image for post
Image for post
EPL Table (Image by Author)

After game week 21, Manchester City are on top of the table with 44 points. Pep Guardiola’s side is 3 points clear of the Red Devils with one game in hand. …

Abhijith Chandradas

Carpe Diem!

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