Category Archives: Programming

Tradelib’s C++ Code Base

My previous post explained some of the reasons to move away from C++ to Java for my trading tools. It generated a few interesting, somewhat heated, but fruitful discussions. Hence, I thought I’ll share Tradelib’s C++ code base, just before I switched to Java. The code is on GitHub. It’s fairly small, but it proved sufficient to implement some interesting strategies. It’s just as it is – I am not planning on adding any new features, fixes or examples for it.

Creating Calendars for Future’s Expiration

Lately I have been doing calendar analysis of various markets (future contracts). Not an overly complicated task, but has a few interesting angles and since I haven’t seen anything similar on the Net – here we go.
Read More

First Tradelib Strategy

Finally I managed to find some time to prepare and share a strategy using my Tradelib library. The strategy implements a simple momentum rotation of a few ETFs on a monthly basis. Look for updates over the coming weeks – my plan is to update the wiki with more information on setup and use.

Trading Autocorrelation?

Markets are very smart in absorbing and reflecting information. If you think otherwise, try making money by trading. If you are new to it, make sure you don’t bet the house.

In other words, markets are efficient. At least most of the time. So then why people trade? The general believe is that there are windows during which prices of certain assets are inefficient. Thus, there are opportunities to make money. Is the presence of autocorrelation one such opportunity? Let’s find out.
Read More

When is a Backtest Too Good to be True?

One statistic which I find useful to form a first impression of a backtest is the success/winning percentage. Since it can mean different things, let’s be more precise: for a strategy over daily data, the winning percentage is the percentage of the days on which the strategy had positive returns (in other words, the strategy guessed the sign of the return correctly on these days). Now the question – if I see 60% winning percentage for a S&P 500 strategy, does/should my bullshit-alarm go off?
Read More

Where Does the S&P 500 Stand?

Last week was brutal for pretty much all markets. Surprisingly, it was bad even for the US dollar. The sharp and straight downward move was reminiscent of the descent of 2011. It’s time to review where does the major index stands from technical point of view.
Read More

Tradelib is Open Source

Tradelib is my framework which I have been using for backtesting and signal generation in my futures trading. My feeling is that it might be useful to others, and I have decided to open source it.

Unfortunately, I don’t have the time at the moment to open source any strategy implemented with it, and I am also too lazy to provide a step-by-step guide for it. If you have an interesting strategy which you don’t mind sharing with the rest of the world, let me know, and I may consider implementing it and adding it to the repository as an illustrative example.