Showing
2 changed files
with
13 additions
and
4 deletions
This diff is collapsed. Click to expand it.
... | @@ -583,10 +583,19 @@ class back_test: | ... | @@ -583,10 +583,19 @@ class back_test: |
583 | # print(back_test().backtest_data(['삼성전자','LG전자'],[0.9,0.1],'2010-01-01', '2021-01-01',10000000,3, 'monthly', 'gmv')['pfo_return'][0]['acc_return_ratio']) | 583 | # print(back_test().backtest_data(['삼성전자','LG전자'],[0.9,0.1],'2010-01-01', '2021-01-01',10000000,3, 'monthly', 'gmv')['pfo_return'][0]['acc_return_ratio']) |
584 | # print(back_test().backtest_data(['삼성전자','LG전자'],[0.9,0.1],'2018-01-01', '2021-01-01',10000000,6, 'monthly', 'gmv')) | 584 | # print(back_test().backtest_data(['삼성전자','LG전자'],[0.9,0.1],'2018-01-01', '2021-01-01',10000000,6, 'monthly', 'gmv')) |
585 | 585 | ||
586 | +args = sys.argv[1].split(",") | ||
586 | 587 | ||
587 | -print(sys.argv[0]) | 588 | +assets = [] |
588 | -data = back_test().backtest_data([sys.argv[1],sys.argv[2]],[0.5,0.5],sys.argv[3], '2021-01-02',10000000,6, 'monthly', 'gmv') | 589 | +gravity = [] |
589 | -# data = back_test().backtest_data(['삼성전자','LG전자'],[0.5,0.5],'2020-01-01', '2021-01-02',10000000,6, 'monthly', 'gmv') | 590 | +for i in range(len(args)-1): |
591 | + assets.append(args[i]) | ||
592 | + gravity.append(0) | ||
593 | + | ||
594 | +data = back_test().backtest_data(assets,gravity,args[-1], '2021-01-02',10000000,6, 'monthly', 'gmv') | ||
595 | + | ||
596 | + | ||
597 | +#data = back_test().backtest_data(['삼성전자','LG전자','호텔신라'],[0.1,0.1,0.8],'2020-01-01', '2021-01-02',10000000,6, 'monthly', 'gmv') | ||
598 | +# data = back_test().backtest_data(['삼성전자','LG전자'],[0.1,0.1],'2020-01-01', '2021-01-02',10000000,6, 'monthly', 'gmv') | ||
590 | x = data['pfo_return'][0]['Date'] | 599 | x = data['pfo_return'][0]['Date'] |
591 | y = data['pfo_return'][0]['acc_return ratio'] | 600 | y = data['pfo_return'][0]['acc_return ratio'] |
592 | y2 = data['bench'][0]['KOSPI_acc_return'] | 601 | y2 = data['bench'][0]['KOSPI_acc_return'] |
... | @@ -610,6 +619,6 @@ plt.ylabel('Return') | ... | @@ -610,6 +619,6 @@ plt.ylabel('Return') |
610 | plt.title('result') | 619 | plt.title('result') |
611 | plt.legend() | 620 | plt.legend() |
612 | plt.show() | 621 | plt.show() |
613 | -plt.savefig("./src/test.png", dpi = 400) | 622 | +plt.savefig("./src/test.png", dpi = 100) |
614 | print("end") | 623 | print("end") |
615 | 624 | ... | ... |
-
Please register or login to post a comment