Market Tech kindly reminded me that blindly trying to over-fit an algorithm for one testing period, will not result in values that are optimized for another time period. This notebook is a good example of that principle.
My previous notebook tested the year 2014 with AAPL stock and found that moving averages of 25 and 70 days provided the best results (even though these results didn't beat the actual performance of Apple stock). However, this new notebook calculates that the best moving averages for 2012 were 15 and 25 days.
It might be beneficial to test for optimal values once a week, and "walk-forward" by updating your algorithm with the most recent optimal values. However, this simple moving average example is not likely to be one that can predict future optimal values.