How to add a stock with some cost base?

1. Compute share price as cost base divided by number of shares.

2. Record Buy Shares transactions to add X number of shares by the price computed in step 1.

3. Record a dummy deposit on the investment account for the same amount as total of the Buy Shares transaction entered in step 2.