-
Notifications
You must be signed in to change notification settings - Fork 327
/
portfolio_manager.py
37 lines (28 loc) · 986 Bytes
/
portfolio_manager.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
# Basic libraries
import argparse
import json
from eiten import Eiten
from argchecker import ArgChecker
# Ignore warnings
import warnings
warnings.filterwarnings("ignore")
"""
Sample run:
python portfolio_manager.py --is_test 1 --future_bars 90 --data_granularity_minutes 3600 --history_to_use all --apply_noise_filtering 1 --market_index QQQ --only_long 1 --eigen_portfolio_number 3 --save_plot False
"""
def main():
argParser = argparse.ArgumentParser()
commands = json.load(open("commands.json", "r"))
for i in commands:
arg_types = {"str": str, "int": int, "bool": bool}
argParser.add_argument(i["comm"], type=arg_types[i["type"]],
default=i["default"], help=i["help"])
# Get arguments
args = argParser.parse_args()
# Check arguments
ArgChecker(args)
# Run strategies
eiten = Eiten(args)
eiten.run_strategies()
if __name__ == '__main__':
main()