mirror of
https://github.com/wassname/catalyst.git
synced 2026-07-17 11:25:55 +08:00
Adds reprs for PerformanceTracker and TradingEnvironment.
For debugging in the REPL.
This commit is contained in:
@@ -206,6 +206,11 @@ class PerformanceTracker(object):
|
||||
keep_transactions=True
|
||||
)
|
||||
|
||||
def __repr__(self):
|
||||
return "%s(%r)" % (
|
||||
self.__class__.__name__,
|
||||
{'trading_environment': self.trading_environment})
|
||||
|
||||
def transform(self, stream_in):
|
||||
"""
|
||||
Main generator work loop.
|
||||
|
||||
@@ -94,6 +94,13 @@ class TradingEnvironment(object):
|
||||
|
||||
self.prior_day_open = self.calculate_prior_day_open()
|
||||
|
||||
def __repr__(self):
|
||||
return "%s(%r)" % (
|
||||
self.__class__.__name__,
|
||||
{'first_open': self.first_open,
|
||||
'last_close': self.last_close
|
||||
})
|
||||
|
||||
def calculate_first_open(self):
|
||||
"""
|
||||
Finds the first trading day on or after self.period_start.
|
||||
|
||||
Reference in New Issue
Block a user