Thursday, October 14, 2010

Tips for developing the best High frequency trading (HFT) system.

1) When developing your HFT system , make sure you have an order execution engine that mirrors how the market acts , which will help you test/debug your platform/strategy in your own computer. The 'test mode' that usually supplied by the exchanges is not a replacement for that. Remember that your main interest is to preform all unit testing in your own environment , before you even start testing on the server side. Any Developer knows that its a big headache to debug on remote server ,especially when the far server do not have a debugging environment. For eg: Think about a situation when you are testing remotely in the server and you get a crash ,which caused because your system cannot deal with the low latency - Now ,your immediate response will be to put some prints and find where is the bug that cause the crash - but if you put some prints you suspend the system ,and the bug will not be there anymore - Now , how can you solve this problem remotely ?

2) Latency is the most important issue in HFT , That's why your code needs to be tight, fast and rock solid stable. Having an Algo crash and being caught with shares when the market moves against you is not very profitable . Well-written code runs fast, whereas poorly written code runs slow. Furthermore, well-written, object-oriented code will be far easier to debug and maintain.

3) The best Latency can be achieved by using hardware-accelerated functions - In other words , instead of using high level language - your platform+strategies will be converted to custom block of hardware that can run many times faster than the same code optimized in tight assembly language. But ( There is always But ) , you can only get there after you wrote the best optimized code by yourself , and then you will get some ideas about the parts you want to optimize.

4) Before even start coding , think about all the bottlenecks that will come letter . Find the solutions before they appear .Design your system in a way that it can be expended easily without damaging the latency.As you know sooner or later you will have to add more features - make the design ready for any future requirements.

5) Use the power of the hardware you have - make sure your software can take the advantages of the hardware you have.Design your software in a way that if tomorrow you get a new powerful hardware , It will boost the performance of your software's performance without the need of changing your software, because your software was designed from the beginning , to naturally fit your hardware architectures.

6) Be sure to be armed with the latest technology - That's what can make the difference between micro and nano sec. Change your development approach and start thinking of using parallel programming standards such as MPI for processors communication or other advanced techniques for Shared Memory messaging (This days , you can get to 700 nanoseconds of Latency for IPC). By using Advanced process techniques ,you can identify patterns among streaming event data and respond to those patterns in microseconds , This makes it possible to monitor, analyze and act on market data and respond immediately. You can use neural network for stock market prediction , Evolutionary Computation techniques, such as genetic programming to analysis of financial markets with a reassuring degree of success ,and fuzzy logic to find patterns and trends in financial indices. By Using advance A.I. technologis , the experience of a trader can be incorporated in a natural way inside your system.

Moris oz
Algorithmic trading Consulting and development
www.caapitech.com