File tree Expand file tree Collapse file tree 1 file changed +6
-9
lines changed
sysproduction/reporting/data Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -222,11 +222,11 @@ def _get_pandl_for_instrument_across_contracts(
222
222
223
223
def get_period_perc_pandl_for_strategy_in_date_range (self , strategy_name : str ):
224
224
print ("Getting p&l for %s" % strategy_name )
225
- pandl_df = self . get_df_of_perc_pandl_series_for_strategy_all_instruments (
226
- strategy_name
227
- )
228
-
229
- if pandl_df is missing_data :
225
+ try :
226
+ pandl_df = self . get_df_of_perc_pandl_series_for_strategy_all_instruments (
227
+ strategy_name
228
+ )
229
+ except missingData :
230
230
return 0.0
231
231
232
232
pandl_df = pandl_df [self .start_date : self .end_date ]
@@ -245,9 +245,6 @@ def get_df_of_perc_pandl_series_for_strategy_all_instruments(
245
245
strategy_name
246
246
)
247
247
248
- if instrument_list is missing_data :
249
- return missing_data
250
-
251
248
pandl_df = pd .concat (pandl_list , axis = 1 )
252
249
pandl_df .columns = instrument_list
253
250
@@ -260,7 +257,7 @@ def get_list_of_perc_pandl_series_for_strategy_all_instruments(
260
257
self .data , strategy_name
261
258
)
262
259
if len (instrument_list ) == 0 :
263
- return missing_data , missing_data
260
+ raise missingData
264
261
265
262
pandl_list = [
266
263
self .perc_pandl_series_for_strategy_instrument_vs_total_capital (
You can’t perform that action at this time.
0 commit comments