// Strategy template ///////////////////////
// MKTS Daily line format: Date,Open,High,Low,Close,Volume
// 02/28/2020,108.4,110,107.475,107.575,44239
// string Format = "+%m/%d/%Y,f3,f1,f2,f4,f6";
string Format = "+%Y-%m-%d,f3,f1,f2,f4,f6";
function writeTheFile(string InName){
if(!InName) return quit("No file");
// apparently resets the file read thing
dataNew(1,0,0);
string OutName = strx(InName,".csv",".t6");
dataParse(1,Format,InName);
printf("writeTheFile: %s \n", OutName);
dataSave(1,OutName);
}
function run() {
set(LOGFILE);
// you should change this to your history location folder
string Name = file_next("D:\\asset-data\\norgate-as-csv\\*.csv");
printf("the first file name is: %s \n", Name);
bool breakLoop = false;
while(!breakLoop){
Name = file_next(0);
printf("next file name is: %s \n", Name);
writeTheFile(Name);
if(Name==NULL){
printf("last value: %s \n", Name);
breakLoop = true;
}
}
printf("success \n");
return quit();
}