Been using the below analysis to export FX data. Amibroker's default timeshift and weekend filter did most of what I needed but the data is institutional (I'm not) and has flat minute-by-minute prices for New Years Day and a few other holidays too when the FX market is utterly flat. This messes with some of my existing models and development.
Fix is pretty simple- Filter = H > L; will get rid of these holidays and additional stagnant minutes wasting space.
I'm no coder though. The export script I found as a template online and made minor modifications I needed. Is it possible to implement this filter into this export?
Thanks
/*
Export intraday and EOD data to TXT files
*/
fh = fopen( "H:\\Asirikuy Scrubbed\\"+Name()+"_Filter.txt", "w");
if( fh )
{
fputs( "Date,Time,Open,High,Low,Close,Volume \n", fh );
y = Year();
m = Month();
d = Day();
r = Hour();
e = Minute();
index = BarCount - 15000000;
if(index > 0)
{
for( i = index; i < BarCount; i++ )
{
fputs( "" , 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("%.5f,%.5f,%.5f,%.5f,%.0f\n",
O[ i ],H[ i ],L[ i ],C[ i ],V[ i ] );
fputs( qs, fh );
}
}
else {
for( i = 0; i < BarCount; i++ )
{
fputs( "" , 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("%.5f,%.5f,%.5f,%.5f,%.0f\n",
O[ i ],H[ i ],L[ i ],C[ i ],V[ i ] );
fputs( qs, fh );
}
}
fclose( fh );
}
Buy = 0;
Attachment(s) from scottgibbs157@yahoo.com [amibroker] | View attachments on the web
1 of 1 File(s)
Posted by: scottgibbs157@yahoo.com
Reply via web post | • | Reply to sender | • | Reply to group | • | Start a New Topic | • | Messages in this topic (1) |
This group is for the discussion between users only.
This is *NOT* technical support channel.
TO GET TECHNICAL SUPPORT send an e-mail directly to
SUPPORT {at} amibroker.com
TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)
For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/
EmoticonEmoticon