When I try to record, upon each rebalancing, a list of tickers in the portfolio with their weights, I keep getting an error. Is there no way to do this? Can only single numerical values at each rebalancing be recorded?
Tried this:
def record_vars(context, data):
for s, pos in context.portfolio.positions.items():
record('stk'=s,'pos'=pos)
but get the following error (which doesn't occur if I take out record_vars()): Backtest Error - Something went wrong starting a full backtest.