Hi, I have a number of daily trading data set, which are named as t20161201, t20161202, etc. I want to compute a cumulative trading volume (e.g. volume + size), and once the cumulative volume exceeds a specified threshold, then stop the computing and output this single obs (since I want to know how long to get this volume). The problem is that sometimes the threshold is very large, and it may take several days for a stock to reach this trading volume. So I have to judge whether I need to append next day's data to compute the volume until it meets the threshold. One possible logic is to combine these daily data set together and compute the volume directly, but the size of these data set could be very large ( 4g per data set), so it may be inefficient to compute it in this way. In this case, I have to judge whether I can get the volume within one day, if not, then I need to append next day' data and compute again, then I have to judge again and compute again...until the volume meets the threshold. I am struggling to write the code. Any helps is very appreciated!!
... View more