coding error - help

#1
Helo,

I am having amibroker BSE EOD data base with tikcer number and symbol fullname. I want to export all tickers with full symbol name to text file. But the fullname not exporting to text file. The following is the formula i'm using. Something wrong... can anybody find what's the wrong with this code.

Thanks for the help.

=====

fmkdir( "C:\\OHLC" );
Buy = ( (DateNum() >= 1160918 ) AND (DateNum() <= 1160925) );
for( i = 0; i < BarCount; i++ )
if( Buy )
{
fh = fopen( "C:\\OHLC\"+Name()+".txt", "a");
if( fh )
{
fputs( "<Ticker>,<fullname>,<Date>,<Open>,<High>,<Low>,<Close>,<Volume> \n", fh );

y = Year();
m = Month();
d = Day();
// r = Hour();
// e = Minute();

for( i = 0; i < BarCount; i++ )
if( Buy )
{
line = Name() + "," + StrLeft(FullName(), 15) +
fputs( Name() + "," , fh );
ds = StrFormat("%02.0f%02.0f%02.0f,",
y[ i ], m[ i ], d[ i ] );
fputs( ds, fh );

// ts = StrFormat("%02.0f:%02.0f,",
// r[ i ],e[ i ]);
// fputs( fh );

qs = StrFormat("%.2f,%.2f,%.2f,%.2f,%.0f\n",
O[ i ],H[ i ],L[ i ],C[ i ],V[ i ] );
fputs( qs, fh );
}
fclose( fh );
}
}
 

mastermind007

Well-Known Member
#2
Helo,

I am having amibroker BSE EOD data base with tikcer number and symbol fullname. I want to export all tickers with full symbol name to text file. But the fullname not exporting to text file. The following is the formula i'm using. Something wrong... can anybody find what's the wrong with this code.

Thanks for the help.

=====

fmkdir( "C:\\OHLC" );
Buy = ( (DateNum() >= 1160918 ) AND (DateNum() <= 1160925) );
for( i = 0; i < BarCount; i++ )
if( Buy )
{
fh = fopen( "C:\\OHLC"+Name()+".txt", "a");
if( fh )
{
fputs( "<Ticker>,<fullname>,<Date>,<Open>,<High>,<Low>,<Close>,<Volume> \n", fh );

y = Year();
m = Month();
d = Day();
// r = Hour();
// e = Minute();

for( i = 0; i < BarCount; i++ )
if( Buy )
{
line = Name() + "," + StrLeft(FullName(), 15) +
fputs( Name() + "," , fh );
ds = StrFormat("%02.0f%02.0f%02.0f,",
y[ i ], m[ i ], d[ i ] );
fputs( ds, fh );

// ts = StrFormat("%02.0f:%02.0f,",
// r[ i ],e[ i ]);
// fputs( fh );

qs = StrFormat("%.2f,%.2f,%.2f,%.2f,%.0f\n",
O[ i ],H[ i ],L[ i ],C[ i ],V[ i ] );
fputs( qs, fh );
}
fclose( fh );
}
}



line = Name() + "," + StrLeft(FullName(), 15) + ",";
fputs( line, fh );
 

Similar threads