-
Notifications
You must be signed in to change notification settings - Fork 3
/
last_day.py
32 lines (28 loc) · 858 Bytes
/
last_day.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
from .misc import retrieve_variable_name
def process_last_day_res(last_day_res: dict):
# TODO implement - send notification
# if last_day_res contains signal to do trade
pass
def create_last_day_results(*args) -> dict:
"""
Fill last_day_results with provided values.
Assign None to all the values that are not provided.
"""
res: dict = dict()
all_columns = [
"current_position_num_stocks",
"all_current_trades",
"today_special_situation_msg",
"current_position_size",
"desired_size",
"desired_size_msg",
"today_action",
]
for column in all_columns:
res[column] = None
for var in args:
var_name = retrieve_variable_name(var)
if var_name not in all_columns:
continue
res[var_name] = var
return res