2014/06/01 Deposit some cash Equity:OpeningBalances Assets:Investing:Cash $20000 2014/06/02 Buy one lot Assets:Investing:Stocks 10 MSFT @ $500 Assets:Investing:Cash 2014/06/02 Buy another lot Assets:Investing:Stocks 10 MSFT @ $510 Assets:Investing:Cash 2014/06/03 Sell at average cost Assets:Investing:Stocks -10 MSFT {$505} @ $520 Assets:Investing:Cash