Skip to content
All library documents

Filter Anomalous Trade Prints with Exchange Condition Codes

Article Quant Q&A · Author: Nelav

Summary

Time and sales feeds can include prices far from the displayed best bid or offer. Such prints may reflect special trade conditions, including out-of-sequence trades or crosses, rather than ordinary executions that should immediately update an algorithm’s P&L or trigger its stops.

The suggested approach is to use the condition code supplied with each trade and teach the trading system how to handle each condition. The note points to an exchange specification as a reference. It does not describe particular code values or a universal filtering rule, so handling should follow the relevant feed’s definitions and the algorithm’s intended use of the data.

Key ideas

  • Trade feeds may attach condition codes that explain why a print appears unusual.
  • Out-of-sequence trades and crosses are examples of special trade conditions.
  • Use the feed’s condition definitions to decide how each print should affect P&L and trading logic.
  • The note points to an exchange specification but does not provide a complete filtering method.

Tags

Full text
# Filtering "anomalous" time and sales prints


# Filtering "anomalous" time and sales prints












I'm building an algorithm which uses a live market data feed to updates its P&L and other metrics. I've been noticing that sometimes in the time and sales there are anomalous prints - prices many standard deviations above or below the best bid/offer on the level 2. Where are these sales coming from? And is there a good method to filter them from the time and sales prints my algorithm is reading? As currently, these anomalous prints are throwing my algo's P&L way off and leading to unnecessary stops.

## Answer by amdopt (score 1, accepted)

https://quant.stackexchange.com/a/33470

There should be a code attached to all trades that your program receives from a data feed. This code tells you the condition of the trade like a cross trade, an out of sequence trade (your problem above), etc. You need to make these codes part of your program so that your program knows how to handle the info it is getting from the data feed. I have attached a link to info from SIAC on the NYSE website. It's an exciting read. Good luck!

https://www.nyse.com/publicdocs/ctaplan/notifications/trader-update/cts_output_spec.pdf

Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.