-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgrial.py
48 lines (37 loc) · 1.3 KB
/
grial.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
from ccxt import NetworkError
from GeneticAlgorithm.genetic_algorithm_menu import GeneticAlgorithmMenu
from Backtesting.backtester_menu import BacktesterMenu
from Config.dictionary.grial_config_dictionary import menu_options
from Utils.text import *
genetic_algorithm_submenu = GeneticAlgorithmMenu()
backtester_submenu = BacktesterMenu()
def print_menu():
print_title()
for key in menu_options.keys():
print(' <> ' + str(key) + ' >-< ' + menu_options[key])
def manage_options(selected_option):
if selected_option == 1:
backtester_submenu.init_default_values()
backtester_submenu.start()
elif selected_option == 2:
genetic_algorithm_submenu.init_default_values()
genetic_algorithm_submenu.start()
elif selected_option == 3:
print_not_implemented()
elif selected_option == 4:
print_exit()
else:
print_option_not_found()
if __name__ == "__main__":
while True:
try:
print_menu()
print('\n')
option = int(input(' -> Enter your choice: '))
manage_options(option)
except (SyntaxError, ValueError):
print_option_not_found()
except KeyboardInterrupt:
print_exit()
except NetworkError:
print_connectivity_error()