Hi jcl. I've looked over the official formulas. Here's an example:

Code:
C	Balance	W	P	f	Av.w/d	W/d	Av.rei.	New Margin
								$40
$4,000	$8,000	$0	$4,000	1.41	$2,343		$5,657	$57
	$8,000	$0	$4,000	1.41	$2,343	$1,000	$4,950	$49
	$5,000	$1,000	$2,000	1.22	$101		$4,082	$41
	$7,000	$1,000	$4,000	1.41	$1,343	$1,343	$4,000	$40
	$7,000	$2,343	$5,343	1.53	$887		$4,580	$46
	$5,000	$2,343	$3,343	1.35	-$420		$3,690	$46
	$5,000	$2,343	$3,343	1.35	-$420	-$1,500	$4,797	$48
	$5,000	$843	$1,843	1.21	$166	$500	$3,723	$37
	$5,500	$1,343	$2,843	1.31	$268		$4,205	$42
	$5,500	$1,343	$2,843	1.31	$268	$750	$3,632	$36
	$5,500	$2,093	$3,593	1.38	-$11		$3,992	$36



Rather than Balance=C+P-W, I'm using P=Balance-C+W, since Balance is directly available from the account. Available for Reinvestment is calculated after any Withdrawal (including negative = Capital add) is done. To make the New Margin math simple, I'm using original Margin = 1% of C.

The only time New Margin is not calculated is if the Available for Withdrawal is <=0 and no Withdrawal is done. This would mean the strategy is in a (hopefully temporary laugh ) underperforming phase, no changes are being made, and just let it ride...

Do these numbers look correct? One of my main discomforts is reflected in the first 2 lines. In the 1st line, the account is up, no Withdrawal is done, so the earnings are reinvested by increasing to the New Margin. On the second line, the account Balance is the same so according to the official formulas the Available to Withdraw is the same since none of C, P, W, or Balance have changed. However, I've increased Margin due to reinvestment - shouldn't the Available to Withdraw be smaller to reflect this and prevent the account going margin call due to open trades entered using the increased Margin?

In the absence of Withdrawals, can the Margin be raised whenever a new Balance high occurs?

Thanks.