switched reporting to provide cash, equity, and total portfolio value

This commit is contained in:
fawce
2012-04-08 13:53:40 -04:00
parent 37a8bda4b2
commit 237b42c11e
2 changed files with 21 additions and 11 deletions
+1
View File
@@ -448,6 +448,7 @@ class PerformancePeriod():
'starting_value' : self.starting_value,
'starting_cash' : self.starting_cash,
'ending_cash' : self.ending_cash,
'portfolio_value': self.ending_cash + self.ending_value,
'positions' : positions,
'timestamp' : datetime.datetime.now(),
'pnl' : self.pnl,
+20 -11
View File
@@ -634,22 +634,31 @@ def PERF_FRAME(perf):
daily_perf = {
'date' : EPOCH(date),
'date_string' : str(date),
'returns' : tp['returns'],
'pnl' : tp['pnl'],
'portfolio_value' : tp['ending_value']
'market_value' : cp['ending_value'],
'portfolio_value' : cp['portfolio_value'],
'starting_cash' : tp['starting_cash'],
'ending_cash' : tp['ending_cash'],
'capital_used' : tp['capital_used']
}
cumulative_perf = {
'alpha' : risk['alpha'],
'beta' : risk['beta'],
'sharpe' : risk['sharpe'],
'total_returns' : cp['returns'],
'volatility' : risk['algo_volatility'],
'benchmark_volatility' : risk['benchmark_volatility'],
'benchmark_returns' : risk['benchmark_period_return'],
'max_drawdown' : risk['max_drawdown'],
'pnl' : cp['pnl']
'alpha' : risk['alpha'],
'beta' : risk['beta'],
'sharpe' : risk['sharpe'],
'volatility' : risk['algo_volatility'],
'benchmark_volatility' : risk['benchmark_volatility'],
'benchmark_returns' : risk['benchmark_period_return'],
'max_drawdown' : risk['max_drawdown'],
'total_returns' : cp['returns'],
'pnl' : cp['pnl'],
'market_value' : cp['ending_value'],
'portfolio_value' : cp['portfolio_value'],
'starting_cash' : cp['starting_cash'],
'ending_cash' : cp['ending_cash'],
'capital_used' : cp['capital_used']
}
# nest the cumulative performance data in the daily.