Too Much Parallelism is as Bad

The other day I run a machine learning backtest on a new data set. Once I got through the LDA and QDA initial run, I decided to try xgboost. The first thing I observed was a really bad performance. The results from the following debugging session were quite surprising to me.

Read More

Is There a Winner from all This BS?

There is abundance of claims that markets (by definition US markets) are rigged. Rigged in the sense that orders are often executed in a way, which contradicts to the natural intent of the person/machine behind the order. Until now, I have dismissed most of these as (populist) speculation, or, conspiracy theory. There is some truth in it however and my feeling is that it’s detrimental to all participants, yes, even to the “winner” in the examples I am going to show.
Read More

Volatility and Bollinger Bands

It is a common knowledge that Bollinger Bands (price standard deviation added to a moving average of the price) are an indicator for volatility. Expanding bands – higher volatility, squeezing bands – lower volatility. A bit of googling and you get the idea. In my opinion – that’s wrong, unless, one uses a twisted definition of volatility.
Read More

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.

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.