tbg-Quant algorithmic trading framework

This project shows you how to build trading strategies using tbg-Quant algorithmic trading framework.

Dependence library: tbg-Quant-v1.1beta6

WHAT'S NEW in v1.1beta6 (september 2,2013)

  • NeuralBox package
  • IBAPI IBGateway support
  • IBAPI error/warning messages (improved)
  • IBAPI portfolio updating with multisecurity (Bug-Fixed)
  • Added TimeFrame attributo to CandleEvent
  • TickToCandleEvent Service, multisecurity
  • PositionTracker (Position_Pending) bug-Fixed
  • Added invokeStopStrategy method
  • Synchronizing Historical Data with YahooMarketDataFeed
  • Added apache commong-lang for DateUtils

Contents

examples.skeleton

    Skeleton.java
    Use this code like a starting point to build your unique strategy.

examples.helloworld

    HelloBogus.java
    Trading system placing orders every X events, it uses BogusMarketDataFeed (fake market data).
    MultiBogus.java
    Like HelloBogus but working on multiple symbols.
    HelloYahoo.java
    How to use Yahoo data usign YahooMarketDataFeed.
    HelloYahooSynchronizedBackTest.java
    Multi-security Yahoo example, synchronized ^GDAXI and SPY.
    HelloSiddhi.java
    How to use Siddhi CEP Provider.
    Siddhi CEP is a lightweight, easy-to-use Open Source Complex Event Processing Engine (CEP). Siddhi CEP processes events which are triggered by various event sources and notifies appropriate complex events according to the user specified queries. Siddhi is an alternative to Esper CEP.
    HelloEsper.java
    How to use ESPER CEP Provider.
    ESPER is an opensource CEP distributed under GPL2.0 license.Since tbg-Quant is proprietary software the Esper library is not bundled. Be sure to add the Esper library in the classpath. You can download Esper library from here: http://esper.codehaus.org/
    HelloIB.java
    How to connect to InteractiveBrokers. You can connect to IB throught TWS Client or IBGateway. Be sure to include the IB API library in the classpath before running the example.
    HelloTBG.java
    Shows how to access to online & offline TBG Historical data (raw 1 minute candle).

examples.interactivebrokers

    IB_CEP_Esper.java
    Complex Event Processing with InteractiveBrokers.
    Since IB is not providing candles in this example we use the CEP to build 1 minute candles.
    WARNING: Be sure to include Esper library and IB API in the classpath.
    IB_TS_Esper.java
    InteractiveBroker trading system example. It uses InteractiveBrokers as a MarketDataFeed and Broker.
    BE AWARE NOT TO USE THIS EXAMPLE ON YOUR IB REAL ACCOUNT!! Orders will be executed!
    WARNING: Be sure to include Esper library and IB API in the classpath.
    IB_CancelingOrders_Esper.java
    TickEvent are processed by Esper engine and printed out every 5 seconds with average price. It sends a limit order and then cancel it.
    WARNING: Be sure to include Esper library and IB API in the classpath.

examples.TripleMAStrategy

    TripleMAStartegy.java
    Full implementation of a simple trading system using a triple moving average cross. Works with Yahoo weekly data.

examples.orderRouter

    OrderRouter.java
    Routes orders received via CSV files to InteractiveBrokers account.
    WARNING: Be sure to include IB API in the classpath.

examples.ToM

    ToM_Strategy.java
    This strategy tries to exploit the well known Turn of the Month effect.
    Returns around 4% profit per year on SPY in the last 12 years.

examples.seasonal

    NovApr_Strategy.java
    This strategy tries to exploit the November-April seasonal effect.
    Returns around 6% profit per year on XOM,LMT and BHP in more than 20 years.

examples.csvCustomMarketDataFeed

    CsvCustomMarketDataFeed.java
    Show how to write your custom CSV MarketDataFeed, this example show how to use local CSV (Yahoo Format).
    You can easily adapt it to your CSV format by changing downloadQuotes() & loadData() methods.
    CsvCustomStrategy.java
    This strategy show how to use the CsvCustommarketDataFeed.

utils

    YahooDataSynchronizer.java
    Synchronizes Yahoo historical data between more symbols and write a csv file as output.
    Output data (csv format) includes date,X_Open,X_High,X_Low,X_Close,X_Volume,X_Yield , where X is the symbol.

Contacts

eMail : Alberto Sfolcini a.sfolcini@gmail.com
LinkedIn : http://www.linkedin.com/in/albertosfolcini
Feel free to contact me at any time.

Credits

tbg-Quant is a proprietary product of The Bonnot Gang www.thebonnotgang.com
GitHub : https://github.com/tbg-quant/tbg-quant.git
LinkedIn : http://www.linkedin.com/company/the-bonnot-gang/