Hi,
I am trying to simulate some retirement strategies and I would like to do the following:
- Add a certain amount of cash to the portfolio (which would be used to buy stocks), simulating a pre-retirement situation;
- Withdraw a certain amount of cash from the portfolio, simulating a post-retirement situation;
I though in adding, at each handle_data, the context.portfolio.cash to a very low interest investment, in order to simulate the withdrawal. This way, I could "record" its value and track the money the algo is producing as dividends and capital gains, which would be the equivalent to retirement income;
I tried manipulating portfolio.cash with no results. Any help would be appreciated.
Thank you