|
Trading compliance algorithms can be very complex depending on the type of compliance for which the trading data stream is used. However, when deriving additional attributes on a trade record, the entire detection mechanism can be greatly simplified, which improves reliability and performance. This also provides additional time for investigations and review which otherwise would not be available.
The process of "how" is introduced below. Further details can be provided upon request.
Discussion
- Introduction
As shown in Fig.1, we have a trade (the "Ask side" point of view) and we are trying to determine if the market conditions were favorably applied to the trade; i.e., trade was not delayed or executed early to make a better spread for the firm. Therefore, the goal for a BE calculation is to find out such points in time so that trading was possible either before trade execution time (timeSinceNBBO) or after (timeUntilNBBO).
This document does not discuss performance from the point of view of multiple instances of the utility itself, as it is understood, performance is increased with the number of instances.
- Standard analytical approach:
Our standard approach is fairly straightforward--it iterates from the moment of trade execution time ONE BY ONE for each consolidated NBBO (consolidated means prevailing per second) forward or backward until required specified conditions are meet. Undoubtedly, the advantage of this approach is the simplicity of its algorithm. But the drawback to this approach is its computational complexity, especially when trade execution time is early in the trade session and the price is steadily increasing, then performance might suffer.
The worst-case scenario computation complexity will be O(NxM), in which N is the number of NBBOs and M is the number of trades per particular symbol (not using a consolidated NBBO figure would result in an greater number of operations).
- Linear approximation approach:
This idea is that prior to making a search, we find out all extremes (turning points, either up or down turn) on the graph's progress and use this information to speed up the search to determine the edges.
In Fig.1, there are 8 extremes (numbers 1....8 on the picture). Supposedly, we need to find timeUntilNBBO. Looking into the graph we immediately can say that 1--2 segment will not work since at tradeNBBO point its already less than tradePrice and the segment is falling. Since we know 2 -- 3 values and both of them are less than the trade price, we can exclude this segment too, same as 3---4,4---5 and 5---6. Therefore, we only consider the segment 6—7, and since it is steadily increasing (meaning Y(x+1) > Y(x) for any x inside the segment) we can use a search algorithm (which gives us O(LogNs) operations). This is faster than iterating each point of the graph, (O(Ns)) where Ns is length of segment. O(LogNs) is a good result but only if we have long segments, i.e., less volatility in the trading/nbbo. Otherwise the advantage of binary search diminishes rapidly. In this approach, compared to the standard approach, we iterate the particular segments instead of over each point.
|
Comment by bbpricsm on 2010-03-22 12:12:42 Zfn0OK maycehpbfqxw, [url=http://ufczyfwbmynd.com/]ufczyfwbmynd[/url], [link=http://expntxncebyj.com/]expntxncebyj[/link], http://swathyqiqtxj.com/ |
|