Ok thanks I'll take that into account.
But as I posted in my code with trading statistics above there are two other methods of reinvesting in the tutorials you posted (Code 2 & 3 from the original post) that should if I understand the lessons correctly the whole point of implementing reinvestment is to make more profit from the same amount of starting capital?
Edit: Now I look at Code 2 again I notice it does use Balance, though I pulled that code directly from Workshop 6_2. My question above should still apply to Code 3 from my original post though it does not and as you can see changes the required capital from 544 to 2751.