-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmfl.py
executable file
·54 lines (43 loc) · 1.39 KB
/
mfl.py
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
43
44
45
46
47
48
49
50
51
52
53
54
#!python3
"""
to predict Mutual Fund NAV
reference:
* https://www.digitalocean.com/community/tutorials/a-guide-to-time-series-visualization-with-python-3
* https://www.digitalocean.com/community/tutorials/a-guide-to-time-series-forecasting-with-arima-in-python-3
* https://towardsdatascience.com/an-end-to-end-project-on-time-series-analysis-and-forecasting-with-python-4835e6bf050b
"""
import sys
import matplotlib.pyplot as plt
plt.style.use('fivethirtyeight')
import warnings
warnings.filterwarnings("ignore")
from pylab import rcParams
import matplotlib
matplotlib.rcParams['axes.labelsize'] = 14
matplotlib.rcParams['xtick.labelsize'] = 12
matplotlib.rcParams['ytick.labelsize'] = 12
matplotlib.rcParams['text.color'] = 'k'
matplotlib.rcParams['figure.figsize'] = 11, 9
import mf_dataframe
### helper
def help():
print("""
you need help,
usage:
python mfl.py <showtime> [<full fund name>]
python mfl.py <diff> [<full fund name>]
""")
### main
if __name__ == '__main__':
fund_name = 'nifty index fund'
run_mode = "showtime"
if len(sys.argv) > 1:
run_mode = sys.argv[1]
if len(sys.argv) > 2:
fund_name = sys.argv[2]
if run_mode == "showtime":
mf_dataframe.showtime_from_mfapi_in(fund_name)
elif run_mode == "diff":
print("diff will run here")
else:
help()