org.otfeed is a software to access financial data feed services of Opentick Corporation .
Disclaimer: This software is not endorsed by Opentick Corporation. Author of this software is not affiliated with Opentick Corporation.
Opentick Corporation provides access to the financial data, including real-time feeds, and historical quotes. They provide client API libraries for many languages, including .NET, COM, CPP, and Java.
This project includes an alternative Java client API. The reason for forking the client code are:
Following packages constitute the org.otfeed project:
If you have problems using org.otfeed or think you discovered a bug, go to the forums. You can reach forum page from Sourceforge's front page for this project:
http://www.sourceforge.net/projects/otfeedYou may also want to subscribe to the forums in order to get notifications of new releases.
Currently, code maturity is at BETA stage: all functionality is in place,
no major API changes are expected.
Testing and bug fixes have to be completed.
We are proud to announce the first stable release, 0.1.0 (9/16/2007).
Get the latest source tree from the SVN repository:
$ svn co https://otfeed.svn.sourceforge.net/svnroot/otfeed/trunk/otfeed-all
This will create a folder in your current directory with the following structure:
otfeed-all/ otfeed-driver/ otfeed-samples/ otfeed-script/
Change current directory to otfeed-all and build all artifacts:
$ cd otfeed-all $ mvn -Dmaven.test.skip=true install
To assemble scripting application, do this:
$ cd otfeed-all/otfeed-script $ mvn assembly:directory
To generate javadoc documentation for driver package, do:
$ cd otfeed-all/otfeed-driver $ mvn javadoc:javadoc
Compiled project artifacts can be downloaded from the project's file release page .
Currently, we release the following binary packages:
To use the driver, you will need driver's JAR file, and API docs. Both
are available at the
project's
file release page
: look for the files
named otfeed-driver-X.X.X.jar
and
otfeed-driver-X.X.X-javadoc.zip
.
Online Javadoc API can be found
there
.
We recommend downloading and
reading sample application sources from
project's file release
page
(look for otfeed-all-X.X.X-sources.zip
), or directly from
the subversion repository:
svn co https://otfeed.svn.sourceforge.net/svnroot/otfeed/trunk/otfeed-all/otfeed-samples
Scripting engine allows one to issue arbitrary requests to the Opentick server, using a simple script written in Groovy. If you are new to Groovy, you may need to check Groovy project home . However, most people find Groovy syntax intuitive enough to start coding right away.
Following is a simple script, that requests historical quotes:
import org.otfeed.*; import org.otfeed.event.*; import org.otfeed.command.*; import org.otfeed.support.*; // command-line parameters are in the pre-defined variable called "args". println("script called with parameters: $args"); // create Connection factory def cf = new OTConnectionFactory( username: args[0], password: args[1], hosts: [ new OTHost("feed1.opentick.com", 10010) // , new OTHost("feed2.opentick.com", 10010) ] ); // helper: convenient date input def dateParser = new DateFormat("MM/dd/yyyy"); // handles incoming data: just print it out (make date look nice too) def dataHandler = { def t = dateParser.format(it.timestamp); println("$t, $it.openPrice, $it.highPrice, $it.lowPrice, $it.closePrice"); } // prepare a command. def command = new HistDataCommand( exchangeCode: "Q", symbolCode: "GOOG", startDate: dateParser.parse("1/1/2006"), endDate: dateParser.parse("5/5/2006"), aggregationSpan: AggregationSpan.days(), dataDelegate: dataHandler as IDataDelegate ); // connect (connection specs set on the factory, so pass null as first param) def connection = cf.connect(null, new SimpleConnectionStateListener()); // prepare and submit request. Wait for request completion. def r = connection.prepareRequest(command); r.submit(); r.waitForCompletion(); if(r.error != null) { println "ERROR: $r.error" } // disconnect connection.shutdown(); connection.waitForCompletion();
To use the Scripting Engine you have to either build it from sources, or
download binary distribution from the
project's
file release page
:
look for the archive named otfeed-script-X.X.X-bin.zip
.
Note that Java run-time version 1.5 or later must be installed and available on the command search path.
Unpacked scripting archive has the following structure:
otfeed-script-X.X.X-bin/ bin/ lib/ samples/
To run the scripting engine, change current directory to
otfeed-script-X.X.X-bin
and fire the engine:
$ cd otfeed-script-X.X.X-bin $ java -jar lib/otfeed-script-X.X.X.jar samples/exa01.groovy username password
samples/exa01.groovy
.
Examine the content of samples/
directory for the
sample scripts. Use them as a template to write your own requests to
the Opentick server.