Export Data from Amibroker to ASCII files

#21
Never mind, I worked it out.

Just changed

qs = StrFormat("%.2f,%.2f,%.2f,%.2f,%.0f\n",

to

qs = StrFormat("%1.4f,%1.4f,%1.4f,%1.4f,%.0f\n",

to give 4 decimal places. One step closer to being a programmer!:)
 

asnavale

Well-Known Member
#23
Hello,

Is it possible to import data only for the scripts which are already present in Amibroker data folder and avoide the scripts which are not present in amibroker data folder.
Hi,

Yes it is possible to import only the existing tickers. In ASCII import wizard, de-select the "Add new symbols" check-box.

-Anant
 
#26
fmkdir( "D:\\NINJATXT" );
Buy = ( (DateNum() >= 0940101 ) AND (DateNum() <= 1151231) );
for( i = 0; i < BarCount; i++ )
if( Buy )
{
fh = fopen( "D:\\NINJATXT"+Name()+".txt", "a");
if( fh )
{
y = Year();
m = Month();
d = Day();
r = Hour();
e = Minute();
s=Second();

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%02.0f;",r[ i ],e[ i ],s[ 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 );
}
}






The Above code is for Exporting Intraday Data for NT7 formate , I request senior members to modify this code to export Daily bars format, as i want to export perticuler daily data from amibroker & pull it to NT7

Example formats for Minute Bar & Daily Bars required By NT7

Minute Bars Format
Each bar must be on its own line and fields must be separated by semicolon (;). Only 1 minute bars can be imported.

The format is:
yyyyMMdd HHmmss;open price;high price;low price;close price;volume

Sample data:
20061023 004400;1377.25;1377.25;1377.25;1377.25;86
20061023 004500;1377.25;1377.25;1377.25;1377.25;27
20061023 004600;1377.25;1377.25;1377.25;1377.25;24
20061023 004700;1377.50;1377.50;1377.25;1377.25;82

Daily Bars Format
Each bar must be on its own line and fields must be separated by semicolon (;). Only 1 day bars can be imported.

The format is:
yyyyMMdd;open price;high price;low price;close price;volume

Sample data:
20061023;1377.25;1377.25;1377.25;1377.25;86
20061024;1377.25;1377.25;1377.25;1377.25;27
20061025;1377.25;1377.25;1377.25;1377.25;24
20061026;1377.50;1377.50;1377.25;1377.25;82
 

Attachments

Last edited:

Similar threads