[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] ANy help on this code made by Graham



PureBytes Links

Trading Reference Links

Hello  Friends,
Happen to come across an afl from Mr Graham.
tweaked it to make it compatibale for my work 
but something is still not working any help would be highly 
appreciated
i use to bulk export full quotes file of scrips in any watchlist
what i want was symbol name as filename.txt which i got that and 
date,o,h,l,c,vol,oi in csv/txt file which also i got it but the 
volumes i want was to be divided by 1000 which also i got it but the 
openint which i want to be divided by 1000 but it returns full amount 
the vol/1000 and oi/1000 i want it in decimals so 9835532 vol should 
be like 98355.532 same with oi .
Any help from anyone would be highly appreciated.
I use it to export some data from ab for further analysis outside ab
the afl is given below.
But it is modified & tweaked for my purpose. which please note
Thanks to Graham he made my life easier because i can now bulk export 
which earlier i use to take each scrip and aa it and then export Good 
automation and faster too. Thanks once again to Graham.
====================================================
/*
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( "c:\\AB2ms\\EOD\\"+Name()+".txt", "w"); 
if( fh ) 
{ 
   //fputs( "Ticker,Date,Time,Open,High,Low,Close,Volume \n", fh ); 
   fputs( "Date,Open,High,Low,Close,Volume,OpenInt \n", fh ); 

   y = Year(); 
   m = Month(); 
   d = Day(); 
//   r = Hour();
//   e = Minute();
//   n = Second();
                Volume=(V)/1000 ;
		OpenInterest=(OI)/1000;
   
   for( i = 0; i < BarCount; i++ ) 
   { 
      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,%.4f\n", 
                     O[ i ],H[ i ],L[ i ],C[ i ],V[ i ],OI[i] ); 

      fputs( qs, fh ); 
   } 

   fclose( fh ); 
} 

Buy = 0;

Thanks & Regards
hetu