Ask HN: Anyone making money through algorithmic trading?

389 points by charlesdm ↗ HN
Is there anyone here making money on smaller trading strategies (i.e. in the stock market or cryptocurrencies) that would not be interesting enough for larger algorithmic trading firms?

I'm aware the standard advice is that you will lose your shirt attempting to compete with algorithmic and HFT firms. But are there opportunities out there for smaller strategies to generate alpha? (I'm assuming yes, but would be great to find people who actually do this -- no need to disclose _how_ you actually do it, obviously)

253 comments

[ 6.0 ms ] story [ 3954 ms ] thread
You probably can't do HFT trading because you need to have capital to reduce latency. Maybe you can rent servers very close to the trading centers, but this still will cost money.

You can use http://www.quantopian.com to try out different algorithms. It will tell you how well your strategy works.

quantopian.com sounds interesting. I am going to check it out.
Concur. You won't be able to beat players whose HFT systems are colocated in the same datacenters as the exchange. And you will not be able to beat those systems built using lower level languages like C++ or, worse yet, dedicated hardware.

Source: 5+ years in HFT development

I’d be interested in picking up what you are putting down. Do you have a blog or other content channel?
Unfortunately I got tired of that world around 2013 and moved to the food services industry. I usually write here: https://medium.com/@hnlean but it has little to do with HFT anymore...

Edit: actually, see my response to the neighboring comment too.

Why does a programming language matter in terms of algorithms? Can you elaborate on that?
A lot of algorithms are dependent on the ability to execute quickly. If yours is not, then PL doesn't matter (at least, in the respect the parent was discussing).
Because big money will trade enough dollar value as to change the price by their action so whoever is second missed the opportunity.

Languages like python are immediately out, they make no attempt to be fast (which is fine for their niche). Even languages like Java are out, the JVM is too smart: it turns out that the algorithm needs to analyse a few thousand possible trades where the answer no trade before it gets one where the answer is yes, as a result Java will optimize for the common no path. In C++ the programmer will lie to the optimizer claiming that the yes path is the most likely even though it isn't! As a result code written in C++ will always have the yes path as most optimal: when a trade should be made the java program pays a CPU branch misprediction penalty and the C++ program will not thus C++ wins the trade. Of course for the above to work you need cleaver programmers who spend time at the profiler and know how to make the CPU work for them.

C++ has one other useful advantages over some of the competition: it won't waste CPU checking for things like dereferencing a null pointer. Speed is important, you should verify via other means (unit tests, formal methods static analysis, or have the checks that you run on dummy data and compile without them for production)

Thus C and C++ are the only useful choices: the compilers have good optimizers (this rules out a lot of other compiled languages), they don't use CPU to check for "can't happen" errors, and you can lie to the optimizer in useful ways. There are other advantages, but the rest are things that a good programmer could easily work around (ie write a new stat structure from your CS textbook)

For HFT, it's not that every second counts, is that every millisecond (or even lower) counts. You're competing with other, similar algorithms for picking up opportunities. The assumption is that you're not capital constrained, you (or the competitors) can immediately exploit all the volume of such an opportunity, the deals you submit shift the prices so that it disappears.

This means that whoever is not the first to take that opportunity doesn't get it, and if you're reliably a millisecond slower than a competitor then you might as well not even try.

Every microsecond counts. We've done some pretty crazy sounding things to get the last bit of juice out of the system:

1. Write a converter to convert a proprietary interpreted business rule language to C++

2. Make all messages fit the maximum ethernet frame size to avoid fragmentation overhead

3. Make the transported message format the same as the memory object format to avoid the packing/unpacking overhead

4. Predict and pre-allocate object pools in heap memory to avoid heap lock overhead

5. Statically link all libraries

6. Optimize key functions at assembly level

7. Turn all record ID's into zero based indexes and covert most lists and maps into arrays for rapid lookup

8. No indexes or foreign constraints in the rapid-write areas of DB

9. Hand rolled on-disk cache file formats that only operate in append mode to prevent seek overhead

10. And finally (this was after my time) trying to implement the TCP stack in FPGA

There was a great post on HN fairly recently written by someone who used to work in HFT. He talked about how they tapped the incoming network cable to read the incoming prices on an FPGA faster than they could make it through the OS's network stack. I think they were sending out trades in response to the new prices before they would have even made it to userspace on an OS.
As a bit of context, that technology will not be any where near your most expensive investment for HFT. Years ago I was on a trade where we could rent that technology for 1500 per month. It can only have come down from there.

Your time is an order of magnitude more expensive than that. Other expenses besides your time include making sure you have the fee structure to be competitive & getting a clearing partner that is ok with letting you fire off enough orders to make it worth while.

