This is read-only version of AFL library entry. Ability to add user formulas
and comment is only available from members-only area.
Details:
Formula name:
Export All Daily Data to TXT with MS import format
Author/Uploader:
Khalid Mirza - kjmirza [at] gmail.com
Date/Time added:
2008-01-05 06:17:23
Origin:
Keywords:
Amibroker metastock convert export
Level:
basic
Flags:
showemail,function
DISCLAIMER: Most formulas present in AFL on-line library are submitted
by the users and are provided here on an "as is" and "as available" basis.
AmiBroker.com
makes no representations or warranties of any kind to the contents or the operation
of material presented here. We do not maintain nor provide technical support
for 3rd party formulas. Description:
this formula will export all tickers to a text file formatted with Metastock Import Format, after export you can use hte downloader or any other utility to convert the TEXT file to MS format
Formula:
/*
Export intraday and EOD data to TXT files
One file for each stock
In the first line insert the directory you want to save them to, make sure the
directory exists
Select your charts to export with the "Apply to" filter in AA window
Select the timeframe period you want to save as using the AA "Settings"
Press Scan button
by Graham Kavanagh 05 Feb 2004
*/
fh = fopen( "d:\\newfold\\msdata.txt", "a");
if( fh )
{
fputs( "<ticker>,<name>,<per>,<date>,<open>,<high>,<low>,<close>,<vol>\n",
fh );
y = Year();
m = Month();
d = Day();
for( i = 0; i < BarCount; i++ )
{
fputs( Name() +","+ Name() +",d," , fh );
ds = StrFormat("%02.0f%02.0f%02.0f,",
y[ i ], m[ i ], d[ i ] );
fputs( ds, fh );
qs = StrFormat("%.4f,%.4f,%.4f,%.4f,%.0f\n",
O[ i ],H[ i ],L[ i ],C[ i ],V[ i ] );
fputs( qs, fh );
}
fclose(fh);
}
Buy=0;