* * Transactions data from pp 215-217 * open data ibm9912-tp.dat data(format=free,org=columns) 1 134131 day time price * * Create the dummy which defines within-day, normal trading hours data * set smpl = day==day{1}.and.time>=9.5*3600.and.(time<=13*3600.or.day<>31.and.time<=16*3600) * * Compute the time and price gap series * set timegap = time-time{1} set pricegap = (price-price{1})*16.0 * spgraph(vfields=2,footer="IBM transactions data for December 1999") graph(smpl=smpl,header="(a) Time durations") # timegap graph(smpl=smpl,header="(b) Price changes") # pricegap spgraph(done) * * Compute the percentage of observations with no duration and with no change. * This is done with SSTATS with the MEAN option applied to a logical expression. * sstats(smpl=smpl,mean) / time==time{1}>>noduration price==price{1}>>nochange * disp "Fraction of trades with zero duration" noduration disp "Fraction of trades with no price change" nochange * dec vect pos(8) neg(8) compute grid=%seqa(1.0,1.0,8) * do i=1,8 if i==8 sstats(smpl=smpl,mean) / pricegap>=grid(i)>>pos(i) pricegap<=-grid(i)>>neg(i) else sstats(smpl=smpl,mean) / pricegap==grid(i)>>pos(i) pricegap==-grid(i)>>neg(i) end do i * report(action=define) report(atrow=1,atcol=1,span) "Table 5.3 Percentages of Intraday Transactions Associated with Price Change" report(atrow=2,atcol=1,align=center) "1" "2" "3" "4" "5" "6" "7" ">7" report(atrow=3,atcol=1,tocol=8,span,align=center) "Upward Movements" report(atrow=4,atcol=1,fillby=rows) pos*100.0 report(atrow=5,atcol=1,tocol=8,span,align=center) "Downward Movements" report(atrow=6,atcol=1,fillby=rows) neg*100.0 report(action=format,picture="##.##") report(action=show)