From 1cbe598691592b043320d13e5bbef64489566817 Mon Sep 17 00:00:00 2001 From: kingakshat Date: Wed, 19 Apr 2023 14:50:33 +0530 Subject: [PATCH 1/3] script for stock visualiser added --- scripts/STOCK VISUALISER/script.py | 49 ++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 scripts/STOCK VISUALISER/script.py diff --git a/scripts/STOCK VISUALISER/script.py b/scripts/STOCK VISUALISER/script.py new file mode 100644 index 0000000..746a613 --- /dev/null +++ b/scripts/STOCK VISUALISER/script.py @@ -0,0 +1,49 @@ +# # 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 = "Print", + command = printInput) +printButton.pack() + +# Label Creation +lbl = tk.Label(frame, text = "") +lbl.pack() +frame.mainloop() \ No newline at end of file From 39724249ae784346a02006de3e502e89e05356d4 Mon Sep 17 00:00:00 2001 From: kingakshat Date: Sat, 22 Apr 2023 21:45:17 +0530 Subject: [PATCH 2/3] readme for stock visualiser added --- scripts/STOCK VISUALISER/README.md | 14 ++++++++++++++ scripts/STOCK VISUALISER/script.py | 13 +++---------- 2 files changed, 17 insertions(+), 10 deletions(-) create mode 100644 scripts/STOCK VISUALISER/README.md diff --git a/scripts/STOCK VISUALISER/README.md b/scripts/STOCK VISUALISER/README.md new file mode 100644 index 0000000..34bd637 --- /dev/null +++ b/scripts/STOCK VISUALISER/README.md @@ -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 + diff --git a/scripts/STOCK VISUALISER/script.py b/scripts/STOCK VISUALISER/script.py index 746a613..1dae7c5 100644 --- a/scripts/STOCK VISUALISER/script.py +++ b/scripts/STOCK VISUALISER/script.py @@ -1,5 +1,4 @@ -# # import required packages - +# import required packages import yfinance as yf import mplfinance as mpf import matplotlib.pyplot as plt @@ -22,13 +21,9 @@ def printInput(): mpf.plot(a, type='candle', volume=True, title = inputtxt.get(1.0)) # TextBox Creation -inputtxt = tk.Text(frame, - height = 2, - width = 25 - ) +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) @@ -38,9 +33,7 @@ def printInput(): # Button Creation -printButton = tk.Button(frame, - text = "Print", - command = printInput) +printButton = tk.Button(frame, text = "Print", command = printInput) printButton.pack() # Label Creation From 63a2128656a5a3b88ea858bc67db297c5213fe7e Mon Sep 17 00:00:00 2001 From: kingakshat Date: Sat, 22 Apr 2023 21:51:36 +0530 Subject: [PATCH 3/3] button updated --- scripts/STOCK VISUALISER/script.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/STOCK VISUALISER/script.py b/scripts/STOCK VISUALISER/script.py index 1dae7c5..525be60 100644 --- a/scripts/STOCK VISUALISER/script.py +++ b/scripts/STOCK VISUALISER/script.py @@ -33,7 +33,7 @@ def printInput(): # Button Creation -printButton = tk.Button(frame, text = "Print", command = printInput) +printButton = tk.Button(frame, text = "visualise", command = printInput) printButton.pack() # Label Creation