According to the Trinity Study, A portfolio consisting of stocks and bonds survived about 95% percent of all 30 year periods between 1926 and 1995, when 4% of the total portfolio value was withdrawn at the beginning of each year. 

Inspired by these findings, I want to backtest the following 2 scenarios:

  1. Selling 0.02% of all holdings each day and withdrawing the cash
  2. Withdrawing 0.02% of cash each day without selling anything, i.e. boworring against the holdings. 


How can these two scenarios be implemented, based on the attached algorithm?