Hi,
Someone. could you please help me to export hourly amibroker data to text file? I used the below AFL to export the same. But I am not getting the timeframe as I expected. I should have timeframe as below
9:00
10:00
11:00
12:00
13:00
14:00
15:00
9:00
..
..
Please someone help me
Someone. could you please help me to export hourly amibroker data to text file? I used the below AFL to export the same. But I am not getting the timeframe as I expected. I should have timeframe as below
9:00
10:00
11:00
12:00
13:00
14:00
15:00
9:00
..
..
Please someone help me
Code:
_SECTION_BEGIN("Export Analysis1");
fh1 = fopen( "d:\\OHLC\\"+Name()+"\\price_h.txt", "w");
TimeFrameSet( inHourly );
d = Day();
y = Year();
r = Hour();
e = Minute();
n = Second();
m = Month();
if( fh1 )
{
for( i = BarCount - 50; i < BarCount; i++ )
{
fputs( Name() + "," , fh1 );
ds = StrFormat("%02.0f-%02.0f-%02.0f,",y[ i ], m[ i ], d[ i ]);
fputs( ds, fh1 );
ts = StrFormat("%02.0f:%02.0f,",r[ i ],e[ i ]);
fputs( ts, fh1 );
smah=0;
for (j = i - 12; j <= i;j++){
smah = smah + H[j];
}
smah = smah/13;
smal=0;
for (j = i - 12; j <= i;j++){
smal = smal + L[j];
}
smal = smal/13;
qs = StrFormat("%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.0f\n",O[ i ],H[ i ],L[ i ],C[ i ],sma,smah,smal,V[i]);
fputs( qs, fh1 );
}
}
fclose( fh1 );
TimeFrameRestore();
Buy=1;
_SECTION_END();