Help with Amibroker Formula
Hi All,
I am new to Amibroker and I am hoping to get some help with a formula. The formula below which I got off the internet outputs data to a text file.
It outputs it to only 2 decimal places but I would like it to output to 5 decimal places so that I can use it for Forex. Can anyone tell me how to do that please?
Thank You
fmkdir( "C:\\OHLC" );
Buy = ( (DateNum() >= 971225) AND (DateNum() <= 1110110) );
for( i = 0; i < BarCount; i++ )
if( Buy )
{
fh = fopen( "C:\\OHLC\\"+Name()+".txt", "a");
if( fh )
{
y = Year();
m = Month();
d = Day();
r = Hour();
e = Minute();
for( i = 0; i < BarCount; i++ )
if( Buy )
{
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( ts, fh );
qs = StrFormat("%.2f,%.2f,%.2f,%.2f,%.0f\n",
O[ i ],H[ i ],L[ i ],C[ i ],V[ i ] );
fputs( qs, fh );
}
fclose( fh );
}
}
Hi All,
I am new to Amibroker and I am hoping to get some help with a formula. The formula below which I got off the internet outputs data to a text file.
It outputs it to only 2 decimal places but I would like it to output to 5 decimal places so that I can use it for Forex. Can anyone tell me how to do that please?
Thank You
fmkdir( "C:\\OHLC" );
Buy = ( (DateNum() >= 971225) AND (DateNum() <= 1110110) );
for( i = 0; i < BarCount; i++ )
if( Buy )
{
fh = fopen( "C:\\OHLC\\"+Name()+".txt", "a");
if( fh )
{
y = Year();
m = Month();
d = Day();
r = Hour();
e = Minute();
for( i = 0; i < BarCount; i++ )
if( Buy )
{
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( ts, fh );
qs = StrFormat("%.2f,%.2f,%.2f,%.2f,%.0f\n",
O[ i ],H[ i ],L[ i ],C[ i ],V[ i ] );
fputs( qs, fh );
}
fclose( fh );
}
}