박하늘

multivalue update

This diff is collapsed. Click to expand it.
......@@ -583,10 +583,19 @@ class back_test:
# 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'])
# print(back_test().backtest_data(['삼성전자','LG전자'],[0.9,0.1],'2018-01-01', '2021-01-01',10000000,6, 'monthly', 'gmv'))
args = sys.argv[1].split(",")
print(sys.argv[0])
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')
# data = back_test().backtest_data(['삼성전자','LG전자'],[0.5,0.5],'2020-01-01', '2021-01-02',10000000,6, 'monthly', 'gmv')
assets = []
gravity = []
for i in range(len(args)-1):
assets.append(args[i])
gravity.append(0)
data = back_test().backtest_data(assets,gravity,args[-1], '2021-01-02',10000000,6, 'monthly', 'gmv')
#data = back_test().backtest_data(['삼성전자','LG전자','호텔신라'],[0.1,0.1,0.8],'2020-01-01', '2021-01-02',10000000,6, 'monthly', 'gmv')
# data = back_test().backtest_data(['삼성전자','LG전자'],[0.1,0.1],'2020-01-01', '2021-01-02',10000000,6, 'monthly', 'gmv')
x = data['pfo_return'][0]['Date']
y = data['pfo_return'][0]['acc_return ratio']
y2 = data['bench'][0]['KOSPI_acc_return']
......@@ -610,6 +619,6 @@ plt.ylabel('Return')
plt.title('result')
plt.legend()
plt.show()
plt.savefig("./src/test.png", dpi = 400)
plt.savefig("./src/test.png", dpi = 100)
print("end")
......