Hi killerkhan, jcl. There have been a few other threads about this in the past, covering both withdrawing and reinvesting. Upgrading to new Zorro versions is also involved. It got complicated enough for me that I put together a spreadsheet to try to help. For your & others' benefits, I've tried to convert it into a template with instructions, and an example of use.
One thing to note is the conscious decision to not reduce Margin in the event of over-withdrawal. I've done this for 2 reasons:

1) It complicates the formulas - for me unnecessarily, because
2) I don't intend to ever withdraw more than recommended - if I mistakenly do, I'd rather fix that error.

This is by no means perfect and comments/improvements/corrections are welcome.

HTH.

Attached Files