Skip to content

Commit

Permalink
resolving confict with data type
Browse files Browse the repository at this point in the history
  • Loading branch information
PietropaoloFrisoni committed Aug 22, 2023
1 parent 8853a19 commit 98f3696
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions finquant/quants.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,11 @@ def treynor_ratio(
beta_parameter=beta,
risk_free_rate=risk_free_rate,
)
res_treynor_ratio: FLOAT = (exp_return - risk_free_rate) / beta
return res_treynor_ratio
if beta is None:
return np.nan
else:
res_treynor_ratio: FLOAT = (exp_return - risk_free_rate) / beta
return res_treynor_ratio


def downside_risk(
Expand Down

0 comments on commit 98f3696

Please sign in to comment.