[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: File Append function issues



PureBytes Links

Trading Reference Links

here is a sample that may be of use to you.

Chris

Input: DIR("c:\ascii\"), NAME("filename"),  oval(o), hval(h),
Lval(l),Cval(c);

If currentbar = 1 then filedelete(DIR+name +".txt");

If currentbar >= 1 then FileAppend(DIR+name +".txt",
NumToStr(month(date),0)  +"/"+  NumToStr(FracPortion(date/100)*100,0)  + "/"
+ NumToStr(1900+year(date),0) +","+  NumToStr(oval,4) + ","  +
NumToStr(hval,4) + "," + NumToStr(lval,4) + "," + NumToStr(cval,4) +
newline );

if c<> c then plot1(1," ");



----- Original Message ----- 
From: "Paul" <rivatrading@xxxxxxxxx>
To: <omega-list@xxxxxxxxxx>
Sent: Sunday, October 30, 2005 9:12 PM
Subject: File Append function issues


> Hi All,
>
> I am trying to figure out the file append function.
>
> I am trying to create a metastock ascii file with the following format
> <date>, <time>, <open>, <high>, <low>, <close>, <volume>
> <yyyymmdd>, <HH:MM>, <open>, <high>, <low>, <close>, <upticks + downticks>
>
> and I want it to export to the "C:\TSdata\" directory
>
> and I want the file name to be
> <symbol>_lastbaronchartDATE_lastbaronchartTME.csv
>
> I have included what I have done below but it does not verify. Would
> someone mind having a look at the code and see where I maybe going wrong.
>
> Thanks
> Paul
>
> { <><><> START CODE <><><>}
> Inputs: DIR("c:\TSdata\"), Decimalz(2);
>
> Vars: Name(String);
>
> If LastBaronChart then Name = (Symbol + NumToStr(1900+year(date),0) +
>   NumToStr(month(date),0) +
>   NumToStr(FracPortion(date/100)*100,0) + "_" +
>
>   NumToStr(IntPortion(TIME/100),0) +
>   NumToStr(FracPortion(TIME/100)*100,0));
>
>
> If currentbar >= 1 then FileAppend(DIR+name +".csv",
>   NumToStr(1900+year(date),0) +
>   NumToStr(month(date),0) +
>   NumToStr(FracPortion(date/100)*100,0) + "," +
>
>   NumToStr(IntPortion(TIME/100),0) + ":" +
>   NumToStr(FracPortion(TIME/100)*100,0) + "," +
>
>   NumToStr(Open,Decimalz) + "," +
>   NumToStr(High,Decimalz) + "," +
>   NumToStr(Low,Decimalz) + "," +
>   NumToStr(Close,Decimalz) + "," +
>   NumToStr(Upticks + Downticks,0) + "," + newline );
>
> if c<> c then plot1(1," ");
>
> {<><><> END CODE <><><>}
>