mirror of
https://github.com/wassname/catalyst.git
synced 2026-07-04 15:38:44 +08:00
updated performance to be trade by trade.
This commit is contained in:
@@ -247,12 +247,12 @@ class PerformanceTracker(object):
|
||||
self.cumulative_performance.update_last_sale(event)
|
||||
self.todays_performance.update_last_sale(event)
|
||||
|
||||
|
||||
def handle_market_close(self):
|
||||
#calculate performance as of last trade
|
||||
self.cumulative_performance.calculate_performance()
|
||||
self.todays_performance.calculate_performance()
|
||||
|
||||
def handle_market_close(self):
|
||||
|
||||
# add the return results from today to the list of DailyReturn objects.
|
||||
todays_date = self.market_close.replace(hour=0, minute=0, second=0)
|
||||
todays_return_obj = risk.DailyReturn(
|
||||
@@ -503,7 +503,7 @@ class PerformancePeriod(object):
|
||||
'capital_used' : self.period_capital_used,
|
||||
'starting_value' : self.starting_value,
|
||||
'starting_cash' : self.starting_cash,
|
||||
'ending_cash' : self.ending_cash,
|
||||
'cash' : self.ending_cash,
|
||||
'portfolio_value' : self.ending_cash + self.ending_value,
|
||||
'cumulative_capital_used' : self.cumulative_capital_used,
|
||||
'max_capital_used' : self.max_capital_used,
|
||||
|
||||
Reference in New Issue
Block a user