Coders Packet

Visualising stock algorithm using python

By Shalini Sinha

To visualize common technical analysis tools like fetching historical stock data, moving averages, and stock prices using yfinance, matplotlib and seaborn module.

The following code image provides us a basic snippet of how to fetch historical stock data and with the help of matplotlib and seaborn modules, we can visualised complex datas in the interactive graphs to interpret.

Here we extract the high price, closing price and the volume of stock prices of Tesla starting from 2020-12-31 and ending 2023-04-01.

vsa1

following graphs taken into consideration are as follows- 

  1. stock prices in line chart
  2. daily returns in histogram
  3. coorelating stock prices in heatmap
  4. visualising close price in line chart
  5. candlestick chart
  6. moving averages in line plot

 

1. stock prices in line chart

line chart

2. daily returns in histogram

histogram

3. coorelating stock prices in heatmap 

heatmap

4. visualising close price in line chart

tsla line chart

5. candlestick chart

candlestick

6.moving averages in line plot

moving averages

 

 

 

 

 

 

Download Complete Code

Comments

No comments yet

Download Packet

Reviews Report

Submitted by Shalini Sinha (shalinisinha13)

Download packets of source code on Coders Packet