Let's say I paid at \$80 10 units for \$800 + 1% of fees for the buying is a total of \$808 spent in 10 units.
Now, the price is \$85 and when I sell I will need to pay another 1% of fees but I want to distribute the profit into both cash and stock, so I'll end up with $\$800 + profit/2$ in cash and $profit/2*currentPrice$ in stock, not an integer.
Here the approximation I did:
$PV = PaidPrice * PaidUnits$
$CV = CurrentPrice * CurrentUnits$
$fee = 0.01$
$profit = CV(1-fee) - PV(1+fee)$
So I end up with this:
$PV + profit/2 = CV$
After working on the formula I end up like:
$PV(1+f) = CV(1-f)$
But that leaves all the profit in the stock, so I am trying to understand what am I doing wrong
Try setting out all the values:
So we need three simultaneous equations to find the three unknowns
Solving these will give
As a check