hello, in order to export close price of asset to .csv file i have written below script. But it works with incorrect result. please give me advice to fix it.

function run(){
StartDate = 20160101;
EndDate = 20161231;
TimeFrame = 1;
vars une = series(priceClose());
print(TO_CSV,"une",une);
plot("une",une,NEW,BLUE);
}