Hi all,
I was trying to search an option which will export the data from AmiBroker to a folder where the data will be stored in seperate csv sheets. for eg. Abb will be stored in a sheet where the data will be there from the date specified in the AA window to the date specified in AA window. and same for Acc and same for ambuja and on and on.
1. The range of date is specified in AutoAnalysis Window.
2. The stocks to be exported are defined in the filter (Group).
Now after a good search I found the code from AmiBroker HELP section and I tried. It worked. The only problem I'm facing is that, it is not taking the date range specified in the AutoAnalysis window. By default it is taking the first day of my database To tilldate. Below is the code I found
( First make sure that you have made the " SaveData " directory in C drive. )
fh = fopen( "c:\\SaveData\\"+Name()+".csv", "w");
if( fh )
{
fputs( "Ticker,Date,Open,High,Low,Close,Volume \n", fh );
y = Year();
m = Month();
d = Day();
//r = Hour();
//e = Minute();
//n = Second();
for( i = 0; i < BarCount; i++ )
{
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 ],n[ i ] );
//fputs( ts, 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;
Can anyone please throw some light that how the range of date will start working ?? Thanks in Advance.
Thanks & Regards
Avinash Raste
I was trying to search an option which will export the data from AmiBroker to a folder where the data will be stored in seperate csv sheets. for eg. Abb will be stored in a sheet where the data will be there from the date specified in the AA window to the date specified in AA window. and same for Acc and same for ambuja and on and on.
1. The range of date is specified in AutoAnalysis Window.
2. The stocks to be exported are defined in the filter (Group).
Now after a good search I found the code from AmiBroker HELP section and I tried. It worked. The only problem I'm facing is that, it is not taking the date range specified in the AutoAnalysis window. By default it is taking the first day of my database To tilldate. Below is the code I found
( First make sure that you have made the " SaveData " directory in C drive. )
fh = fopen( "c:\\SaveData\\"+Name()+".csv", "w");
if( fh )
{
fputs( "Ticker,Date,Open,High,Low,Close,Volume \n", fh );
y = Year();
m = Month();
d = Day();
//r = Hour();
//e = Minute();
//n = Second();
for( i = 0; i < BarCount; i++ )
{
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 ],n[ i ] );
//fputs( ts, 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;
Can anyone please throw some light that how the range of date will start working ?? Thanks in Advance.
Thanks & Regards
Avinash Raste