Hey!

i am trying to code a tickdata recorder, which records multiple symbols from the same account to separate .csv files. My idea was to define the symbols in the TickDataRecorder.csv file and create a loop, which writes to multiple .csv files on every new tick received. Unfortunately Zorro crashes after creating the second .csv file and keeps writing the same string to the second .csv. Any ideas why this is not working?

Code


function tick()
{	
	int i;
	
	for (i=0; Assets[i]; i++) {
		
		asset(Assets[i]);
		
		var AskA = priceClose(), BidA = priceClose() - Spread; 
		
		char Filename[20]; Filename[0] = '\0';
		string Acc = AccountName; 
		string Sym = Symbol;
		strcat(Filename, Acc);
		strcat(Filename, "_");
		strcat(Filename, Sym);
		strcat(Filename, ".csv");
	
		file_append(Filename,strf("\n%s.%.0f,%.10f,%.10f",strdate(YMDHMS),1000.*modf(second(),0),BidA,AskA));
		
		printf("\n%s.%.0f  A %.10f  B %.10f",
		strdate(YMDHMS,0),1000.*modf(second(),0),BidA,AskA);	
	}
}

function run()
{
	assetList("TickDataRecorder.csv");
	LookBack = 0;
}