File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -532,6 +532,7 @@ def _max_cagr_asset(self) -> dict:
532
532
533
533
@property
534
534
def _max_cagr_asset_right_to_max_cagr (self ) -> Optional [dict ]:
535
+ # sourcery skip: use-named-expression
535
536
"""
536
537
The asset with max CAGR lying to the right of the global max CAGR point
537
538
(risk should be more than self.max_return['Risk']).
@@ -540,7 +541,8 @@ def _max_cagr_asset_right_to_max_cagr(self) -> Optional[dict]:
540
541
"""
541
542
tolerance = 0.01 # assets CAGR should be less than max CAGR with certain tolerance
542
543
cagr = helpers .Frame .get_cagr (self .assets_ror )
543
- if global_max_cagr_is_not_asset := (cagr < self .global_max_return_portfolio ["CAGR" ] * (1 - tolerance )).all ():
544
+ global_max_cagr_is_not_asset = (cagr < self .global_max_return_portfolio ["CAGR" ] * (1 - tolerance )).all ()
545
+ if global_max_cagr_is_not_asset :
544
546
condition = self .risk_annual .values > self .global_max_return_portfolio ["Risk" ]
545
547
ror_selected = self .assets_ror .loc [:, condition ]
546
548
if not ror_selected .empty :
You can’t perform that action at this time.
0 commit comments