Skip to content

Stock visualiser #480

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions scripts/STOCK VISUALISER/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
A python script for STOCK VISUALISER
Issue no. - #414


A proper and concise visualization of an stock is necessary to understand it before investing. It's not possible to visualise it over a long period of time in conventional softwares.


yfinance library, gets the stock growth
Tkcalendar, give user a option to can choose the duration for stock analysis
mplfinance library, plots the graph


after running the program allows to choose the date from which user needs to see the graph then user need to press visualise button and they have to give token/stock number so the graph will be shown for that stock

42 changes: 42 additions & 0 deletions scripts/STOCK VISUALISER/script.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# import required packages
import yfinance as yf
import mplfinance as mpf
import matplotlib.pyplot as plt
import pandas as pd
import tkinter as tk
import tkcalendar

# Top level window
frame = tk.Tk()
frame.title("TextBox Input")
frame.geometry('500x250')

def printInput():

# getting Stock Data
msft = yf.Ticker(inputtxt.get(1.0))
a = msft.history(start=start_date.get_date(), end=end_date.get_date())

# ploting graph
mpf.plot(a, type='candle', volume=True, title = inputtxt.get(1.0))

# TextBox Creation
inputtxt = tk.Text(frame, height = 2, width = 25)
inputtxt.pack()

start_date = tkcalendar.DateEntry(frame, text = "Start Date")
start_date.pack(padx=10,pady=10)

end_date = tkcalendar.DateEntry(frame, text = "End Date")
end_date.pack(padx=10,pady=10)



# Button Creation
printButton = tk.Button(frame, text = "visualise", command = printInput)
printButton.pack()

# Label Creation
lbl = tk.Label(frame, text = "")
lbl.pack()
frame.mainloop()