Yes. I've developed a simple strategy that algorithmically trades cryptocurrencies (mainly ETH and BTC because volume, but it would apply successfully to any of the others as well). The strategies are simple, they are based on simple technical indicators, and result in about 2 trades executed per day. The strategy can be applied to "normal" equities as well but it performs particularly well on cryptocurrencies due to the amount of volatility in the market. Also the amount of freely available data for cryptocurrencies makes implementation much easier (and cheaper).

Over the last 3 months, January to March, I've had a return of just under 50% (in spite of the massive down turn in the crypto market). Which sounds great, but I only turned it loose on about $250 so we're not talking about buckets of money here. With higher amounts of capital you run into other issues that would need to be addressed in the algorithm/strategy.

I've often been told the same thing (you can't beat HFT, large firms, etc) but in the end it's not about beating them. It's about finding a strategy that works, that can be automated, and having the patience to let it run and do it's thing. I only trade about 1 to 2 times per day (not HFT) and only rely on fundamental data (no inside info, no "get the data before everybody else and act on it", etc). Keep it simple.

Happy to answer any questions.

Care to share a bit more on the strategy? I've been looking at exchange APIs and looking up strategies online, but I haven't started implementing anything. Wondering how you approached it once you had the idea to trade algorithmically.
I have two strategies that I use, one for up/bull markets (e.g. April 1st to present was a great example) and one for down/bear markets (e.g. January to April). They evaluate a number of technical indicators (e.g. moving averages, RSI, CCI, etc) to determine when to buy and sell.

To get started, I worked backward. The strategy is simple enough that you can execute it manually (e.g. read/interpret the indicators on a chart/graph and trade when the time is right). Once I determined a given strategy might be viable I formalized the strategy by writing a script to backtest it on historical data. Once it checked out I wrote a script that accepted real-time data from exchanges (I use GDAX, but most others with a solid API will work equally as well) and traded based on the incoming data.

I wasn't comfortable/familiar with any of the "hosted" trading platforms out there for cryptocurrencies so I built my own. It's very simple but it gets the job done and has proven very stable.

The most important part, for me, was to get the data streaming right. I ended up writing a Node.js server that listens to the GDAX web socket and feeds the data to a Redis instance. From there I have a separate process for each strategy I'm running that listens via a redis pubsub channel for new data. This was important for scalability and reliability. It also served to make the platform modular. For example, it can handle any number of data sources (exchanges) simply by adding a "connector" to the data source that feeds the data to redis. It can also handle as many strategies as you can think to throw at it simply by adding another script/process that subscribes to the relevant pubsub channel for the data it needs to execute the strategy.

It's probably overkill but it's made testing new strategies very easy and fast. I can take an idea for a new strategy, code it up, and have data streaming to it in real time in less than 10 minutes. Then it's just a matter of fine tuning the strategy.

A little long winded but I hope that answered your question...

> I wasn't comfortable/familiar with any of the "hosted" trading platforms out there for cryptocurrencies so I built my own

That's sounds like a lot of work. What made you uncomfortable? Have you looked into using self-hosted trading platforms such as ccxt? It's an open-source JavaScript / Python / PHP cryptocurrency trading library with support for more than 100 bitcoin/altcoin exchanges

https://github.com/ccxt/ccxt

Wow, CCXT looks really nice, I'll have to dig more into that. Thanks for sharing.

To be fair, I didn't look very hard for a good platform. I was aware of a couple that I had heard about either through friends or tangentially through HN comments on other stories but when I looked into them they either looked super shady and untrustworthy (yeah, I know, judging the book by it's cover) or forced you to implement your strategy in their language of choice (one was Python, one was a proprietary script-y language) and I wasn't interested in that.

Surprisingly it wasn't as much work as you'd think. It started as a hobby on the side so I wasn't worried about building a full-fledged trading platform that supported every exchange and every imaginable strategy type so I was free to keep it simple and focus on the one exchange I had an account at (GDAX) and the two or three strategies I had in mind at the time.

Any interest in open sourcing the Node.js /Redis component? I was thinking of a similar implementation but using Kafka. Your piece would give me and potentially others a way to get up and running pretty quickly.
I have a strategy I wanted to try. Look at historical percentage difference between currencies. See if there is any patterns like, every time BTC drop 10%, LTC drop 20%, or something like that...

Find those patterns and trade on them.

Do you know if people are doing this?

I've seen people try that and I've noticed the correlation myself. Around the end of last year (November/December 2017) it was possible to watch BTC jump 5-10% and jump over to ETH and catch the same wave 5-10 minutes later.

The problem is those patterns quickly disappear as automated trading picks them up. The window goes from 5-10 minutes to seconds or less. Much harder to act in such a small window.

All of these alt coins are tied to just few pairs (mostly BTC or ETH). When I was looking at the relationships in different instances (just eye balling, no statistical analysis), it seems that some the coins are just more or less volatile.
The degree of coupling between assets is called "beta" - typically you're trying to reduce the coupling of one asset to another in your portfolio (explanation [1]) but you can definitely work the other way to make predictions.

