回答編集履歴
1
バグの修正
test
CHANGED
@@ -36,7 +36,7 @@
|
|
36
36
|
|
37
37
|
|
38
38
|
|
39
|
-
rates = [3, 6, 5, 5, 1, 3, 8, 4, 2, 8]
|
39
|
+
rates = [3, 6, 5, 5, 1, 3, 8, 4, 2, 8, 5, 0.5]
|
40
40
|
|
41
41
|
|
42
42
|
|
@@ -62,39 +62,43 @@
|
|
62
62
|
|
63
63
|
else:
|
64
64
|
|
65
|
-
|
65
|
+
sell = df['profit'].idxmax()
|
66
66
|
|
67
|
-
|
67
|
+
buy = df['bottom'].iloc[:sell].idxmin()
|
68
68
|
|
69
69
|
print(f'最大利益は{profit}(index:{buy}で買い、{sell}で売る)')
|
70
70
|
|
71
71
|
|
72
72
|
|
73
|
-
|
73
|
+
rate bottom profit
|
74
74
|
|
75
|
-
|
75
|
+
0 3.0 3.0 0.0
|
76
76
|
|
77
|
-
|
77
|
+
1 6.0 3.0 3.0
|
78
78
|
|
79
|
-
|
79
|
+
2 5.0 3.0 2.0
|
80
80
|
|
81
|
-
|
81
|
+
3 5.0 3.0 2.0
|
82
82
|
|
83
|
-
|
83
|
+
4 1.0 1.0 0.0
|
84
84
|
|
85
|
-
|
85
|
+
5 3.0 1.0 2.0
|
86
86
|
|
87
|
-
|
87
|
+
6 8.0 1.0 7.0
|
88
88
|
|
89
|
-
|
89
|
+
7 4.0 1.0 3.0
|
90
90
|
|
91
|
-
|
91
|
+
8 2.0 1.0 1.0
|
92
92
|
|
93
|
-
|
93
|
+
9 8.0 1.0 7.0
|
94
94
|
|
95
|
-
|
95
|
+
10 5.0 1.0 4.0
|
96
96
|
|
97
|
+
11 0.5 0.5 0.0
|
98
|
+
|
99
|
+
|
100
|
+
|
97
|
-
|
101
|
+
最大利益は7.0(index:4で買い、6で売る)
|
98
102
|
|
99
103
|
|
100
104
|
|