Gamestudio Links
Zorro Links
Newest Posts
Blobsculptor tools and objects download here
by NeoDumont. 03/28/24 03:01
Issue with Multi-Core WFO Training
by aliswee. 03/24/24 20:20
Why Zorro supports up to 72 cores?
by Edgar_Herrera. 03/23/24 21:41
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
5 registered members (Quad, TipmyPip, degenerate_762, AndrewAMD, Nymphodora), 997 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Issues with converting .csv to .t6 #477616
07/16/19 10:56
07/16/19 10:56
Joined: Jul 2019
Posts: 2
C
chtostoic Offline OP
Guest
chtostoic  Offline OP
Guest
C

Joined: Jul 2019
Posts: 2
Hello

I'm trying to convert my .csv data to .t6, but it doesn't work as it should.
Using Chart gets errors and doesn't plot.

Chart compiling........... t6 AAPL_2007
Using AAPL_2007.t6
Warning 035: AAPL_2007 ticks overlap on 2007-01-03 14:31:00
Error 055: No bars generated

.csv format:
[Linked Image]

Converted .t6 looks fine in ZHistoryEditor:
[Linked Image]

My amendments in CSVtoHistory default file:
Code
#define SPLIT_YEARS

string InName = "AAPL_1M_12282006_28062019_UTC.csv";  // name of a single year CSV file
string OutName = "AAPL.t6";

string Format = ",%Y-%m-%d %H:%M:%S,f3,f1,f2,f4,f6";


Example of converted .t6 file: https://fex.net/s/dtrbtd2

Data is fine, without gaps.


Thanks in advance

P.S. I need to convert around 500 files from .csv to .t6, so I will be grateful for a hint how to automate this task.

Re: Issues with converting .csv to .t6 [Re: chtostoic] #477617
07/16/19 11:46
07/16/19 11:46
Joined: Jul 2019
Posts: 2
C
chtostoic Offline OP
Guest
chtostoic  Offline OP
Guest
C

Joined: Jul 2019
Posts: 2
Found the answer in another topic.

Originally Posted by AndrewAMD
Your csv is oldest to newest, but Zorro uses data from newest to oldest. Change your format string to indicate the reverse order.

Originally Posted by AndrewAMD
That works too. I was referring to adding a + sign to the front of the string, to indicate ascending order.



Added + sign resolved the issue
Code
string Format = "+,%Y-%m-%d %H:%M:%S,f3,f1,f2,f4,f6";



Still asking for a recommendation how to automate convertation of 500 .csv data files to .t6. Total newbie in Lite-C.

Thanks

Re: Issues with converting .csv to .t6 [Re: chtostoic] #477618
07/16/19 14:46
07/16/19 14:46
Joined: Jul 2000
Posts: 27,977
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,977
Frankfurt
If the names of the 500 files follow a convention, you can import them all with dataParse() in a loop.

Re: Issues with converting .csv to .t6 [Re: chtostoic] #485177
01/31/22 22:31
01/31/22 22:31
Joined: Jan 2020
Posts: 32
L
leohermoso Offline
Newbie
leohermoso  Offline
Newbie
L

Joined: Jan 2020
Posts: 32
Place all the files in the same dir and loop through them, like this:

Code
function convert_to_history(string filename)
{
	string InName = strf("D:\\Quotes\\Brasil\\DI\\%s",filename);
	if(!InName) return quit("No file"); 
	int Records = dataParse(1,Format,InName);
	printf("\n%d lines read",Records);

	string OutName = strx(InName,".csv",".t6");
	if(Records) dataSave(1,OutName);
	printf("\n%s",OutName);		
	
}

function main()
{
	Verbose = 7;
	  string file = file_next("D:\\Quotes\\Brasil\\DI\\*.csv"); // DIR WHERE THE FILES ARE
	while(true)
	{
		
		convert_to_history(file);
		dataNew(1,0,0);
		file = file_next(0);
		if(file == 0 || file == "0")
			break;

		

	}
	quit("done");

}


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1