i tried to rewrite under your advice. Script is below but there is an error not work. What is the problem?

function run()
{
asset("EUR/JPY");
StartDate = 20160101;
EndDate = 20161231;
TimeFrame = 1;
vars une = series(priceClose());
printf(TO_CSV,"nDate: %s",strdate(YMDH,0));
print(TO_CSV,"une=%.3f",une[0])
}