-
Notifications
You must be signed in to change notification settings - Fork 12
/
app.py
27 lines (22 loc) · 1.02 KB
/
app.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
# You can write code above the if-main block.
if __name__ == "__main__":
# You should not modify this part.
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("--training", default="training_data.csv", help="input training data file name")
parser.add_argument("--testing", default="testing_data.csv", help="input testing data file name")
parser.add_argument("--output", default="output.csv", help="output file name")
args = parser.parse_args()
# The following part is an example.
# You can modify it at will.
training_data = load_data(args.training)
trader = Trader()
trader.train(training_data)
testing_data = load_data(args.testing)
with open(args.output, "w") as output_file:
for row in testing_data:
# We will perform your action as the open price in the next day.
action = trader.predict_action(row)
output_file.write(action)
# this is your option, you can leave it empty.
trader.re_training()