回答編集履歴
1
追記
answer
CHANGED
@@ -7,4 +7,25 @@
|
|
7
7
|
net_profit_price >= minimum_profit_price and
|
8
8
|
net_profit_rate >= minimum_profit_rate):
|
9
9
|
arbitrage_decision = 1
|
10
|
-
```
|
10
|
+
```
|
11
|
+
|
12
|
+
### 追記
|
13
|
+
|
14
|
+
```python
|
15
|
+
stop_process_dict = {0:0, 1:0 2:0, 3:0, 4:0}
|
16
|
+
state_lst = [net_profit_price < 0,
|
17
|
+
net_ask_price > risk_limit_price,
|
18
|
+
net_bid_price > risk_limit_price,
|
19
|
+
net_profit_price < minimum_profit_price,
|
20
|
+
net_profit_rate < minimum_profit_rate]
|
21
|
+
|
22
|
+
for i, state in enumerate(state_lst):
|
23
|
+
if state:
|
24
|
+
stop_process_dict[i] += 1
|
25
|
+
arbitrage_decision = 0
|
26
|
+
|
27
|
+
if not any(state_lst):
|
28
|
+
arbitrage_decision = 1
|
29
|
+
```
|
30
|
+
|
31
|
+
変数を変えてしまうのが前提のコードです。なので他の部分にも修正が及びます(`stop_process_no1`は`stop_process_dict[0]`等とします)。
|