A free stock market software with complete source code can be found here : http://jstock.sourceforge.net