Skip to main content


Posted in

To use Slf4j and Lilith:


import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Add slf4j-api-1.6.4 to the library.

Then in your class:

public class MyClass implements MyInterface {
	private static final Logger logger = LoggerFactory.getLogger(MyClass.class);

To generate a message:"This is a log message.");

Lilith -- Logback Event Viewer

Posted in

This is a brief note on Lilith -- the logback event viewer. I am quite new to Java coding and am far from being competent with the programming language. It has helped greatly to use logback to log debugging messages. In the live environment of working with a connector to IB's TWS it has been even more help that I can read logs in real-time using Lilith.

Example of Lilith with jIbMatlabConnector log messages

jIbMatlabConnector v0.3

The newest version of my code has had a major re-write of the Contract and ContractFactory classes. The new structure (which I think should be better) uses what I term a "PositionContract" as something which one may have a position in. For instance, this might be the stock AAPL (which IB lists with the primary exchange NASDAQ). However, the stock may actually trade on various venues such as CHX, BATS, ISLAND, LAVA (to name a few) and additionally via IB's SMART routing. Therefore, each of these local trading venues I term a "LocalContract".

TWS Historical Data

I have had a few questions about some data problems when retrieving historical data from TWS using my API. In particular, see:

So I have investigated this issue a bit more.

WFC Inside RTH 17Feb2011

jIbMatlabConnector v0.2.3

I have uploaded version 0.2.3 (please login to download attachments). This version contains a new matlab example script "example_main.m" which shows how to connect and request market data, real time bars, and historical data. The bulk of the coding has been put into functions in a "tools" folder with the "examples_main.m" showing how to make the basic data requests.

jIbMatlabConnector v0.2.1

Attached is the latest update to my Java TWS/Matlab interface. Please see the two example scripts in the "matlabexamples" folder on how to (1) place a request for historical data and (2) request market data and place orders based on the current market price. The javadoc is also included but documentation is still quite sparse.

I have had some helpful feedback from a few users and all feedback is greatly appreciated.

UPDATE 16/Feb: I have uploaded version 0.2.2 which contains a Matlab example on how to request RealTimeBars with storage in Sqlite.

Syndicate content