-
Notifications
You must be signed in to change notification settings - Fork 1
/
model.py
59 lines (48 loc) · 1.02 KB
/
model.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
55
56
57
#!/usr/bin/env python3.6
"""The model should include the "bussiness logic". Here the "logic"
is to select only a certain parameters and add them to
specific columns."""
from wrapper import Markit
import ORM
from time import sleep
def get_data():
markit = Markit()
try:
name = (markit.get_quote_msft())["Name"]
except:
pass
try:
last_price = (markit.get_quote_msft())["LastPrice"]
except:
pass
try:
timestamp = (markit.get_quote_msft())["Timestamp"]
except:
pass
try:
name1 = (markit.get_quote_goog())["Name"]
except:
pass
try:
last_price1 = (markit.get_quote_goog())["LastPrice"]
except:
pass
try:
timestamp1 = (markit.get_quote_goog())["Timestamp"]
except:
pass
try:
ORM.update_goog(name1,last_price1,timestamp1)
except:
pass
try:
ORM.update_msft(name,last_price,timestamp)
except:
pass
sleep(5)
get_data()
#def review_correlation_simul():
#ORM.get_df_goog(name)
#ORM.get_df_msft(name1)
#return df1.corrwith(df)
# execute every minute