str(dir) was returning content like below (newlines and white space added for readability) until 2014-12-01. Now it doesn't return anything in the debugger, or if you print it, the output is merely like '2014-11-25 PRINT <user_partial object at 0x7e40260>'.
Algos in paper trading that used str(dir) hit:
Something went wrong and your live algorithm has stopped.
There was a runtime error. See the more detailed error below. If you need help, please send us feedback. Once you resolve the problem in the source algorithm, redeploy it to continue live trading.
I had picked up on str(dir) in a message by Grant and then later Alisa said "we're definitely planning to keep that functionality".
What happened to it? Would like to know whether the change was a mistake (bug) or intentional and what we can expect going forward.
str(dir) example output:
<bound method AlgorithmProxy.qdir of AlgorithmProxy(
capital_base = 100000.0 sim_params =
SimulationParameters(
period_start = 2014-11-12 00:00:00+00:00,
period_end = 2014-11-14 23:59:00+00:00,
capital_base = 1000000.0,
data_frequency = minute,
emission_rate = daily,
first_open = 2014-11-12 14:31:00+00:00,
last_close = 2014-11-14 21:00:00+00:00
),
initialized = True,
slippage = VolumeShareSlippage(
volume_limit = 0.25,
price_impact = 0.1
),
commission = PerShare(
cost = 0.03,
min trade cost = None
),
blotter = Blotter(
transact_partial = (
VolumeShareSlippage(
volume_limit = 0.25,
price_impact = 0.1
),
PerShare(
cost = 0.03,
min trade cost = None
)
),
open_orders = defaultdict(
<type 'list'>,
{}
),
orders={},
new_orders = [],
current_dt = 2014-11-12 14:31:00+00:00
),
recorded_vars = {}
)
>
I started using str(dir) to pull the last bar date/time, then also to print info about the run at the beginning of the run in the logging window, found that useful. It became essential for a run summary to be reliable and it greatly simplified a lot of code.
If it is being dumped, I would bet that an environment variable something like below could be coded up very quickly, at least the first four for starters, please consider that route, and consider making it a priority.
context.env = {
'arena' : 'backtest', # live, paper, or backtest
'mode' : 'minute', # daily or minute
'start' : 2014-11-25 09:31:00,
'end' : 2014-11-26 16:00:00,
'slippage' : {
'type' : 'VolumeShare',
'volume_limit' : 0.25,
'price_impact' : 0.1
},
'commission' : {
'type' : 'PerShare',
'cost' : 0.03,
'min trade cost' : None
},
'platform' : 'quantopian', # quantopian or zipline
'exchanges' : ['nyc'] # for the future, and tokyo etc
}