I would like to calculate capital gain of a stock (e.g., FXAIX) at the end of the year with 2 conditions: