Dear Members,

 when i m trying to export RT data in 1 min compression from a Tick 
database using the following AFL, it skipes some ticks from counting.

thanx in advance,
Soumya


_SECTION_BEGIN("Export RT Data");
fmkdir( "F:\\SaveData" );
//Buy = ( (DateNum() >= 1070608) AND (DateNum() <= 1080208) ) AND V>0;

//if we want to oexport data for a single Day, we modify the Second 
line like this
Buy = ( (DateNum() == 1080208)) AND TimeNum() < 152959 AND  V>0;

for( i = 0; i < BarCount; i++ )
if( Buy[i] )
{
  //fh = fopen( "F:\\SaveData\\Cash_IEOD.csv", "a");//if we want to 
export all data in a single file//
  fh = fopen( "F:\\SaveData\\"+Name()+".csv", "a");// if we want to 
export data in an individual file// 
  if( fh ) 
   { 
         fputs
( "<ticker>,<date>,<time>,<open>,<high>,<low>,<close>,<volume> \n", 
fh ); 
     y = Year(); 
     m = Month(); 
     d = Day(); 
     r = Hour();
     e = Minute();
   
   for( i = 0; i < BarCount; i++ )
   if( Buy[i] )

   { 
      fputs( Name() + "," , fh );
      ds = StrFormat("%02.0f/%02.0f/%02.0f%02,", 
                     m[ i ], d[ i ], y[ i ] ); 
      fputs( ds, fh ); 
     
      ts = StrFormat("%02.0f:%02.0f,", 
                     r[ i ],e[ i ]); 
      fputs( ts, fh ); 

      qs = StrFormat("%.2f,%.2f,%.2f,%.2f,%.0f\n", 
                     O[ i ],H[ i ],L[ i ],C[ i ],V[ i ] ); 
      fputs( qs, fh );
   }
   fclose( fh );
   }
}
  

Reply via email to