Now if you read the manual and look at the definitions of the functions SMA, EMA, and TEMA, you will learn the second argument needs to be an int rather than a var. (A var is actually a double.)