I'm not sure what the technical term is for a time-lag correlation though, since that's what you're really after; it's not an interesting correlation for your model if you don't have time to trade ETH on the BTC signal.

[1]: https://www.quantopian.com/lectures/beta-hedging

>based on simple technical indicators

Pure voodoo

Perhaps. But if "voodoo" results in consistent returns then who cares?
I've been experimenting with this a lot. My code is all public still because I haven't made any giant gains or anything. But I have seen some success here and there. I've even got this one bot that learns from its past trades via ML and uses what it has learned to decide wether to make future trades or not. https://github.com/madchops1/Dutchess.ai
Well.. I'm trying :) Still backtesting, building my system, etc.. But I have high hopes. Like others have mentioned, it's probably not worth pursuing HFT, but it's still alot of work just dealing with micro second data (consuming all the data, executing multiple strategies, multiple order books, etc..)
HFT can really bite you if you are not experienced in that area. I'd suggest sticking to trading based on 30 day moving averages.
There are thousands of technical indicators. How and why do you use a 30 day SMA?
I assume they mean price > sma30 is bullish and price < sma30 is bearish.

PSA: Don't do this

I lost about $100k doing algorithmic trading. I spent the better part of 2 years after work immersing myself in algorithmic trading, understanding the architecture of the stock market, and getting very very deep into the topic.

I found an algorithm that was wildly positive, and traded it on 3 separate markets every night. I learned a lot and I love everything I learned, but it was a very expensive lesson. The #1 thing I learned was that algo trading is mostly psychological, at least for me. I was making big bets (a few thousand dollars per trade) every night and it was emotionally exhausting, and I couldn't handle the pressure. The worst part is that I didn't trust the algorithm, and would cut the trades short instead of waiting for the full profit (or loss). That messed with my results, and in the end it turned into a disaster.

But programming for myself and using real money was such an educational experience. Any little bug meant that I could lose a lot of money so I bug-tested the most I've ever done in my life. And I did things like write my own multi-threaded backtester, working on hundreds of gigabytes of data, so I learned a lot there too.

It was a lot of fun, very very expensive fun.

if you've lost 100k, you had 100k to spare. agree it was an expensive lesson.
Yes, it sucked losing that much money but I'm lucky and grateful that it didn't alter anything about my life.
if you've lost 100k, you had 100k to spare

Not if you're leveraging! For an extreme example, this guy lost $210k of borrowed money: https://www.bogleheads.org/forum/viewtopic.php?f=10&t=5934&s...

Another example is Chris Sacca, who burned through $16 million - $12 million in paper gains, and $4 million in borrowed money. From [1]:

Starting with around $10-$20,000 in what were college loans, Sacca realized that brokers weren’t accounting for margin usage on a real-time basis. The result was that even though firms were only allowing 50% margin, as long as a customer closed a trade before the trade settled, T+3, and showed proper equity in the account, positions larger than 50% margin usage could be opened.

Picking winners of stocks that by Sacca’s account had risen 40x, and betting with positions well above his margin requirements, his account grew to $12 million in 18 months. But, as we all know, the record levels of the Nasdaq and the dot com bubble of that time eventually burst....When it did burst, and even though the damage was from holding just two stocks, Sacca found himself in the hole with a $4 million negative balance.

[1] https://www.financemagnates.com/forex/brokers/chris-saccathe...

Interactive Brokers has a paper trading account. so you can test your trades in real time but not make any money. I couldn't image going into production right away. My algo are good, but they also have some loops that kept buying stock, when it should have stopped. Thankfully it was just paper trading.
I backtested thoroughly and paper traded before going live.

Paper trading is nothing like real money trading. That's also one of the first things you learn, it's like a different dimension.

You probably should have taken smaller bets and left the algorithm to it?
I wrote a few indicators on Tradestation back in the mid 2000's and had a similar result after using them with an automated trading strategy, albeit less loss (somewhere around $10k). I was trading on 3-1 margin and closed all positions before the end of the day. Very stressful, I too let emotion interrupt trades, etc. Fun to develop, painful to execute. I'm much happier creating startups! =)
I wonder whether the premise of your question is faulty. If you ask enough people: "In your last 100 flips of a coin, did you get more than 60 heads?" some will truthfully say "Yes." Unfortunately, that does not mean there's anything special about their coin-flipping strategy, or that you will be able to generate a successful coin-flipping strategy.

My guess is what you really want to know is "What is my expected gain if I try to employ an algorithmic trading strategy?" I have my suspicion of the answer to that question, but I don't believe your current question will shed any light on the answer.

Mostly I believe this too, but I am familiar with some people who can consistently make money year after year. From talking to them it becomes clear that they understand things very, very deeply.

