I'm trying to establish variables equal to ...
The value of my SPY holdings at the beginning of the month. I've attempted to capture this with below language, but I keep getting an error that says "TypeError: history() takes exactly 4 positional arguments (3 given)." Any ideas how to fix?
context.portfolio.positions[context.SPY].amount * data.history(context.SPY, 'price', 30)
And the value of my SPY holdings at the end of the month, given (i) the price change in SPY over the course of one month and (ii) assuming the number of shares held in SPY stays constant during the month. Is this correct?
context.SPY.amount*data.current(context.SPY, 'price')