The syntax error tells you that you attempted to use vars (the return values from the WMA function) where you need series (for your HMA17 and HMA35 series). Vars and series are two different things. I see from your posted codes that you have not yet 100% understood what they are used for and when you need which. Please look again in lesson 4 of the tutorial - there it is explained.

The correct code would have been, when you include my code above for the HMA:

Code:
function run() 
{
var *ClosePrice = series(priceClose());
var *HMA17 = series(HMA(ClosePrice,17));
var *HMA35 = series(HMA(ClosePrice,35));

if(crossUnder(HMA17,HMA35))
  enterShort();
if(crossOver(HMA17,HMA35)) 
  enterLong();
}



- You don't need int(sqrt(n) + .5) to round because the WMA function expects an int for the time period, so the int conversion happens automatically when calling that function. C automatically converts basic variables. It does not automatically convert complex objects, though, such as a var to a series.