See /u/Fletch71011 on reddit-- he's always happy to discuss things. He's made millions trading options, mostly algorithmically as I've understood it. The methods he uses are sufficiently complex that you need to be very well acquainted with the intricacies of derivatives to follow along, but basically he trades volatility instead of price movement. Regardless of whether the price of the asset goes up or down, he makes money. In his opinion, it's foolish to try to trade price direction, and you're basically flipping coins and likely to lose money.

I tried understanding what he was doing and abandoned the attempt. I had to conclude I was not quite so clever as he.

I am not sure I understand this.

It takes just as much skill to guess if volatility will go up or go down as it does to guess if prices will.

The best models we know of (say GARCH) will still pace the information in the option prices.

A key part of how options premiums are priced is the expected, or implied volatility (IV) of the underlying (the stock/future/whatever). Therefore you can be an options seller (selling calls and puts) to get high premium, expecting that before the options expire, the IV of the underlying will decrease, making it more likely you can keep the credit received from selling those high-IV priced options. It can also be historically shown that the IV for any underlying is about 75%-80% of the time overestimated, in which the price of the underlying turns out to not be as volatile as what was suggested by the IV.
But 20-25% of the time it is more than 3x as volatile. Taleb built his career on this.
Markets have been going up for a while now. So anyone with half a brain is making money. But long term, there are essentially 0 investors making money on day or algorithmic trading.
That's extremely untrue. Especially if we are counting non-retail investors i.e. prop market maker trading
Be careful with volatility. I don't know what he's trading on exactly. But a big part of volatility trading is selling insurance, i.e. selling insurance against the direction of S&P. You can make a lot of money collecting insurance premium, but on the event of a payout, like a sudden big drop in S&P, the loss can be very substantial. See XIV and SVXY in February of this year.
Trading volatility might imply that he's buying options in both directions.

Big moves either up or down would be profitable. The only unprofitable move here would be no substantial moves in either direction. (In which case you lose your entire bet, but no more.)

> Big moves either up or down would be profitable.

The problem is that much more often than not the “only unprofitable move” is the one that happens. Options in general are too expensive and that’s why selling “insurance” is profitable most of the time. Maybe he can identify consistently mispriced vol, though.

> Maybe he can identify consistently mispriced vol, though.

This was the method I used, as described in another comment.

Very interesting, thanks for the pointer.
Could you expand on how that would work? If X is priced at 10 units of currency, and I promise to buy 1 X for 11, and to sell 1 X for 9. And X stays available for 10, I end up paying 11, receiving 9 - netting a loss of 2. If I manage to promise a sell/buy at 10, I even out. What do I lose with low volatility? And how do I make money "both ways"?

Clearly I lack a basic understanding of the concepts involved.

In volatility trading you don't cary naked options (you hedge them usually dynamicaly - readjusting hedge every now and then) and usually close positions before options expire. So your analysis does not apply. If you want to get understanding on how to trade volatility the "Volatility Trading" by Euan Sinclair is excelent.
"Volatility" in the term "Volatility Trading" does not mean the stock's movements, it is a way of measuring the excess value in an option beyond what the parameters of the option would imply. That excess value is usually referred to as the market's assumption about the future volatility of the stock, but really its just an error term influenced by market participants based on supply and demand. Low volatility means "pretty close to its theoretical value assuming no volatility" or to put it another way: "cheap" i.e. good for buyers and bad for sellers.

Sort of like how different companies with the same cash flows can trade at different multiples, otherwise identical options in two companies (or different expirations/strikes in the same company) can trade at different prices because of the opinions of market participants. Volatility traders act when the different prices/error terms are too far apart, counting on the prices/error terms to converge a.l.a. pairs trading.

Since they are trading the error term directly, they attempt to construct positions that remain relatively flat in value as the stock moves around, but are designed to only change in value when the error term changes. That is how they can make money "both ways", because they can profit if the stock goes up, down, or stays the same, as long as the error term moves in the correct direction.

The reason you only see sophisticated people doing this kind of trading is because you need a large and complex position with many hundreds of options to be in a truly market-neutral environment. You can't take advantage of mispricing without such a large position because buying/selling single options involves a tremendous amount of risk, so you need to do that as a part of a larger portfolio to spread that risk. Retail traders tend to spread the risk by doing 2 transactions (the mispriced option and a well-priced but mirrored hedge option), but that is a) much more expensive from a commissions standpoint and b) really limits the range of market-neutrality forcing you to adjust more frequently to stay market-neutral, again, with commission costs.

So it's "buy low, sell high" - but for options, not stocks?

