Use the Adjusted Price instead of Close price with Yahoo Finance data. Adjusted Price includes splits and dividends in the historical prices so you don’t get jumps in the data.