Friday, May 15, 2009

Marketcetera Automated Trading Platform

Marketcetera platform consists of the following components:

* Photon - a light-weight GUI for entering orders, monitoring them and running strategies. Built on top of the Eclipse Rich Client Platform.
* ORS - Server that includes an Order Routing System for accepting orders from Photon, StrategyAgnet or Order Loader and routing them to an exchange, persistence layer backed by a database (MySQL is installed with the product) and authentication module.
* Order Loader - for batch loading of large numbers of orders.
* Strategy Agent - standalone environment for running strategies.
* Platform modules - CEP, Strategy, Market Data Adapters (such as the Marketcetera simulated market data feed) and more.

* TradeBase - a web-based reporting application for all of your trading activity.
It can be used to view, create and modify positions, trades, accounts and equities. Built on Ruby on Rails.

Currently the Marketcetera platform is built on top of Spring Framework with an embedded ActiveMQ message queue middleware. Queues (i.e. point-to-point connections) and topics (i.e. publish/subscribe connections) are both used to communicate amongst the pieces of the Marketcetera platform. In general, queues are used to communicate messages going "toward" a broker or exchange, and topics are used for response messages going the other direction. This way we can guarantee that instructional messages - such as orders and cancels - are delivered once and only once, and informational messages - such as execution reports - are distributed to all authenticated clients. In addition, ORS publishes a set of Web Services interfaces used internally by the platform client components such as Strategy Agent, Photon, etc. We use Apache CXF technology as our web services framework.

ORS stores all of the trades, execution reports and positions information in a database accessed by the persistence layer. ORS is configured to use the MySQL database out of the box, but we are database agnostic and can be reconfigured to use any other database, such as Oracle or PostgreSQL.

What are the system requirements for building the Marketcetera platform?

* Java 1.6
* For Tradebase, you need Ruby and Ruby on Rails
* We use Eclipse for Photon development, IntelliJ for the ORS and OrderLoader, and RadRails for the Tradebase
* You need a Unix/Linux/MacOS X platform to build the Quickfix bindings for Ruby (see building Quickfix)
* MySQL (or any other) database for ORS and Tradebase

What is it written in?

* Photon is written in Java on top of Eclipse RCP v3.4
* ORS and OrderLoader are written in Java, with heavy use of Quickfix/J and ActiveMQ and Spring projects
* Tradebase is written using Ruby on Rails

SVN checkout over HTTP doesn't work for me

If you are sitting behind a transparent HTTP proxy that doesn't let SVN PROPGET command through, you may not be able to check out the code using regular svn co http://... command. Instead, you can use the SVN protocol itself, for example:

svn co svn://code.marketcetera.org/root/trunk marketcetera-platform

I can't compile source code after checkout

If you try to compile the source code after checking it out and you see errors similar to this:

marketcetera-platform/source/core/src/main/java/org/marketcetera/marketdata/IMarketDataFeedFactory.java:[21,39]
generics are not supported in -source 1.3 (try -source 1.5 to enable generics)
public interface IMarketDataFeedFactory,C>,

Then you've probably missed a step during the build setup. Make sure you've done the following

* Copy profiles.xml.sample to profiles.xml in the top-level directory
* Verify that your default Java is 1.6 and not 1.5

(ZT) ajax框架比较

Dojo1.0.2,Ext2.0.1,GWT1.4,Prototype 1.5.1,JQuery 1.2.3,MooTools 1.2


Ajax Framework分类:

1.

javascript底层封装,自由度大,具有基础的Widget组件

Prototype 1.5.1,JQuery 1.2.3,MooTools 1.2

2.

面向用户的Widget开发,不需要太多编写

Ext2.0.1

3.

完整,成熟的整套框架

Dojo1.0.2,GWT1.4,SmartClient


优缺点分析:

1.

优点:js文件占用小,开发由开发人员控制,可扩展性大

缺点:需要较长的开发周期,开发人员有相当的经验

2.

优点:丰富,美观的UI Widget设计,扩展CSS改变风格

缺点:自定义Widget编写

3.

优点:从底层封装,到UI设计都有不错的实现

缺点:框架过于庞大,掌握时间较长


项目适用性分析:

1.

过于底层,需要相当的经验及人力 剔除
2.

Ext2.0.1画面可称为Perfact,是所有Ajax Framework中最炫的,常用功能相当齐全,在Widget过多时会出现性能瓶颈问题

Demo:http://www.dojochina.com/book/ext/examples/index.html

3.
1.

SmartClient:原本是商业项目,去年11月开源,丰富的Widget和Demo

Demo:http://www.smartclient.com/#_Welcome

2.

Dojo1.0.2:时间最长久的Ajax框架,从UI Widget到图表,底层到高层一 应俱全

Demo:http://www.dojochina.com/dojo/demos/demoEngine.html

3.

GWT1.4:适用于单一Html,功能全由Ajax实现的应用

e.g. GMail , Google Map

Demo:http://code.google.com/webtoolkit/examples/


*

GWT1.4:若在多页面跳转项目中使用,会产生大量的文件(1个html至少产生11个必需文件,不利于后期文件系统管理) 剔除
*

