forked from robcarver17/pysystemtrade
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathupdate_strategy_orders.py
30 lines (24 loc) · 1.11 KB
/
update_strategy_orders.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
from syscore.interactive.menus import print_menu_of_values_and_get_response
from syscontrol.strategy_tools import strategyRunner
from sysdata.data_blob import dataBlob
from sysproduction.data.control_process import get_list_of_strategies_for_process
from sysexecution.strategies.strategy_order_handling import (
name_of_main_generator_method,
)
process_name = "run_strategy_order_generator"
def update_strategy_orders():
## function if called from script
with dataBlob(log_name="Update-Strategy-Orders") as data:
list_of_strategies = get_list_of_strategies_for_process(data, process_name)
ALL = "ALL"
print("Which strategy?")
strategy_name = print_menu_of_values_and_get_response(
list_of_strategies, default_str=ALL
)
if not strategy_name == ALL:
list_of_strategies = [strategy_name]
for strategy_name in list_of_strategies:
strategy_order_generator = strategyRunner(
data, strategy_name, process_name, name_of_main_generator_method
)
strategy_order_generator.run_strategy_method()