It is easy for you.

Posted By: tuuPaul

It is easy for you. - 05/16/19 04:00

hello, i tried to export date to .csv file but it does not work. "Crush in function:run() at bar 0" this error appeared. Please give me the solution. Script is below

function run()
{
StartDate = 20160101;
EndDate = 20161231;
TimeFrame = 1;
vars une = series(priceClose());
printf(TO_CSV,"nDate: %s",strdate(YMD,0));
}
Posted By: Spirit

Re: It is easy for you. - 05/16/19 10:00

printf(TO_CSV is also wrong, it must be print(TO_CSV.

https://manual.zorro-project.com/printf.htm
Posted By: tuuPaul

Re: It is easy for you. - 05/16/19 10:34

okey works correct. I changed YMD with YMDH then i does not work. How to fix it? Also i want price and date must be locate in two separate columns. Now it located one columns. How fix it?
Posted By: Smon

Re: It is easy for you. - 05/16/19 13:43

Your script doesn't export your "une" series at all, so this can't be the code that writes date and price in the same column. Please show us the code snippet that isn't working as intended.
Posted By: tuuPaul

Re: It is easy for you. - 05/16/19 14:21

this script can export dates and une to .csv file. but i need to export une and dates not same column in .csv file. Alse want export time.

function run()
{

StartDate = 20160101;
EndDate = 20161231;
vars une = series(priceClose());
print(TO_CSV,"nDate: %s",strdate(YMD,0));
print(TO_CSV,"n une=%.3f",une[0]);

}
Posted By: AndrewAMD

Re: It is easy for you. - 05/16/19 14:39

CSV means "comma separated values". You need to assemble the strings yourself.

A comma will divide columns. A newline character will divide rows.
© 2024 lite-C Forums