SmartClient:具有丰富的UI设计和成熟的框架体系,但由于过去作为商业应用,于去年11月刚刚开源,在社会上缺乏使用基础,文档除了官方提供外无他 剔除


性能分析:

SlickSpeed

http://mootools.net/slickspeed/


Ext性能瓶颈问题:

过去放弃Ext是由于Ext在处理大量控件,诸如数据表格阵列时性能堪忧。


测试案例:

加载数据量 共耗时(秒) 直接调用Action返回XML耗时(秒)

20 2 <1

200 10 2

700 20 8

1400 40 17


其实所有Ajax Framework对于大量Grid都会出现诸如Ext性能问题,Ext比较突出的原因,我认为是因为它做得太漂亮了,造成了div层迭代过多。

Web设计中放弃table转而使用div+css的架构,原因就在于迭代table对于客户端的运行效率是个噩梦,如果使用过多的div虽然不至于产生table迭代当机的可能,但相当慢是必然的。

(ZT)AJAX框架/库比较和选择:ECHO2, GWT, DOJO, PROTOTYPE, JQUERY

看了几篇中英文的AJAX库/框架比较文章,为方便选择使用,特归纳如下:
首先,要在两个类别中选择,一个是编译类,一个是非编译类别。
Echo2/GWT是将JAVA代码编译成JAVASCRIPT,乍看很方便,不用掌握JS也能做出炫目界面。但这只适于不会或者不想了解JS的情况,对于还是想完全控制和定制界面的项目就不适合。
另外,有一种观点认为JAVA->JS转换是一种低级语言向高级语言转换,本身没有意义。有点像去学汇编,然后再找个工具把汇编语言代码转换成C代码来用。我虽然没完全想通这个观点,不过,我一直用C/C++,这几年才逐渐发现JAVA确实是一种进化。没准别人说的是对的呢?
在Echo2和 GWT中,GWT大部分工作是在客户端,尽量少跟SERVER打交道,适合大型网站运用;ECHO2信奉“用到才加载”的信条,所以会有大量向 SERVER的访问,适合企业应用。另外,个人觉得ECHO2是个更全面的的一站式框架,界面也非常炫。但它的开发工具要收费。
再谈非编译类别,它们包括DOJO、PROTOTYPE、JQEURY,下面一一介绍:
先说PROTOTYPE,它比较轻量极,能让你的代码更加简化。最经典莫过于“美圆函数”:
document.getElementById(’elementid’) 变成$(’elementid’)
它加强了JS语言的可开发性,降低了学习JS的门槛。
DOJO最吸引人的是它的事件系统和丰富的可定制组件。它可以用形如下面的语句为各种HTML元素加入事件:
dojo.event.connect(someNode, "onclick", doStuff);
正由于DOJO提供了强大功能,它分成了许多包,可以分别包含使用。
JQUERY也提供了美圆函数,它的插件系统也提供象DOJO的组件,但它没有PROTOTYPE那样简洁,也没有DOJO这么多的组件供使用,但它兼收两家优点,并且个头不大,文档也算完整,所以说它介乎于前述两者之间。
所以,如果你需要非常完整的工具组件请用DOJO,如果你想优化你的JS代码,提高书写技巧请用PROTOTYPE,如果你想两者兼顾就用JQUERY。

Current Trends on Web development

1. Rich Client:

Tools:
Java Swing,
Flex/Adobe Air
Ruby on Rail
.NET WinForm/.NET WPF
JavaFx
SilverLight


RichClient/RIA原则与实践:

http://www.infoq.com/cn/articles/thoughtworks-practice-partiii;jsessionid=D3A2D0499A34CFBE0A6E1F3E64AAF5F5

http://www.infoq.com/cn/articles/thoughtworks-practice-partiii-ii


Ajax Framework/Library:
ECHO2, GWT, DOJO, PROTOTYPE, JQUERY

Thursday, May 14, 2009

Two good introduction to JAX-WS:

http://www.javapassion.com/webservices/jaxwsbasics.pdf

http://publib.boulder.ibm.com/infocenter/ieduasst/v1r1m0/index.jsp?topic=/com.ibm.iea.wasfpws_v6/wasfpws/6.1/JAX-WS/WASv61_WSFP_JAX-WS_Overview/player.html

Java API for XML Web Services

Java API for XML Web Services
From Wikipedia, the free encyclopedia


The Java API for XML Web Services (JAX-WS) is a Java programming language API for creating web services. It is part of the Java EE platform from Sun Microsystems. Like the other Java EE APIs, JAX-WS uses annotations, introduced in Java SE 5, to simplify the development and deployment of web service clients and endpoints.

The Reference Implementation of JAX-WS is developed as an open source project and is part of project GlassFish, an open source Java EE application server. It is called JAX-WS RI (For Reference Implementation) and is said to be production quality implementation (contrary to the former Reference Implementation being a proof of concept). This Reference Implementation is now part of the Metro distribution[1].

JAX-WS also is one of the foundations of WSIT.

[edit] Name change

JAX-WS 2.0 replaced the JAX-RPC API in Java Platform, Enterprise Edition 5. The name change reflected the move away from RPC-style and toward document-style web services.