We calculate partial sales using the First In First Out method (FIFO method). This is the default accounting method in the US. It presumes that you’re selling the oldest shares first.
You buy 100 shares of a stock for $50 each, and a year later buy 100 more at $60 each. By the next year, when the stock is trading at $80 each, you sell 50 shares. In this example, as per the FIFO method, it would mean selling your $50 shares first, resulting in a capital gain of $30 per share, or $1,500 in total.
Your gains or losses will be reflected daily in your account.