Hi Statalist users,
I have intraday trading data for 100 stocks for 100 days. Each day contains several hundred trades ordered by time stamps (to the millisecond). At the beginning of trading each day, there are several trades stamped to the exact same millisecond (so these are the first set of trades for the day). I would like to keep only those trades.
My data is laid out as:
So in this case I would like to keep only the first 2 trades of BHP and the first 3 trades of CBA.
Could someone please suggest a way to code this?
Thanks,
Alex
I have intraday trading data for 100 stocks for 100 days. Each day contains several hundred trades ordered by time stamps (to the millisecond). At the beginning of trading each day, there are several trades stamped to the exact same millisecond (so these are the first set of trades for the day). I would like to keep only those trades.
My data is laid out as:
Instrument | Date | Time | Trade Volume | Price |
BHP | 20051029 | 10:00:00.000 | 250 | 1.57 |
BHP | 20051029 | 10:00:00.000 | 333 | 1.57 |
BHP | 20051029 | 10:14:00.079 | 456 | 1.66 |
BHP | 20051029 | 10:19:47.016 | 92 | 1.68 |
BHP | 20051029 | 10:23:17.001 | 56 | 1.54 |
BHP | 20051029 | 10:33:27.165 | 387 | 1.57 |
CBA | 20051029 | 10:00:00.000 | 100 | 1.34 |
CBA | 20051029 | 10:00:00.000 | 99 | 1.34 |
CBA | 20051029 | 10:00:00.000 | 555 | 1.34 |
CBA | 20051029 | 10:15:32.003 | 600 | 1.35 |
CBA | 20051029 | 10:17:55.004 | 10 | 1.34 |
CBA | 20051029 | 10:17:55.004 | 999 | 1.33 |
Could someone please suggest a way to code this?
Thanks,
Alex
Comment