if(Price > TrendSMA

That make no sense with series, maybe you meant not Price, but Price[0]?