Moving Average With Variable Period Cost