File tree 2 files changed +6
-13
lines changed
2 files changed +6
-13
lines changed Original file line number Diff line number Diff line change @@ -32,9 +32,6 @@ class capitalData(baseData):
32
32
33
33
def get_current_total_capital (self ) -> float :
34
34
pd_series = self .get_total_capital_pd_series ()
35
- if pd_series is missing_data :
36
- return missing_data
37
-
38
35
return float (pd_series [- 1 ])
39
36
40
37
def get_current_broker_account_value (self ) -> float :
@@ -51,11 +48,7 @@ def get_current_pandl_account(self) -> float:
51
48
return float (pd_series [- 1 ])
52
49
53
50
def get_total_capital_pd_series (self ) -> pd .Series :
54
- try :
55
- all_capital_series = self .get_df_of_all_global_capital ()
56
- except missingData :
57
- return missing_data
58
-
51
+ all_capital_series = self .get_df_of_all_global_capital ()
59
52
return all_capital_series [CURRENT_CAPITAL_LABEL ]
60
53
61
54
def get_broker_account_value_pd_series (self ) -> pd .Series :
Original file line number Diff line number Diff line change 2
2
import datetime
3
3
4
4
from syscore .exceptions import missingData
5
- from syscore .constants import missing_data , success
5
+ from syscore .constants import success
6
6
7
7
from sysdata .data_blob import dataBlob
8
8
from sysproduction .data .capital import dataCapital , dataMargin
@@ -72,11 +72,11 @@ def margin_strategy_allocation(self):
72
72
73
73
def get_total_current_capital (data : dataBlob ) -> float :
74
74
data_capital = dataCapital (data )
75
- total_capital = data_capital . get_current_total_capital ()
76
-
77
- if total_capital is missing_data :
75
+ try :
76
+ total_capital = data_capital . get_current_total_capital ()
77
+ except missingData :
78
78
data .log .critical ("Can't allocate strategy capital without total capital" )
79
- raise Exception ()
79
+ raise
80
80
81
81
return total_capital
82
82
You can’t perform that action at this time.
0 commit comments