Toggle navigation
Toggle navigation
This project
Loading...
Sign in
박하늘
/
stock_chatbot
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
박하늘
2021-06-09 02:02:39 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
88e42710da25892c11f4a10e5b4192352847ef67
88e42710
1 parent
9f608ce9
multivalue update
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
4 deletions
server/app.js
server/optimizer.py
server/app.js
View file @
88e4271
This diff is collapsed. Click to expand it.
server/optimizer.py
View file @
88e4271
...
...
@@ -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
=
4
00
)
plt
.
savefig
(
"./src/test.png"
,
dpi
=
1
00
)
print
(
"end"
)
...
...
Please
register
or
login
to post a comment