Code: Select all
inputs:
filePath("C:\multicharts\export\");
variables:
intrabarpersist vFileName(""),
intrabarpersist resolution(""),
int output(0);
if StrLen(filePath) > 0 then begin
once begin
switch bartype_ex begin
case 1:
resolution = NumToStr(barinterval,0) + " tick";
case 2:
resolution = NumToStr(barinterval,0) + " minute";
case 3:
resolution = NumToStr(barinterval,0) + " hour";
case 4:
resolution = "daily";
case 5:
resolution = "weekly";
case 6:
resolution = "monthly";
case 7:
resolution = "year";
case 9:
resolution = NumToStr(barinterval,0) + " second";
end;
vFileName = filePath + symbol + "__" + resolution + "__.csv";
FileDelete(vFileName);
FileAppend(vFileName, "Date, Time, Open, High, Low, Close, Volume, Openint" + newline);
end;
end;
FileAppend(vFileName, FormatDate("yyyy-MM-dd" , DateTime) +","+ FormatTime("HH:mm:ss", DateTime) +","+ NumToStr(Open,5) +","+ NumToStr(High,5) +","+ NumToStr(Low,5) +","+ NumToStr(Close,5) +","+ NumToStr(Volume,5) +","+ NumToStr(Openint,5) + newline);
now switch to the savingPath folder and run in windows powershell:
Code: Select all
Get-Content '.\@ES__1 second__.csv' -Wait -Tail 5