SMA (Simple Moving Average) is an arithmetic calculation obtained by adding the recent closing prices and then dividing them by…