[ed: that's to say, you need a way to get more/accurate pricing information than reflected in the market - but for options, not assets]

Yes, this is how the guy I was referring to explained it to me~ he created a pricing model to predict errors/inaccuracies in the market's model, and was thus able to know when an option was likely to move towards a different price to correct itself.
Yes, but its sort of changing the definition of high and low from price (with stocks) to volatility (with options) and having the expertise to trade volatility like that without _accidentally_ trading on price.
I think the terms you're looking for are "straddle" and "strangle" options strategies.
If I recall correctly, your structure describes a future not an option.

If you buy put options for X at 10, and call options for X at 10, then if the price moves down you exercise the call option, and if the price goes up you exercise the put. Unless the price is totally fixed, you make some profit. The real question is whether this profit outweighs the price of both your options.

You need the price to move sufficiently for this plan to be worth it. Especially because in any case, either your put option or your call option is worthless. Thus, you need twice as large a price move as when buying only puts or calls. The upside is that you don't need to care about the direction of the movement.

The common strategies are delta heding, gamma hedging and gamma scalping for market neutral trades.
if you delta hedge (ie taking opposing positions in the underlying and the derivative, ie selling a call and buying the stock and then constantly readjusting your position), you can protect yourself against small / normal changes in price of the underlying, but if there are big jumps in the underlying, and acceleration of delta (ie gamma) you can lose a lot.
On a per equity basis there are reasonably consistent ways to predict near term volatility using sentiment analysis and revenue forecasting ("alternative" data). I would not attempt this with something like the VIX, but for selling options on individual equities it can work.
A 50% chance to lose money per year still allows for very long strings of success. Some strategy's trade ~80% chance of a small win for a ~20% chance of a large loss which means lucky streaks could last for decades.
So, basically you are saying that it's all gambling and nobody has a better strategy / better information than everybody else. Some are just lucky and it is all because of the survival bias.

I agree with you in that it is a possible explanation, but I disagree in that it is the only one possible.

I feel that what he's saying is that it's hard to tell if somebody actually has a working strategy or it's just gambling, they can be nearly indistinguishable, and (given the number of people) someone showing a streak of successes is really not much evidence that it's something beyond luck.

They may have something, but since you can't determine if it's so and there is a lot of just gambling, then most likely it's that.

That's part, but the reverse is also true. Someone could lose money and still have better odds than normal. Something like skill adds 5% then luck adds or removes 30%.
I didn’t gather that from what he said at all, personally. I interpreted his comment at face value; it is possible to pull a profit over an arbitrary period of time even with 50/50 odds.
As a former vol trader, I think this is possible. I have friends who were former pit locals and are now sitting at home trading options.

It is all moving to algos, though.

With vol it's one of those specialized areas where it's probably quite hard to learn without having sat on an options desk. Even the way it's presented in the books does not give a good picture of what you're supposed to do.

Its not that complicated, he mentioned using off-the-shelf software, there just aren't a lot of retail traders who can open an office in the CBOE and hook directly to the exchange computers while running enough contract volume to essentially make markets.
I think your argument is logically correct, but you are using numerical assumptions that are off by one or two orders of magnitude. Your typical successful algorithmic trader is probably flipping their metaphorical coin 1,000,000 times, and getting 520,000 heads. Each individual trade may only be slightly profitable, but there is often no statistical ambiguity about the effectiveness of the strategy.

Individual trading strategies often become less effective over time, though. Whether this kind of success can be sustained at the level of a trading firm over many years is an entirely different question. Whether they can beat the market after fees is a third, also entirely different question.

> "What is my expected gain if I try to employ an algorithmic trading strategy?"

The market is negative sum, so any abstract strategy has an expected excess return which is negative. It should be everyones assumption without competing evidence

Algorithmic strategies include such gems as "buy on mondays and sell on thursdays", and there is no inherent magic to them making them better than my "buying stocks with names I like".

Short answer: yes.

Long answer: not in the beginning, then a long period of breaking even, and eventual profitability.

My algos trade commodity futures(nasdaq, 30-year bonds, etc). My platform is Multicharts.NET, which supports writing your strategy components in C#.NET. I'm not a .NET fan, but the platform is solid and this is about dollars, not language preference.

Also...regarding HFT - those aren't likely what you think they are. In commodity markets, HFT trading typically follows a simplistic algorithm of "above or below XYZ bar EMA", which anyone can do. The HFT portion of it comes in through the process bidding the inside bid(on the way up) or offering the inside offer(on the way down) faster than the other HFT algo. So where a price may eventually see 100 bids on the way up, and 20 of those will be filled, the HFT's goal is to place bid #2 or #3 out of that 100 - competing with hundreds of humans and other HFT's for that spot in the queue. Trying to compete with HFT is very difficult unless you have enough capital to colo next to the exchange(CME in my case), as well as handle commissions(through paying them, or paying for a seat to negate them).

I've attached a screenshot of the chart output from my algorithm today. Assume every time you see "SE" or "LE", that a long(LE) or short(SE) position was established. Positions close when the first of 4 events happens: stop loss, profit target(25pts for today), trailing stop(10pt), or an opposing signal is generated. It's simple, it's not that sophisticated, but it is consistently profitable. You can develop your own similar algorithms, or use many out-of-the-box algorithms from places like iSystems, or strategies that come built-in with your platform(Multicharts.NET has many). The key is backtesting, properly scheduling around economic events, and having enough capital to survive the inevitable drawdowns.

Link to screenshot of today's chart output from algo: https://www.dropbox.com/s/bms9kuqn529iyqg/Screen%20Shot%2020...

If you go down this road, I wish you the best of luck. It's fun, it's difficult, and incredibly rewarding if you get it right.

I always thought HFT profits were a parallel construction for people who were either insider trading or front-running orders and it was an easy dodge to explain their consistent gains as "we have an algorithm."
That chart is very interesting. It looks as if you can predict where the trend started and reversed. Any pointers on how to decide the LE and SE points?
Not algo trading but working and learning to automate things as automation, speed and more sophisticated interfaces can help me a big deal. I made a six figures trading last year manually last year. I won't really put a light into the markets I trade and the strategies I use. But there is lots of money for small fish in this market.
wouldnt you rather do something to earn money?
Yes, but I certainly wouldn't mind supplementing it with some passive income from a little automated trading.
Doing things doesn't really earn money these days. Perhaps someone is better off playing the game to earn money and then doing something positive for no money.
I strongly agree. Workaday job? YOU WILL NEVER GET AHEAD.

Have to create income that doesn't multiply by hours spent, period.

there are plenty of ways to make money doing things. playing the game and then doing something positive is also a legitimate option, so long as the game has no negative externalities (and it often does).
Tightening the spread reduces everyone's transaction costs. Successful algo trading takes money away from existing market making traders and splits that money with those who need to trade for reasons of capital allocation, financing and hedging. It's straight up price comeptitive under cutting in the most darwinian way possible. Less money sticks to the financial system, more money in the hands of business to expand and build stuff. More money in your retirement savings.

I think that's doing something.

ive had this convo before- i dont think your wrong for bringing this up, but i think in almost all cases, the diminishing returns of “more liquidity” were hit well before this point. i dont think it matters to tighten the market ever so slightly
I know cases of algo traders coming from capital markets that have been so successful that they were banned in some crypto exchanges for using highly efficient strategies. One of the guys (he works in a top market maker during the day) told me he was making around 100btc/month back in Q1-Q2'17.

Edit: Not saying it's easy to reach that level of profits, just that it's possible for professional/sophisticated traders.

Why would the exchange care if you are running a highly successful trading strategy?
I built my own intelligent algo trading platform for node.js. It uses market data from Binance and Bitfinex. My best strategy uses unusual volume amounts on Bitfinex to trade on Binance (mostly BTCUSDT and other USDT pairs), an advanced dynamic arbitrage. It can make up to 500-1000 usd per day but not really much more. I started testing a LSTM neural network to optimize the gains and reduce the risks, still early but seems very promising.

I wrote this repo a few months ago for people to get started with cryptocurrency algo trading: https://github.com/jsappme/node-binance-trader

Feel free to contact me at herve76@gmail.com if you need me to write your own custom trading algorithm.

What's the maximum downside risk in a day? How do you guard against that happening?
500-1000 usd generated from how much existing capital? What kinds of return?
This is one of my pet peeves about self-reported returns on the internet. It's always the case that, if they report absolute returns, they're starting from huge capital and getting 0.00001% gains. If they give relative returns, then its miniscule trades with no market impact and no slippage.
And also the fact that the people who used a similar strategy to trade and only ever lost money are posting about it.
> Feel free to contact me at herve76@gmail.com if you need me to write your own custom trading algorithm.

Why would you do this when you are already making $500/day ($182,500 per year)?

I'd have the same question, but note the word "can" in the $500-1000 range. And the lack of how much it can lose in a day.
(comment deleted)
> It can make up to 500-1000 usd per day but not really much more.

This is entirely meaningless without knowing how much you started with. There's a reason why ROI is often stated as a percentage.

If you have a billion dollars invested, gaining $500-1000 isn't much. If it's $10,000, then that amount is pretty significant.

It's like claiming you drive a fuel efficient car because you can drive 500 miles on one tank without disclosing the size of your tank.

Thanks for posting, looks quite interesting.
I've made roughly 100% yoy returns for the past 5 years. It utilizes a method I developed now partially implenebted on:

https://projectpiglet.com/

Basically, it tracks experts and makes decisions on investments given what the experts say. Think about how many times you've seen someone say: "I work at Google, our cloud is doing X" or something like that.

The fact insiders talk, let me track them and make money.

Unfortunately, that doesn't mean I'll make money tomorrow. The market is always correcting.

did u just admit to insider trading?
That is absolutely not within the definition of insider trading.
It seems pretty close? Insider trading is any trade that exploits non-public information, regardless of whether it's made by an employee.
It is not close, since no agent-principal relationship exists.
No it isn't.

A single piece of non-public information that would move the market. Trading on that information is insider trading. Think "we have undisclosed losses equal to 5 times annual earnings" that your brother told you at a bbq. That is insider trading.

Inferring the existence of some information based on many other pieces of information isn't just legal, it is encouraged. "These guys must have some big undisclosed losses, remember how Mary used to talk about engineering projects and how she talks at BBQs now? Bob was saying his HR dept. is insanely busy. Ahmed resigned and took a job that looks like a step down for him. Ok I'm a sell on this." That is equity research and to be encouraged.

Here’s an interesting article about using Google Trends to beat the market that may still work:

https://www.nature.com/articles/srep01684

The article is from 2013, but if anything it may be more predictive today given the ubiquity of Google search. At the very least, since it explains the method they used to find this signal, even if the specific keywords they used the trends for are no longer predictive, you may be able to find others that are. The strategy yielded a theoretical (backtested) return of 326% over a 7 year period.

When trades are placed using a fixed setup of rules or algorithms it is called algorithmic trading. HFT is a type of algo trading where latency is one of the important rules.

So, while all HFT trades are algo trades, reverse isn't true.

AFAIK some(maybe a lot) of algorithm or quant firms hire people who can read the latest investment research, form a hypothesis and test out the hypothesis to see whether there is a winning system.

A side tip - If someone says their algorithm relies on some sort of TA, run for the hills.

> If someone says their algorithm relies on some sort of TA, run for the hills.

Care to explain? I'm genuinely curious as I've had some success in this area. Curious if I should be aware of something that I'm not...

Fundamentally, the history of a price has nothing to do with its future price. The laws of nature do not care if you are on a bull run. So TA is completely bunk in that regard.

However, obviously many people do rely on TA, which means TA is influencing the price (you can beat their TA algo with your own TA algo). The problem is, you never really know what everyone else is doing. Relying on TA amounts to playing rock-paper-scissors, blindly, with 1000 opponents, and hoping you choose the winning move against most of them.

Keep in mind there are only 2 outcomes, win or lose, and they occur randomly, so it’s really easy to fall victim to selection bias and think you have a winning TA-based algorithm.

Makes sense, thanks for the explanation.
> Fundamentally, the history of a price has nothing to do with its future price.

This is not true at all. Price movements show auto-correlation, for example.

TA indicators have number of flaws.

One of the biggest flaws is that TA indicators tend to repaint. So an awesome winning MA crossover in hindsight might never really execute during real trading.

Additionally using TA for trading also involves self-fulfilling prophecies. And if there are any markets which follow this prophetic tendencies - it is cryptocurrency.

These days, HFT mostly relies on buying uninformed flow and avoiding toxic flow. You need low latency but that race to zero is well underway. There's been some decent consolidation purely around gaining access to retail order flow.
On the positive side, there is a number of algorithmic strategies which are unscalable - they are only profitable with a small amount of money (up to a few millions), and become unprofitable with more assets, because they move the market too much. This makes them uninteresting for funds and banks, and great for the home trader.

On the negative side, the spreads, fees, and latency funds and banks get are smaller than what you can get on online trading platforms. So focus on longer-term strategies (with a holding period of a few hours or more), because you'll lose out to the big guys with any medium to high frequency trading strategies.

There are a few things to watch out for:

1. Systematic trading doesn't necessarily require an algorithm. For instance this rule might work (over a 5 year horizon, don't try it monthly): "buy very large cap stocks if their P/E goes below 4 and sell if it goes over 10." But you don't need an algo.

