回答編集履歴

1

追記

2018/05/30 09:58

投稿

hayataka2049
hayataka2049

スコア30933

test CHANGED
@@ -17,3 +17,45 @@
17
17
  arbitrage_decision = 1
18
18
 
19
19
  ```
20
+
21
+
22
+
23
+ ### 追記
24
+
25
+
26
+
27
+ ```python
28
+
29
+ stop_process_dict = {0:0, 1:0 2:0, 3:0, 4:0}
30
+
31
+ state_lst = [net_profit_price < 0,
32
+
33
+ net_ask_price > risk_limit_price,
34
+
35
+ net_bid_price > risk_limit_price,
36
+
37
+ net_profit_price < minimum_profit_price,
38
+
39
+ net_profit_rate < minimum_profit_rate]
40
+
41
+
42
+
43
+ for i, state in enumerate(state_lst):
44
+
45
+ if state:
46
+
47
+ stop_process_dict[i] += 1
48
+
49
+ arbitrage_decision = 0
50
+
51
+
52
+
53
+ if not any(state_lst):
54
+
55
+ arbitrage_decision = 1
56
+
57
+ ```
58
+
59
+
60
+
61
+ 変数を変えてしまうのが前提のコードです。なので他の部分にも修正が及びます(`stop_process_no1`は`stop_process_dict[0]`等とします)。