I have data for different traders (i.e) their ID's and whether the trade is buyer initiated or seller initiated.
I need to find the total number of trade packages which comprise of the set of trades which have been executed buy the same trader continuously in the same direction (i.e either selling or buying) without a gap of a single trading day. If any of these conditions is not satisfied, the package is completed till the previous record. could someone please assist me with the code?
the definition of a trade package is as follows:
Sequences of individual trades for each contract are classified as
packages if they are executed (i) from the same account, (ii) in the same
direction (e.g., buy trades), and (iii) successively without 1-day trading
break. an institution’s order execution is complete when it (i) begins
trading in the opposite direction, or (ii) stays out of the market in that
contract for more than one trading day.
I need do to calculate the number of such trade packages and the mean, median and std deviation of the volume of trades. Please help me asap. its very urgent.
I have already submited this querry to the technical support, but I'm having a problem in accessing the track. "No Technical Support Tracking Entries found " message is displayed everytime I am trying to check the status, though I am getting a mail saying that my querry has been answered, with the track number.
They mention a "Gibbs simulation of trade direction variables" and lecture notes seem to be posted on the web along with some programs that are referenced in the notes. Of course, I don't know whether the trade direction analysis covered in this course is relevant to your question, but it might contain some useful information and techniques.