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

File Append function issues



PureBytes Links

Trading Reference Links

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 <><><>}