mirror of
https://github.com/wassname/catalyst.git
synced 2026-06-30 18:49:42 +08:00
MAINT: Rename perfomances intraday_perf to minute_perf.
minute_perf is more precise than intraday_perf as a naming scheme for the performance packet type.
This commit is contained in:
@@ -1098,21 +1098,21 @@ class TestPerformanceTracker(unittest.TestCase):
|
||||
msg_1 = messages[foo_event_1.dt]
|
||||
msg_2 = messages[foo_event_2.dt]
|
||||
|
||||
self.assertEquals(1, len(msg_1['intraday_perf']['transactions']),
|
||||
self.assertEquals(1, len(msg_1['minute_perf']['transactions']),
|
||||
"The first message should contain one transaction.")
|
||||
# Check that transactions aren't emitted for previous events.
|
||||
self.assertEquals(0, len(msg_2['intraday_perf']['transactions']),
|
||||
self.assertEquals(0, len(msg_2['minute_perf']['transactions']),
|
||||
"The second message should have no transactions.")
|
||||
|
||||
self.assertEquals(1, len(msg_1['intraday_perf']['orders']),
|
||||
self.assertEquals(1, len(msg_1['minute_perf']['orders']),
|
||||
"The first message should contain one orders.")
|
||||
# Check that orders aren't emitted for previous events.
|
||||
self.assertEquals(0, len(msg_2['intraday_perf']['orders']),
|
||||
self.assertEquals(0, len(msg_2['minute_perf']['orders']),
|
||||
"The second message should have no orders.")
|
||||
|
||||
# Ensure that period_close moves through time.
|
||||
# Also, ensure that the period_closes are the expected dts.
|
||||
self.assertEquals(foo_event_1.dt,
|
||||
msg_1['intraday_perf']['period_close'])
|
||||
msg_1['minute_perf']['period_close'])
|
||||
self.assertEquals(foo_event_2.dt,
|
||||
msg_2['intraday_perf']['period_close'])
|
||||
msg_2['minute_perf']['period_close'])
|
||||
|
||||
@@ -278,14 +278,9 @@ class PerformanceTracker(object):
|
||||
'daily_perf':
|
||||
self.todays_performance.to_dict()})
|
||||
if emission_type == 'minute':
|
||||
# Currently reusing 'todays_performance' for intraday trading
|
||||
# result, should be analogous, but has the potential for needing
|
||||
# its own configuration down the line.
|
||||
# Naming as intraday to make clear that these results are
|
||||
# being updated per minute
|
||||
_dict['intraday_risk_metrics'] = \
|
||||
self.intraday_risk_metrics.to_dict()
|
||||
_dict['intraday_perf'] = self.todays_performance.to_dict(
|
||||
_dict['minute_perf'] = self.todays_performance.to_dict(
|
||||
self.saved_dt)
|
||||
_dict['cumulative_risk_metrics'] = \
|
||||
self.cumulative_risk_metrics.to_dict()
|
||||
|
||||
@@ -649,7 +649,7 @@ algorithm_returns ({algo_count}) in range {start} : {end} on {dt}"
|
||||
self.algorithm_volatility.append(
|
||||
self.calculate_volatility(self.algorithm_returns))
|
||||
|
||||
# caching the treasury rates for the live case is a
|
||||
# caching the treasury rates for the minutely case is a
|
||||
# big speedup, because it avoids searching the treasury
|
||||
# curves on every minute.
|
||||
treasury_end = self.algorithm_returns.index[-1].replace(
|
||||
|
||||
@@ -26,7 +26,7 @@ log = Logger('Trade Simulation')
|
||||
class AlgorithmSimulator(object):
|
||||
|
||||
EMISSION_TO_PERF_KEY_MAP = {
|
||||
'minute': 'intraday_perf',
|
||||
'minute': 'minute_perf',
|
||||
'daily': 'daily_perf'
|
||||
}
|
||||
|
||||
@@ -185,7 +185,7 @@ class AlgorithmSimulator(object):
|
||||
elif self.algo.perf_tracker.emission_rate == 'minute':
|
||||
self.algo.perf_tracker.handle_minute_close(date)
|
||||
perf_message = self.algo.perf_tracker.to_dict()
|
||||
perf_message['intraday_perf']['recorded_vars'] = rvars
|
||||
perf_message['minute_perf']['recorded_vars'] = rvars
|
||||
return perf_message
|
||||
|
||||
def get_next_close(self, mkt_close):
|
||||
|
||||
Reference in New Issue
Block a user