2. The market has long bull runs. So you might have an algo that has some long bias. It will seem to perform above chance. You should compare it to just holding the market.

2b. If the market is going through a bull run and your algo has some leverage built in, it will outperform just holding the market.

3. If the market had a massive crash in the data set and your algo has a short bias, then you should check it against just shorting the market.

4. The issue of models, markets and biases mirror the same debate in science theories, data and statistics.

* Use benchmarks against performance
Another one I often see people miss is failing to account for trading fees and taxes.
maybe I'm being naive but "buy very large cap stocks if their P/E goes below 4 and sell if it goes over 10." sounds kind of like an algorithm to me. Maybe it's just a ruleset?
I think they meant that it needn't be a software implementation. You could run that rule by hand.
I suppose you could, but there are a lot of stocks to look at... but that's not the point, thanks for the insight.
Unfortunately it is a poor rule set in general.

If the entire stock market P/E goes below 4, you could use it. However when a single stock goes that low it implies that somebody knows something. Don't invest in a company with a P/E below 4 if they are going out of business. (the obvious example that probably never existed: a y2k company in 1999 - they are probably making a ton of money this year, but next year they will go out of business).

There are also "cyclical companies". They have a long history of having boom and bust years, it is well known that you buy when the P/E is high - the bust years when prices are low - and sell when the P/E gets low - those are the boom years when prices are high - but the boom will not last.

