mirror of
https://github.com/wassname/catalyst.git
synced 2026-07-02 20:45:55 +08:00
MAINT: Remove unneeded parameter to cumulative.calculate_alpha
The method was using a mix of the `dt` parameter and `self.latest_dt`. Use `self.latest_dt` to conform with the rest of the module.
This commit is contained in:
@@ -296,7 +296,7 @@ algorithm_returns ({algo_count}) in range {start} : {end} on {dt}"
|
||||
-
|
||||
self.treasury_period_return)
|
||||
self.metrics.beta[dt] = self.calculate_beta()
|
||||
self.metrics.alpha[dt] = self.calculate_alpha(dt)
|
||||
self.metrics.alpha[dt] = self.calculate_alpha()
|
||||
self.metrics.sharpe[dt] = self.calculate_sharpe()
|
||||
self.metrics.downside_risk[dt] = self.calculate_downside_risk()
|
||||
self.metrics.sortino[dt] = self.calculate_sortino()
|
||||
@@ -407,14 +407,14 @@ algorithm_returns ({algo_count}) in range {start} : {end} on {dt}"
|
||||
self.annualized_mean_returns[self.latest_dt],
|
||||
self.annualized_mean_benchmark_returns[self.latest_dt])
|
||||
|
||||
def calculate_alpha(self, dt):
|
||||
def calculate_alpha(self):
|
||||
"""
|
||||
http://en.wikipedia.org/wiki/Alpha_(investment)
|
||||
"""
|
||||
return alpha(self.annualized_mean_returns[self.latest_dt],
|
||||
self.treasury_period_return,
|
||||
self.annualized_mean_benchmark_returns[self.latest_dt],
|
||||
self.metrics.beta[dt])
|
||||
self.metrics.beta[self.latest_dt])
|
||||
|
||||
def calculate_volatility(self, daily_returns):
|
||||
if len(daily_returns) <= 1:
|
||||
|
||||
Reference in New Issue
Block a user