-
Notifications
You must be signed in to change notification settings - Fork 184
Expand file tree
/
Copy pathscript.py
More file actions
42 lines (31 loc) · 981 Bytes
/
script.py
File metadata and controls
42 lines (31 loc) · 981 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
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()