Trading with REST

Many brokers and exchanges can nowadays be accessed online with a REST API that communicates with plain-text HTTP requests. The days of awkward proprietary broker APIs are coming to an end. This article is a step by step instruction of implementating a REST API interface in C for connecting a trading system to the Bittrex cryptocurrency exchange. It’s for the Zorro platform, but the principles are also valid for other exchanges and platforms. The C code for a basic REST API implementation is relatively short and straightforward. Continue reading “Trading with REST”

Why 90% of Backtests Fail

About 9 out of 10 backtests produce wrong or misleading results. This is the number one reason why carefully developed algorithmic trading systems often fail in live trading. Even with out-of-sample data and even with cross-validation or walk-forward analysis, backtest results are often way off to the optimistic side. The majority of trading systems with a positive backtest are in fact unprofitable. In this article I’ll discuss the cause of this phenomenon, and how to fix it. Continue reading “Why 90% of Backtests Fail”

The COVID survival calculator

Trading is obviously affected by global pandemics. Not only because markets tank whenever a new virus variant emerges. It’s also personal. After all, if you know that you have only a few months before you likely die, you might be motivated to trade a little more risky. To help you with this decision, I’m publishing here a Zorro script that calculates your average survival time depending on the COVID incidence in your country and on your vaccination status. Continue reading “The COVID survival calculator”

Monetize Alternative Facts!

After last week’s events, major social media companies made another attempt at saving humanity. Twitter and Facebook booted Trump and some of his enablers, Google and Apple cancelled Parler. But is censorship the right way to stem the swell of disinformation, postfactuality, dislocation from reality? I think not. Here’s a better solution. And you can even use it to earn some extra dollars. Continue reading “Monetize Alternative Facts!”

“Please Send Me a Trading System!”

“It should produce 150 pips per week. With the best indicators that you know. How much does it cost? Please also send live histories of your top systems.” 
Although we often get such requests, we still don’t know the best indicators and can’t send live histories. We do not invent algo trading systems, but program them from clients’ specifications. And we do not trade them, except for testing. But after almost 1000 systems, we can see a pattern emerging. Which algo trading strategies do usually work? Which will fall apart already in the backtest? Here’s a ranking of all systems we did so far, with a surprising winner. Continue reading ““Please Send Me a Trading System!””

The Scholz Brake: Fixing Germany’s New 1000% Trader Tax

Would you like to read – from begin to end – a 18 page pounderous law draft titled “Law for introducing a duty to report cross-border tax structuring”? The members of the German Bundestag apparently didn’t. After all, nothing seemed wrong with a duty to report cum-ex schemes. So the new law, proposed by finance minister Olaf Scholz, passed legislation on December 12, 2019 without much discussion. Only afterwards its real content, hidden on page 15, became public. It caused incredulity and turmoil among traders and investors. This article deals with the new bizarre German ‘trader tax’, and with ways to step around it. Continue reading “The Scholz Brake: Fixing Germany’s New 1000% Trader Tax”

The Mechanical Turk

We can see thinking machines taking over more and more human tasks, such as car driving, Go playing, or financial trading. But sometimes it’s the other way around: humans take over jobs supposedly assigned to thinking machines. Such a job is commonly referred to as a Mechanical Turk in reminiscence to Kempelen’s famous chess machine from 1768. In our case, a Mechanical Turk is an automated trading algorithm based on human intelligence. Continue reading “The Mechanical Turk”

Deep Learning Systems for Bitcoin 1

Since December 2017, bitcoins can not only be traded at more or less dubious exchanges, but also as futures at the CME and CBOE. And already several trading systems popped up for bitcoin and other cryptocurrencies. None of them can claim big success, with one exception. There is a very simple strategy that easily surpasses all other bitcoin systems and probably also all known historical trading systems. Its name: Buy and Hold. In the light of the extreme success of that particular bitcoin strategy, do we really need any other trading system for cryptos? Continue reading “Deep Learning Systems for Bitcoin 1”

Algorithmic Options Trading 3

In this article we’ll look into a real options trading strategy, like the strategies that we code for clients. This one however is based on a system from a trading book. As mentioned before, options trading books often contain systems that really work – which can not be said about day trading or forex trading books. The system examined here is indeed able to produce profits. Which is not surprising, since it apparently never loses. But it is also obvious that its author has never backtested it.  Continue reading “Algorithmic Options Trading 3”

Hacking a HFT system

Compared with machine learning or signal processing algorithms of conventional algo trading strategies, High Frequency Trading systems can be surprisingly simple. They need not attempt to predict future prices. They know the future prices already. Or rather, they know the prices that lie in the future for other, slower market participants. Recently we got some contracts for simulating HFT systems in order to determine their potential profit and maximum latency. This article is about testing HFT systems the hacker’s way. Continue reading “Hacking a HFT system”