-
Notifications
You must be signed in to change notification settings - Fork 166
Introduction
Tim Olson edited this page Jun 23, 2014
·
2 revisions
Coin Trader is a Java-based backend for trading cryptocurrencies, released under the Apache License. It brings together:
- XChange for market data, order execution, and account information
- Esper for querying events
- JPA / Hibernate for persistence
- JCommander and Antlr for command parsing
Coin Trader adds:
- a control console
- simulated trading
- schema and persistence, see below (package schema)
- csv market data output (not flexible yet, package module.savetickscsv)
- ad-hoc ascii table reports (command
jpa
andclass AdHocJpaReportCommand
) - module loader to connect data emitters, persisters, replayers, signals, strategies, etc, to Esper (package module)
- command pattern making new utilities easy to implement (package bin)
Coin Trader's future:
- live order execution, basic routing
- flexible data output
- basic signals
- accounting and reconciliation
- a variety of backtesting
To implement signals and strategies, you connect Esper event queries to Java code like this:
@When( "select avg(priceAsDouble) from Trade.win:time(30 sec)" )
void checkMovingAverage( double avg )
{
if( avg > trigger )
esper.publish( new MySignal(5.31) );
}
@When( "select * from MySignal where mySignalValue > 5.0" )
void enterTrade( MySignal s )
{
orders.create( Listings.BTC_USD, 1.0 )
.withLimit( 650.25 )
.place();
}
Then, when any Trade
market data arrives, your checkAverage()
method is invoked, which publishes your signal, which triggers the enterTrade()
method. Esper provides a rich and sophisticated language for querying the events published by Coin Trader.
Continue to Setup