Striplines
Previous  Top  Next

The striplines command is a bit more complicated because it takes several parameters. First, here is a sample command line:

striplines|reversed.txt|mergedfile.txt|strippedlines.txt|2|,|buy|sell


This line takes a file named "reversed.txt" and reads it in. It checks to see if the item in the second column (and in this example the columns are separated by a comma) is either a buy or sell. If so, the line is written to a file named mergedfile.txt. If not, it is written to a file named strippedlines.txt.

Striplines is probably best understood with a little background about why it is needed. It is used to remove lines from the data file which do not represent buy or sell transactions because those are the only ones relevant for the matching engine.

This command takes three file names. The first is the input file it reads in. The second is an output file to which it writes transactions that are trades, and the third file is the catchall file for transactions stripped from the input file. In order to determine what should be stripped the command looks at a particular field number and looks for one of two choices. If that field has either one of the two values it goes into the output file of trades. If it has neither, it goes to the strippedlines file. The number is the field number to check (in this example, the second column). The comma in this example tells the engine that comments are used to divide the fields.

The actual matching engine works by comparing a field when it comes across two lines that have different "sides" or trade actions. In other words, it finds a stock like MSFT and looks for the next line with MSFT where the trade side is different than the first transaction. To the trade engine, it doesn't matter whether the side is "buy" and "sell" or "b" and "s", it simply matters that they are different. The striplines directive gives us a command to mold such a file to feed into the matching engine.