Project Tradebot II: trading strategy

Tuesday 29 March 2016

In the second of my tradebot series, I thrash out the strategy I hope to use to profit from movements in the crypto markets.

Having decided to create a tradebot, I now need to decide a few things like what currency pair(s) I’ll be trading, what language I’ll be using to write it and - perhaps most critically - what strategy I’ll be taking. After all, there’s no point building a kick-ass piece of software if all your optimisation does is enable you to lose money more efficiently.

As I’ve said before, I’m no trader and I don’t plan to start trying to predict the markets - I’ve been around crypto for long enough to know that markets don’t like being predicted, especially not by the likes of me. Sudden, sharp and unexpected moves are common, as is outright manipulation. I’m also aware that, with my lack of programming and trading expertise, complexity is the enemy. So my guiding principle is going to be KISS: Keep It Simple, Stupid. Even if I do call a market movement correctly thanks to a profound understanding of stochastic moving bollinger oscillators, or whatever technical indicators I choose, my ability to translate that into something a bot can successfully use to make a profitable trade is minimal. I’m going to make enough mistakes as it is, and I want them to be as low-cost as possible.


Dude. Put some clothes on and get back to your trading desk.

No leverage

One thing I won’t be playing with is leverage. I’ve seen enough traders wiped out by leveraged trades that go against them, for starters. It’s risky unless you know exactly what you’re doing, and maybe not even then. Plus you have to factor in the costs of borrowing. You’ll pay for that even when your bot isn’t making any trades, meaning it has to be more profitable when it is working. And it doesn’t fit with my principle of keeping things simple.

That leaves a few possibilities. I could go down the arbitrage route, monitoring different exchanges for price discrepancies. For example, I could grab a price feed from Bitstamp and Bitfinex, keep BTC and USD on both, and execute buys and sells when the prices diverged by a large enough amount to profit (taking into account trading fees). Or I could try the market-making approach, placing orders just above and below existing bids and asks. These are both relatively low risk, but I'm concerned that if a connection to an exchange drops out (which I understand is quite common), I could get stuck in a trade I don't want. Plus, I’ve got another idea I’ve been wanting to try for years, but have never had the opportunity.


What I have decided to implement is a form of grid trading. It’s nice and simple: you set a series of buys in tranches down from the current price, and a series of sells upwards, within a given range. When one order is met, you set the corresponding/opposite order.

For example, perhaps bitcoin is at $400. So you set buys for 0.1 BTC at $390, $380… $300, and sells at $410, $420… up to $500. If your buy at $390 is met, you put in a sell for that tranche at $400. The market moves, you make trades. Rinse, repeat.

It works so long as the price remains within your given range ($300-500 here), and it works regardless of which direction the market is moving in. It even works if your connection goes dark and then picks up later. I like it because you don’t have to identify or predict the trend (KISS). If the price rises or falls out of your range, you have to think again; I’m going to shelve that problem for now, though, since there are various possible solutions.

I originally thought it would be interesting to try this on the regular stock markets, several years ago before bitcoin had even been created. It quickly became clear, though, that 1) I’d have to do it manually, because I had nothing like the expertise to access the necessary trading platforms with software I was capable of writing, 2) trading fees were high (flat fees are particularly problematic, or else you'd need to use leverage on a forex platform) and many markets were not volatile enough, meaning that 3) you had to rely on large moves or large positions to make a profit.

Net outcome: give up, until now. But crypto’s markets are famously volatile, trading fees are low (think < 0.5%, and often more like 0.15%) and it seems relatively easy to access the exchanges via API. Plus I'm a little older and have more patience with stuff I find frustrating. (Which is a lot of things, because I'm getting older and that's what seems to happen.) So, the stars align, and a grid bot it is.

Next up, choosing the right coin pair to trade - specifically, should it be BTC/fiat, or alts?

comments powered by Disqus