Why is Tradelib in Java?

Why Java? Doesn’t sound like a meaningful question at first – whatever works, right? Yes, but it’s not that I didn’t have a choice, and Java was hardly my first choice. There were at least a few other attractive options: C#, Python and Go. Lat but not least, don’t forget, I am a professional C++ developer. So why Java? The history of Tradelib is somewhat interesting, so I decided to share it.
Read More

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.

Is the Stock Market Different?

Overall, we expect the stock market to go higher. There is a good reason for that – the stock market is positive close to 54% of the days. A natural questions is whether this holds for other markets as well. There is inflation after all.
Read More

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

All Clear on the S&P 500

Finally the S&P 500 cleared the 200-day moving average on the adjusted returns (here is the R script). This happened last week, as of the Wednesday’s close. The close was $208.94, and the index is currently trading lower. Was that a fluke just to lure traders back in? Time will tell.

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