There are many other company specific things that can get in the way of any formula.

I wrote a triangular arbitrage bot for cryptocurrencies on Binance, and made like 0.01 ETH with ~0.3 ETH. I think that was just luck though, because all three trades would never go through right away because the price anomaly that caused the arbitrage opportunity would be gone before I could make all three trades. So I ended up holding some sketchy coins that happened to go up relative to ETH before I sold them back.

I used Python and ccxt.

A problem that people have pointed out in the past about cryptocurrency exchange arbitrage is counterparty risk: different prices on different exchanges may be taking into account the possibility that the exchange won't allow withdrawals, will delay the withdrawals, or doesn't have enough assets to satisfy all of its obligations. A large number of cryptocurrency exchanges have defaulted and/or restricted withdrawals in the past. So, an arbitrage strategy might appear very effective yet result in holding cryptocurrency or fiat currency on an exchange that won't allow it to be withdrawn or redeemed as expected.

This could happen because of fraud by the exchange, fraud against the exchange, hacking of the exchange, or regulatory risks where other financial intermediaries stop working with an exchange or regulators threaten to punish an exchange if it processes certain transactions.

Some people have suggested that because arbitrage opportunities are pursued aggressively, most price differences between cryptocurrencies and cryptocurrency exchanges that persist are probably mainly due to people taking account of counterparty risk. In that case you could still profit some of the time by betting that a risky exchange will remain solvent, but you might be taking a larger risk than you realize.

