"Flip": algo symbol flips
Scenario: "Flip": algo symbol flips
Level: Medium
Type: Fix
Access: Email
Description: FIX (Financial Information eXchange) is an electronic protocol for trading. Messages are tag=value fields separated by SOH (ASCII 0x01; logs here use |). A message starts with 8= (BeginString), 9= (BodyLength), 35= (MsgType) and ends with 10= (CheckSum). See FIX encoding.
Our execution algo has a bug: on some fills it stamps the wrong symbol, e.g. an AAPL execution labeled DELL, GOOG labeled INTC.
You get three files: reference market data at /home/admin/market/BANDS.csv (symbol,min_px,max_px bands that never overlap), plus /home/admin/fix/orders.log (35=D orders with 11=ClOrdID and true 55=Symbol) and /home/admin/fix/executions.log (35=8 fills with 17=ExecID, 11=ClOrdID, stamped 55=Symbol, 31=LastPx).
FIX tag dictionary (lines look like 8=FIX.4.2|9=...|...|10=...|, | in place of the SOH delimiter):
35 MsgType: D = NewOrderSingle (order), 8 = ExecutionReport (fill) 11 ClOrdID: client order ID (links a fill back to its order) 17 ExecID: fill ID, unique per fill (e.g. EX000123) 55 Symbol: true symbol on orders, as-stamped (possibly wrong) on fills 31 LastPx: price of this fillThere are two independent ways to catch a flip: show the execution price is impossible for the stamped symbol against the market data bands (e.g. a $75 fill labeled GOOG whose band is $20-$30), or join 11=ClOrdID back to the order's true 55=. Create /home/admin/fix/corrections.csv with one ExecID,correct_symbol per line listing only the flipped fills with their true symbols.
Credit Alex Elliot
Root (sudo) Access: True
Test: corrections.csv lists exactly the flipped fills (~25 of ~960): every ExecID paired with its true symbol, no missing, extras, or duplicates.
The "Check My Solution" button runs the script /home/admin/agent/check.sh, which you can read and execute.
Time to Solve: 25 minutes.