Friday, July 9, 2010

Review of ZeroMQ

Introduction

0MQ, or ZeroMQ, is message-passing middleware designed to be scalable, simple to include in your app (many language bindings), and above all else FAST. I'd recommend using ZeroMQ and not the low level Berkeley socket interface or a high level messaging system because it gives users the flexibility and performance of the low level while still having the ease of implementation of the high level. Also, maintaining raw sockets is difficult and cumbersome when you want to implement a scalable system. A high level system often works perfect if you use it for the situation it was designed for, but it can be difficult to change core elements of the system and its ease of use often comes with a cost in performance.

FAST

See some of these benchmarks in this scipy talk.  Here is one example using the python language bindings, PyZMQ:


Easy to use

Using 0MQ amounts to three things:
  1. Choose a transport
  2. Set up the infrastructure
  3. Select a messaging pattern
This is demonstrated in the following simple example using the python bindings:

import zmq
c = zmq.Context()
s = c.socket(zmq.REP)
s.bind('tcp://127.0.0.1:10001')
s.bind(‘inproc://myendpoint’)
while True:
    msg = s.recv()
    s.send(msg)

Where I (1) create a context, (2) create a socket type, (3) pick one or more transports, and (4) call socket.send and socket.recv. In actuality 0MQ provides 4 different transports:
  • INPROC an In-Process communication model
  • IPC an Inter-Process communication model
  • MULTICAST multicast via PGM, possibly encapsulated in UDP
  • TCP a network based transport
The TCP transport is often the best choice.  To see a few more examples of 0MQ see the introduction by Nicholas.  I downloaded it on my linux box, built it, and got the python bindings from git working in no time.  Especially useful with large-scale consumer websites, high-frequency trading, and multiscale modeling of complex systems. 



Monday, July 5, 2010

Review of open source trading software

Open source trading software


I've hastily put together a list of various open source trading packages.  More commentary on relative strengths/merits of each to come...

AIOTrade

http://blogtrader.org/

AIOTrade (formerly Humai Trader Platform) is a free, open source stock technical analysis platform built on Java and is being ported to Scala. Its pluggable architecture is also ideal for custom features extending, such as indicators and charts. It requires JRE 1.5+.


Auge
http://auge.sourceforge.net

Auge is an easy-to-use financial portfolio management application. Auge will help you monitor and analyze your stock and mutual fund positions, providing powerful insight into your entire investment portfolio.


Chartsy

http://www.chartsy.org/

Mostly a plug-in to the netbeans platform capable of displaying various financial charts useful to amateur traders.



EclipseTrade
http://eclipsetrader.sourceforge.net/

Stock exchange analysis system, featuring shares pricing watch, intraday and history charts with technical analysis indicators, level II/market depth view, news watching, automated trading systems, integrated trading. Based on Eclipse RCP framework.



JBookTrader
http://code.google.com/p/jbooktrader/


JBookTrader is a fully automated trading system (ATS) that can trade various types of market securities during the trading day without user monitoring. All aspects of trading, such as obtaining market prices, analyzing price patterns, making trading decisions, placing orders, monitoring order executions, and controlling the risk are automated according to the user preferences. The central idea behind JBookTrader is to completely remove emotions from trading, so that the trading system can systematically and consistently follow a predefined set of rules.

The features include strategy back testing, optimization, market data recording, and real time trading via the Interactive Brokers API.

JBookTrader is written in Java and is intended for software developers. It is not an "off-the-shelf" product that can be installed and run. Instead, JBookTrader provides a framework for developing automated trading systems and requires a certain amount of programming knowledge and experience in Java. If you are not a software developer or if you don't have much experience programming in Java, JBookTrader is probably not for you.  It derives from 
JSystemTrader (http://groups.google.com/group/jsystemtrader).


Market Analysis System
http://eiffel-mas.sourceforge.net/

Although the last release was in 2004, this is a system for analysis of financial markets using technical analysis. Includes facilities for stock charting and futures charting, as well as automated generation of trading signals based on user-selected criteria. Operates on both daily and intraday data.


Marketcetera
http://www.marketcetera.com/

Marketcetera LLC is building a new software platform committed to providing fast, flexible and reliable securities trading tools to financial services professionals. Our mission is to make world-class order-management and risk-management software available and affordable to individuals and to institutions of all sizes. Marketcetera focuses on building the key trading functions that are common to all organizations, thus freeing our clients to concentrate on proprietary trading algorithms and other specialized software that provide a competitive advantage.


Matrex
http://matrex.sourceforge.net/

Use Matrex, the un-spreadsheet, instead of spreadsheets when working with vectors (e.g. database data, charts) and matrices. The perfect desktop tool for mathematical, statistical models and complex calculations. Adapters to matlab, scilab, octave, R.












Projects no longer under active development:


ActiveQuant
http://www.activequant.org

AQ is a framework or an API for automated trading, opportunity detection, financial engineering,research in finance, connecting to brokers, etc. - basically everything around trading, written in Java, using Spring and Maven2. This is the successor to CCAPI2.  Ironically, it appears to no longer be active.





Data Visualizer
http://dataviews.sourceforge.net/

Modular environment for graphical visualization of stock market type data.  It has not been updated since 2006.





Merchant of Venice
http://mov.sourceforge.net/

Although this has not been updated since 2006, Venice is a stock market trading programme that supports portfolio management, charting, technical analysis, paper trading and genetic programming. Venice runs in a graphical user interface with online help and has full documentation.

Open Java Trading System
http://ojts.sourceforge.net/

The Open Java Trading System (OJTS) is meant to be a common infrastructure to develop (stock) trading systems. There are four parts: gathering of raw data over the internet, recognition of trading signals, a visualisation module and trading with banks. It has not been updated since 2007.


Oropuro trading system
http://www.oropuro.org

Complete technical analysis and trading system, full set of features: retrieve, analyze EOD stocks data; manage multiple portfolios; technical analysis and graphical rendering; neural networks for generation of trading signals; support trader community.  It was last updated in 2007.



TrueTrade
http://code.google.com/p/truetrade/

TrueTrade is a framework for developing, testing and running automatic trading systems. It is intended to provide support for a wide range of orders, financial instruments and time scales. It provides tooling for backtesting the strategy against historical data, and a separate tool for running the strategies in live mode. Strategies currently require some Java coding experience, though this may change at a later date. It was last updated in 2007.