PureBytes Links
Trading Reference Links
|
I have the following program that converts daily TS data into quarterly
ascii data in an external file. Since y2k it has added the 2000 date as 100
(yymmdd format, where 1999 was 99.) Any suggestions as to getting this to
work properly, for instance, to get it to produce yyyymmdd format?
Would I use the ELDate or the ELDateToString functions, and if so, how?
Thanks,
David Cicia
-------------------------
Input: nMonths(3);
var: Copen(0), Chigh(0), Clow(0), XFILE(" ");
XFILE = "D:\Omega\ascii\QT\"+ GETSYMBOLNAME +".QUA";
if currentbar = 1 then begin
Filedelete(Xfile);
Copen = Open;
Chigh = high;
Clow = low;
Plot1(Close,"Close") ;
end else begin
if (month(date) <> month(date[1])
and mod(month(date)-1, nMonths) = 0) then begin
{beginning of new month}
Fileappend(Xfile, NumToStr(Date[1],0)
+ " " + NumToStr(Copen,4)
+ " " + NumToStr(Chigh,4)
+ " " + NumToStr(Clow,4)
+ " " + NumToStr(Close[1],4)
+ Newline);
Copen = Open;
Chigh = high;
Clow = low;
end;
Chigh = Maxlist(Chigh, High);
Clow = MinList(Clow, Low);
if (Date = LastCalcDate and Time = LastCalcTime) then begin
Fileappend(Xfile, NumToStr(Date, 0)
+ " " + NumToStr(Copen,4)
+ " " + NumToStr(Chigh,4)
+ " " + NumToStr(Clow,4)
+ " " + NumToStr(Close,4)
+ Newline);
end;
end;
|