A 1440 timeframe when you have mostly daily bars is many years long and your lookback period is 1000 years. You must calculate the sma by script with only 1 bar per day, and use a normal lookback period of 200 or so.