Algo trading digital assets
johnmathews.eu
johnmathews.eu
When a given coin trades at different prices on two exchanges (which is what these arbitrage algorithms look for), it will try to buy that currency on the cheap one and sell on the expensive one.
The main reason coins have different prices (more than a few cents) on different exchanges is that people are worried about the exchange being insolvent.
For instance, during MtGox's slide into doom, Bitcoin was cheap there. So this algorithm would have been busily buying Bitcoin with USD on MtGox, then transferring the Bitcoin to another exchange to sell, so it could pump the USD back into MtGox. Since withdrawals from MtGox were throttled, you would have built up a large balance there. When they shut down, you would have lost bigly.
People do make money doing arbitrage between exchanges, but you need a sophisticated model that considers counterparty risk, which isn't something you can read from a price sheet.
Risk management in HF is less about predicting what might go down than avoiding trading when liquidity dries up. This is why when markets get weird HF algos pull out: an unexpected one-minute trading stall can wipe out a quarter's profits.
In crypto, where the market is still learning lessons from the 1930s, the nickels are quarters but the bulldozers are tanks.
Counterparty risk definitely still exists, but it is getting better very quickly with the growth of regulated US-based exchanges like gdax, gemini, and ledger x. In the altcoin world, Bittrex is in the process of fulfilling state-by-state requirements for regulatory approval. The crypto world is very different today from when MtGox dominated and getting even better.
If counterparty risk is a top concern (and it probably should be) then don't trade on unlicensed exchanges... That rule is great to follow and I haven't even gotten into any usdt tether issues...
However, the ones I have looked at / tested so far just aren't ready for primetime. Slow transaction times, lackluster user experience, no liquidity.
But those are all problems that are to be expected for what are basically beta-status projects (at best) and I am excited to see where things go from here.
Problem was, if you thought you were selling BTC -> USD you were wrong, you were selling for GOX-USD which were known to be worth much less than USD. In fact, they turned out to be worthless.
There are many reasons why this is a fool's belief, at least with one strategy over a long term. As many people pointed out already, properly calculating risk is the usual failure. But even if you properly calculate risk, there are still possibilities (which you may deem unreasonably small to consider) which can happen. This is was the final straw that caused the 2007/8 failures. Any possibility greater than zero can happen. It doesn't matter what your models prepare you for. If that "virtually impossible" scenario occurs, you lose.
The more commonly successful approach to algo trading is to identify an inefficiency in the market and capitalize on that. But that is a limited time opportunity. You either eat up all the inefficiency yourself (if you're lucky), or other people catch on and help you make the market properly efficient. Then you're on to the next game. And in many cases, the inefficiency you are capitalizing on is due to a lack of capability of your broker(s). And brokers don't like when you cost them money repeatedly. Eventually they catch on, and they shut you down. So you trade your time for money by way of constantly searching for new brokers and gaining access to a market only so you can profit your way right out of that market.
Summary: create value to win. Any other method of profit is an eventual failure.
Nobody produces results like they do over such a long period, and it's exceedingly unlikely that they are so much smarter than everyone else. Whether from insider information or market manipulation, their success smells too strongly.
That being said, the "todos" at the end of this article kind of understate just how much work is left to be done before a strategy like this could be put into production. Ignoring the actual viability of a simple moving average cross signal, you could have the best strategy out there but would never stand a chance without significant time and effort committed to the execution and risk management sides of automated trading.
If building trading systems in the crypto world is something that interests you feel free to reach out to me, company / contact info is in my HN profile.
What's the end goal? Would a perfect trading system fully automate the trading process to maximize returns, or is the goal to develop the best tool to assist a trader?
I'm curious what you, as someone in the field of developing these systems, see as the "ideal product".
As a follow up question, what would happen to a market that is 100% traded automatically (assuming thats possible and the end-goal) - would become stagnant?
Forgive my ignorance if any of this is obvious, my econ/trading knowledge is next to 0.
As someone who's worked on trading systems in a professional setting I'll give some thoughts.
First and foremost the goal is to make money. I guess some people build these systems for fun/hobby or for the challenge/educational value. But huge amounts of money are spent on trading systems, with the goal that they increase profitability. Sometimes that means maximizing returns, sometimes that means assisting traders. This is a very large market, with very diverse types of end-users. I believe crypto is similar, but a microcosm of the broader trading environment (with some of its own cyrpto-specific idiosyncrasies). You have some "HFT" traders, "institutional", HODLERs, etc... Each has different objectives and skill sets. A trading system has a different value proposition for each trader's needs and objectives.
In terms of a 100% automated market, that's an interesting question. The biggest world markets are very highly automated, such as the equities market. Google "hft percentage of volume" and you'll find various sources claiming up to 70% of the equities volume is HFT. Since HFT trades complete in micro-seconds, this is fully automated trading. The Flash crash was partially blamed on a high-level of automation, were a trader was trying to game the response to large orders[1]. I think a 100% automated market would collapse. Even the 70% automated market of equities has shown some scary positive feedback loops that need human intervention.
1 - https://www.bloomberg.com/view/articles/2015-04-21/guy-tradi...
1. Faster speed to market. Basically, front running 2. Extremely low transaction costs. Not available to the retail trader or even electronic mkt makers. 3. Extremely low time in each trade - when you dispense with bell curve predicting - risk becomes only the time you are not flat.
These are NOT prediction of future price. HFT don't make money 'predicting' the market - they are too sophisticated as traders to believe that's reliably possible. It is to some extent, but its very hard and theirs is a better play.
No, this is not basically front running. Front running has a very specific meaning. High frequency trading is not front running.
2 - The electronic market makers ARE mostly hft and generally get the best transaction costs and other privileges excluding taker-maker exchanges. Take NYSE parity or CME mass quotes for example
3 - Somewhat true but not in general. Becomes a murkier quality when hft is combined with longer term signals
> These are NOT prediction of future price. HFT don't make money 'predicting' the market - they are too sophisticated as traders to believe that's reliably possible. It is to some extent, but its very hard and theirs is a better play.
This is completely wrong. Plenty of HFTs do prediction to varying degrees, one of the biggest HFTs almost exclusively trades on price prediction. Other don't very much but hedge in very sophisticated manners. The smallest group is those who just use speed and fee structure to make money. There are certainly benefits to speed however (fill rate at the very least) and the market leaders are both intelligent AND fast.
An HFT might see one price level go away before another even with the ISO mechanism, but it's far too late to act on that information by the time it's visible on the lit markets.
Which is because the automation isn't capable of fully gaming itself yet.
In game theory, you don't have to be the smartest person in the room, you just have to know what everyone else is going to do. In a ~100% automated market, whoever can identify the patterns emergent from the automated rules will be able to beat the automation.
For the follow up question, I would suggest looking at the rise of automated trading in traditional markets. It is an overwhelmingly large % of trades and market activity these days, and I would call the largest financial markets in the world anything but stagnant.
The more players and liquidity in a market, the more efficient the price discovery can be, which I think would be a very good thing for the long term viability of crypto markets.
I guess to summarize, the crypto markets are not much different from traditional markets and getting more similar every day.
This embedded plot has reached the maximum allowable views given the owner's current subscription. Please visit the subscriptions page to learn more about upgrading.
A bit off-topic, but it teaches us a lesson about avoiding getting locked-in by too many services. If I'd use a plot in my blog post I'd like it to keep working even when I get more traffic than usual. Especially if my whole blog post is useless without it.
SMA can work, but it can also bite you. I think using only 1 technical indicator is asking for trouble when determining entry. Use at least 2, but no more than 5 or 6.
As a software developer, its a cool field to tinker in. But theres lots of ignorance, hype, and crap.
For anyone who wants to build a simple bot, checkout gekko https://gekko.wizb.it
120x sounds impressive (and overfitted), but if you compare this to a simple buy-and-hold strategy it is a rather depressing result.
https://www.ethnews.com/analysis/10-30-2017-ethereum-forecas...
As to the linked article, the idea of SMA crossovers is nothing special: https://www.babypips.com/learn/forex/moving-average-crossove...
Take a look at their example. Say you sold at the peak, great. Then the currency drops and you buy at the bottom, great. But then the SMA crosses again and you sell - oops, look where the graph is going. You can't predict this stuff with technical indicators.
Watching purely a leading indicator can get you in trouble with false positives; while a lagging one means missing some of the trend. Yes, you can take it too far, use too many indicators, or look for trends in ranging markets and other mistakes.
Refused to display 'https://plot.ly/~mthwsjc/69.embed' in a frame because it set 'X-Frame-Options' to 'sameorigin'.Just look at the dev console.