Another interpretation is that some apparent cryptocurrency arbitrage opportunities are really opportunities to earn a premium for helping people evade capital controls and other regulatory restrictions on moving money around. For example, there are lots of people in China who would be happy to pay you a premium if you'd accept a payment in China and make a corresponding payment in Canada. In that case you might feel like you're being a clever arbitrageur but you're largely receiving a payment for helping someone circumvent regulations¹.

(The implicit moral opprobrium that might be read there isn't intended, but I think it's interesting to consider how cryptocurrencies can sometimes make people feel very clever when they aren't, in fact, the cleverest ones in the situation!)

(¹ which isn't necessarily unreasonable to describe as arbitrage)

Right now I have one of (or the?) fastest HFT bot on gdax -- I define "fastest" as being on average the first bot to re place maker orders at best when the price moves. With 1 being the first order in line it's currently averaging 1.39 on price changes -- so it gets a ton of matches.

The bot uses a NN for predicting the price. I've been working on it for 3 months and so far the bot is profitable.

If anyone out there is interested in this space I'm looking for a partner. Also open to business offers.

The whole pipeline (data collection, data processing, trading bot, backtesting, model training, etc.) is built on golang, aws, and training with keras.

Shoot me an email [redacted]

How do you make any money when spreads are at 1 cent?
The problem with these questions is that those who talk don’t know and those who know don’t talk. No one who has a working strategy wants to say anything interesting about it in public.
This guy talks:

  Gary Antonacci
  book: Dual Momentum Investing
  http://www.optimalmomentum.com/gem_trackrecord.html
Great algorithm. Great book. I have a big chunk of my own money in this.
Yeah I made 21.4% in 2017. I wrote my own algorithms and did back-testing with custom ruby code and data from ycharts.com ($) and brokerage.tradier.com (free if you have an account). Ruby is a weird choice in this area as most probably use r or python, but I love ruby.

The key for me is to focus on long-term trading strategies that are at least a year long. The HFT guys and people who spend their time on quantopia and the like have a day trader mentality.

Let me know if you have any questions.

Thanks for asking this question, I will look for you on twitter.

I can't tell if you are being sarcastic, the S&P was up slightly more than that in 2017...
Not being sarcastic or proud, I know I (barely) lost. Just stating the facts. Obviously over a long term horizon of like 10 yrs I expect to beat the S&P or I would be spending my time elsewhere.
Well good luck. It's just too easy to fool your self in an up market. It would be much more interesting to see your results in a down or sideways market.
A fool would judge their algorithm based on ANY single year's performance--up down or sideways. Moving averages over 5 or 10 years are what matter.

Check out Berkshire Hathaway's performance. There are plenty of years they have UNDER performed. But they are doing OK.

http://www.berkshirehathaway.com/letters/2017ltr.pdf

My understanding is berkshire does a lot more than just buy stocks. They buy companies and actively improve/invest/streamline them to be more profitable. This will obviously increase the value of said company and make them money. Most retail investors can't do this, so it's pointless to compare the two.
In 2017, the S&P 500 was up 18.74% - not that the extra 2.5% you made is nothing, but it's not a get-rich-quick type of return.

How many trades did you do over the course of the year? Was your volatility lower than the market overall?

96 trades. 4 active strategies that each buy 2 stocks a month and hold for a year.

I care so little about volatility that I'm not even measuring it yet. And I admit that might be dumb.

Interesting note: the S&P 500 with dividend reinvestment returned 21.14% in 2017 [1].

[1]: https://dqydj.com/2017-sp-500-return/

If you bought and held an index fund for a year you got taxed less as well.
Yep if I can't overcome the drag of long-term capital gains over several years I will pull the plug.