Under the hood, total_funds = self._total_funds(row) uses the close price to determine total funds. This impacts the value going into self._adjust_value (total_funds (at close) * weight). But the shares are then purchased / sold at the price passed in. I think this means that if open prices were passed in the shares would sell at close price, but then be bought at the open price. I suspect that prices shouldn't be passed in at all. The field should be passed and that should be used to re-balance the portfolio.
Solution:
Price is no longer passed in to adjust_precent(s) functions. Instead the row is passed along with the field to use.
total_funds is computed with the field that is passed in.
record_daily_balance() now requires only the row as a parameter.
fix Pandas performance issue with adding multiple new columns.
Under the hood, total_funds = self._total_funds(row) uses the close price to determine total funds. This impacts the value going into self._adjust_value (total_funds (at close) * weight). But the shares are then purchased / sold at the price passed in. I think this means that if open prices were passed in the shares would sell at close price, but then be bought at the open price. I suspect that prices shouldn't be passed in at all. The field should be passed and that should be used to re-balance the portfolio.
Solution:
fix Pandas performance issue with adding multiple new columns.
Resolves:
75