forked from miro-ka/mosquito
/
mosquito.py
36 lines (25 loc) · 1.12 KB
/
mosquito.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
import argparse
from core.engine import Engine
def main(args):
engine = Engine(args, 'config.ini')
engine.run()
def has_mandatory_fields(args):
"""
Checks if command arguments contain all mandatory arguments
"""
if not args.backtest and not args.live and not args.paper:
return False
return True
if __name__ == "__main__":
# Parse input
parser = argparse.ArgumentParser()
parser.add_argument("--backtest", help="Simulate your strategy on history ticker data", action='store_true')
parser.add_argument("--paper", help="Simulate your strategy on real ticker", action='store_true')
parser.add_argument("--live", help="REAL trading mode", action='store_true')
parser.add_argument("--strategy", help="Name of strategy to be run (if not set, the default one will be used")
parser.add_argument("--plot", help="Generate a candle stick plot at simulation end", action='store_true')
args = parser.parse_args()
if not has_mandatory_fields(args):
print("Missing trade mode argument (backtest, paper or live). See --help for more details.")
exit(0)
main(args)