I want to backtest the impact of daily withdrawals of 0.1% of the total portfolio value. 

How can I do this, based on the attached algorithm?

Author