else if(strstr(Source,".t8")) {
CONTRACT *Ticks = file_content(Source);
int Records = file_length(Source)/sizeof(CONTRACT);
printf("\n%d records..",Records);
#ifdef MAX_RECORDS
Records = min(Records,MAX_RECORDS);
#endif
#ifdef ASCENDING
int nTicks = Records;
while(--nTicks)
#else
int nTicks = -1;
while(++nTicks < Records)
#endif
{
CONTRACT *t = Ticks+nTicks;
string otype,otype2;
switch(t->Type){
case PUT:
otype="P";otype2="A";
break;
case CALL:
otype="C";otype2="A";
break;
case PUT+EUROPEAN:
otype="P";otype2="E";
break;
case CALL+EUROPEAN:
otype="C";otype2="E";
break;
default:
printf("None of them! ");
}
//format: date, put/call, american/european, expiry date, strike, ask, bid, volume, open interest, underlying closing price
file_append(Target,strf("%s,%s,%s,%d,%.2f,%.2f,%.2f,%d,%d,%.2f\n",
strdate("%Y-%m-%d",t->time),
otype,otype2,(int)t->Expiry,(var)t->fStrike,(var)t->fAsk,(var)t->fBid,(int)t->fVol,(int)t->fVal,(var)t->fUnl));
if(!point(nTicks)) return;
}
}