Hacker News new | past | comments | ask | show | jobs | submit login
Ask HN: Anyone making money through algorithmic trading?
389 points by charlesdm on April 25, 2018 | hide | past | favorite | 245 comments
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)

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.

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.)

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.

"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.

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.

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.

Khan describes the long straddle (3:53): https://youtu.be/2HIRaOQDRho

I think the terms you're looking for are "straddle" and "strangle" options strategies.

> 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.

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.

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.

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.

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

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".

I hacked together my own scripted system that would arbitrage cryptocurrency across exchanges.

It worked (for the most part), but it's been abandoned now. The best way I can think of to describe why is to say that while the low hanging fruit exists, there's far too little juice in it for it to be worth the squeeze.

Others have explained that the problem they've encountered is counter-party risk in that some exchanges may not allow you to withdraw, or the prices may be skewed because they're charging absurd withdrawal fees.

None of this was a problem for me - I found the exchange APIs almost universally hold that information somewhere if you hunt around enough for it, so I was able to account for this when scoring opportunities.

My reasoning was that from a birds-eye view it looked like the price differences were allowing for trades that would have a 1-2% difference. I reasoned that if I were to withdraw directly to the wallet of another exchange I could have a turnaround time on some currencies of less than five minutes start to finish - even 0.1% every hour would be an incredible rate of return when extrapolated to a yearly ROI.

In reality, while currencies did (and do!) trade with that difference frequently between exchanges, the volumes are tiny. Despite having funds to spend, there weren't any big-money buyers at the destination exchange, and within a couple of dollars (literally a couple of dollars) the bids at the destination exchange were back below the price of the source exchange, and I'd be in the red on the transaction.

Add in the fees, and there was vanishingly little profit to be made while taking bet-the-farm risks that whoever runs the exchange isn't going to elope with your bitcoins.

It was a good learning experience, though - so I'm ultimately glad I took a run at it.

I spent the last few months trying to build an arbitrage bot and ran into exactly the same issues. If there's a big price differences there's always a reason, either deposits or withdrawals are temporarily offline, or the fee for transferring or depositing is too high, or for some very small coins it can takes ages to transfer (one transfer took 6 hours, another took a whole week!). Otherwise the volume is so low that you basically lose any edge crossing the spread and trying to find enough volume to close out the transaction. I had a small number of trades that made a few pennies, but also a lot more that just sat there and didn't execute at the expected price (based on the bid and ask when my bot found the trade) forcing me to sell for a less optimal price and end up with a loss. I am still sure there's money to be made with this but it takes a lot of work and you would have to search across a lot of coins and a lot of exchanges to find a viable option. Most people, including some very smart people I've talked to, just assume it's pretty easy to do this but if it was everyone would be doing it. Maybe it was 3-4 years ago when crypto was much smaller and less well known, but nowadays most opportunities are exploited as soon as they exist, I suspect a lot of time by the exchanges themselves.

That reminds me!

At least one exchange that I know of was front-running me.

I'm not saying which exchange it was as I don't want to get trouble for outing them - but it was definitely going on.

I tested this by putting in orders at times of low activity (i.e. nothing for minutes, then I'd place an order, and the best offers would be taken up by a "bid" that came in ahead of me. This could happen in theory but when it's happening as the order is received there's no realistic chance of it being anything else).

> for some very small coins it can takes ages to transfer

Why do you need to transfer between exchange?

Writing an arbitraging bot is in my bucket list of projects I'll one day work on, and to avoid trasfer times, which are ridiculous with some cryptocurrencies, the plan is to keep a balance of both sides on both exchanges.

Example: if you're arbitraging ETH/USD between exchanges A and B, you have an ETH balance on A, and a USD balance on B, and you concurrently buy/sell on both.

Then you have the problem of managing dozens of balances across as many exchanges, which is left as an exercise for the reader :)

That's the point, you can't have so many balances in so many exchanges, because, in that case, each return is going to be very small. Just to take profit on an ETH USD arbitrage, you have to have 25% of your capital in ETH and 25% USD in exchange A, and 25% ETH and 25% USD in exchange B. So, when you take advantage of the opportunity to buy ETH at low price on exchange A and to sell on exchange B, you are only earning an arbitrage profit on a 25% of your capital. And that profit become less and less if you divide your capital into more coins and more exchanges.

You discovered a few important market dynamics! First is that the spot price is only one of the variables to take into consideration when trading. Market depth and liquidity are two others.

If someone says they will pay you $3 for an apple, you don't run out and buy 100 tons of apples. You first need to see how much they will pay for the second apple, the third apple, a ton of apples, 10 tons of apples, etc.

I considered doing something like this when I saw how wide the differences between exchanges could be, but the problem I ran into was that the fees for trading on most exchanges are insane. Which is probably why those huge difference exist.

Yeah, I tried doing this as well. But you're right, the spread on the arbitrage pretty much vanishes as soon as you try to do any kind of significant volume. I suspect my trading pair was "too" liquid. This could possibly be a viable option for coins that don't see a lot of volume. Or, maybe for a short period after a new coin is added to an exchange and there's a period of high volatility.

This is why you don't withdraw. Just arbitrage back the other direction.

My arbitrage script was weighted to favor rebalancing my portfolio.

Are you talking about pair trading? How do you do it, since you can't go short in crypto? (At least not if you are not using bitfinex)

You short by selling. See my sibling comment: https://news.ycombinator.com/item?id=16931793

Yes I have answered on that link. I think in that case is unrealizable.

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.

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! =)

if you've lost 100k, you had 100k to spare. agree it was an expensive lesson.

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...

Yes, it sucked losing that much money but I'm lucky and grateful that it didn't alter anything about my life.

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.

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?

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 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.

* Use benchmarks against performance

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)

I have been writing my own trading bots for about three years or so, maybe a little less, all told. But exclusively on crypto exchanges. I think most people familiar with crypto could see the latest bubble for what it was, but I did manage to get out before it popped and I've been giving it some cooldown time since. I typically do trade off the volatility. I've put many hours in front of the exchanges (and put a ton of quarters in the machine, so to speak), just watching it like television, and this is the way I learned my strategies (incidentally this is the same exact way I taught myself about networking, by watching tcpdump and ethereal/wireshark). I can do pretty well if the volatility is fairly even. I do end up losing a big chunk of gains when there's too much fluctuation. I've got failsafes in the form of floor/ceiling prices at which my bots pull the cord, but this ends up being pretty expensive and is one of the main ways I end up losing steady gains. I absolutely never trade on margin. I see it as a puzzle, as a kind of game, and the challenge is a substantial part of the reward for me. I will also warn you that pretty much all the rules change once you start trading enough to make the price move locally. It's almost a whole different ballgame. And at least with crypto, it's fairly obvious that most of the trades on the exchanges are people doing the same thing you're doing. You get to know "people" by their patterns of trade.

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


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.

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

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.

>based on simple technical indicators

Pure voodoo

Perhaps. But if "voodoo" results in consistent returns then who cares?

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.

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?

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.

> 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.

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.

> 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.

What's the maximum downside risk in a day? How do you guard against that happening?

Thanks for posting, looks quite interesting.

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?

A half a penny at a time

I know a few people doing this, one person in particular who has discovered a near-zero-risk quirk that can be exploited with algorithms for fractional %age gain per transaction/cycle/(kind of being vague here sorry). He's been able to deploy large $MM amounts of capital to create significant gain nonetheless.

However none of them will talk about it, certainly not on HN. I'm mentioning it simply to highlight I think you'll find an anti-selection bias by asking here.

Thanks! This is great. It's good to know they're out there. :)

Crypto or the stock market?

Divulging that is probably too much detail.

sounds like front-running; illegal and requires expensive infrastructure

nope not front-running

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.

Yes. I traded equity options. The methodology can be summarized as sentiment analysis and "alternative" data gathering.

My algorithm earned about 127% on an initial outlay of $30,000 from August of 2016 to the beginning of January 2018. The algorithm only deployed 5% of available capital (defined risk exposure) at any time and targeted an aggregate win rate of 60% or greater. Its primary imperative was volatility prediction to sell options on equities with overrated volatility. Selling options is a good foundation for a strategy because you can easily make steady returns over time. But one loss can eliminate a year of profit (or your entire outlay); hence the volatility prediction is required to establish a probabilistic win rate above 50%. The goal is to profit on many small positions consistently, not to profit on fewer large positions. Risk is defined to limit total exposure for each trade. There are explicit stop loss and stop profit triggers, and leaving an indeterminate amount of profit "on the table" (selling a position early) is preferable to risking any amount of loss.

Volatility prediction happens in two stages. Stage one is this: first the algorithm seeks all equities with only one or two sources of revenue and a market cap above $1B. Next it crawls news and social media to assess the amount of "hype" attention the equity is receiving. Then it ranks this list according to the amount of hype, weighting social media (uninformed hype) and source of news (informed hype) differently, in ascending order. Lower hype is considered better (and to clarify this point: hype is considered a volatility indicator whether negative or positive). This task is executed daily.

Stage two is alternative data gathering. For each equity going down the list, common sources of financial data are crawled (analyst earnings consensus, prior 10Qs and 10Ks, etc). I receive a notification with a list of which companies are "candidates" for trading, and look into them to identify sources of alternative data. This data is mostly found through web crawling to track signals with a 1:1 indication to a given equity's revenue. Once I have automated the method of collecting the data, it gets incubated for timeseries analysis for at least two quarters. If it forecasts revenue correctly to within 95% accuracy, the equity is formally whitelisted for trading eligibility to the algorithm.

Finally the algorithm begins selling options on each whitelisted equity. On a daily basis a volatility forecast is made for the equity based on weighted social sentiment and the corresponding alternative data timeseries. When the volatility prediction reaches a certain threshold, the algorithm ceases selling options on that equity.

We are seeing a number of market enthusiast coming up with trading strategies that work. Most don't have the staying power to get them to work enought to trade. Some do. Those that have the staying power often lack the financial resources to trade those algos for themselves. Problems = Capital, Access, Data, ...

To overcome that some are turning to CloudQuant (where I work). The CloudQuant algo development environment, backtesting tool, and trading strategy incubator is making it easy for people to take their trading ideas to funded trading rapidly. So far they have announced $72M in risk capital allocated to algorirthms created by individuals. Algos are licensed from the creator.


What is CloudQuant's policy regarding data collection on algorithms tested on their service? It'd be a shame if they farmed from the best and sold it as their own but then again, that's probably what I would do. :)

CloudQuant makes it clear that your Intellectual Property (IP) is yours. If you develop an alpha signal, and you collect your data on the site through backtesting, then that is part of your IP provided it isn't a copy CQ provided proprietary or licensed data (Market Data, Alt-Data, Fundamental Data...)

We do limit the size of downloads to ensure that you are not copying these licensed data sets.

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

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
Great algorithm. Great book. I have a big chunk of my own money in this.

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.

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.

Yep, that's the blog. Specifically this post https://meanderful.blogspot.com/2018/01/the-accidental-hft-f...

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?

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)

this blew my mind :)

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

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.

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).

You can also plug Quantopian into RobinHood for $0 trades.

Wasn't support for that removed?

Yes, but check out https://www.oanda.com/forex-trading/tools/algo-lab. (not affiliated with them)

quantopian.com sounds interesting. I am going to check it out.

It's not hard to build a machine learning model that can predict the price direction with slightly more than 50% accuracy. However, once you factor in the trading fees, slippage and the spread, you will almost always lose money. I built a number systems that looked like easy money making schemes that would make small amounts on most trades, but once you factor in trading costs (which most people forget about initially) you will lose money most of the time. That applies to the stock market and also crypto currencies if you are trying to predict the price direction. I have heard also that predicting volatility in the equities market is easier and the better strategy. To make money off that you would need to use derivatives. It's less clear how to do this in crypto unless you are trading futures, and I think making money off the price volatility there requires a different strategy, making heavy use of limit orders and stop losses.

I made some good money (millions) in 2017 by algo trading crypto. Now in 2018, the bear market is on, but my pnl is still decent. I collected data, trained models, wrote execution strategies, automated everything. I was successful because I was moving fast, trying things, breaking things, etc.

While crypto was and still is my turf, I think I could also do well in the stock market. The problem is that the entry barriers in the stock market are quite large. By my estimates, it will cost between 10k and 100k a month to run an HFT strategy fast enough to compete with the fastest players in the field (e.g. running market making strategies). If you have good alpha you could probably get away with slower and cheaper access.

In the crypto world, the market access is free for all, and everybody has equal standing (from what I know). After implementing some WebSocket/JSON APIs you get access to the market that turns around 100s of millions USD per day. Of course, it's much smaller than the stock market, but it's real nevertheless.

I think it's a myth that smaller strategies cannot compete with established HFT firms. It's also a myth that you need grad level knowledge of math/statistics. It might even hurt, becuase phds will be prone to "do things the right way" as opposed to "do things that work". I think it's also a myth that HFT firms hire exceptional talent. In fact, most firms have rather mediocre staff. The reason is that most firms don't make exceptional money. So they don't have a salary pool large enough to pay exceptional people exceptional wages. I'm talking upward from 300k. Companies like Google will happily pay skilled engineers around that watermark. The Google/startup jobs might feel dull, but the finance jobs are way more boring and less rewarding... I can rant on this forever - lol.

That being said, I consider myself mediocre developer as well. Couple months ago I applied for Senior Developer jobs at 3 firms and didn't get a single job offer. I didn't try hard, didn't prepare for the interviews, but still.

Edit: I applied for these jobs just to see what's up. Neve intended to take the jobs.

You made millions of dollars last year then applied for a series of senior developer jobs two months ago?

yes, just to see if I'm hireable material - turns out I'm not, lol.

LOL. nice one.

Wow, congrats and well done. Looks like you don't have to apply to jobs anymore ;)

- What was your initial investment? - And did you have any trading experience to come up with those strategies or learned on the go?

i started with 5 BTC in 2013.

learned on the go, but had access to friends in hedge fund business

Give me your secrets

I suspect hard work and smarts. I've made money in sports betting and it's mostly grinding through looking opportunities and avoiding bad bets. The smarts part is avoiding bad bets. If you don't know who the sucker is, you're the sucker.

HODL during a 10x year?

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


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.

I have been building a variety of algorithms for myself over the years for my own person enjoyment. Currently a developer and significantly under challenged, so in the evening I build algos. But before I became developer, I have a significant background in traditional finance.

A little selfless promotion, but I can build algo and API for brokerages. https://www.upwork.com/o/profiles/users/_~0143cef0c7093f242d...

Short answer is - yes.

I have a few buddies using a bot from Crypto Profit Bot (https://cryptoprofitbot.com) and they definitely make profits. Sorta varies though depending on the strategies used.

I played around with this late last year and was able to tune my bot to anywhere from 4% on up. Some trades were ridiculous with 20% or 30% when the bot caught the pumps. Of course, 4% means I was not scalping (a lot of people prefer just 1%-2% on trades) and was in it longer term; trades usually lasted days or longer.

I was with a bot group last year and there were guys that made well over $100k. But, that's all they did, they just had to babysit it and adjust the settings. Too labor intensive for me..

There is an add-on on CPB called Feeder which is pretty cool. It looks at the market and adjusts the settings of the bot it works with (Profit Trailer). It can get a bit complicated tho..

Anyway, this is still an interesting space. I turned my bots off in Feb when things started going south, but I'm thinking of starting them back up now that the market's recovering. I have this feeling that we're gonna beat last year, so now is probably a pretty good time.

Edit: Heh, the CPB guys did an interview on Indie Hackers a few weeks back. Interesting read! https://www.indiehackers.com/interview/8b6064d829

$100k gains, on how much capital invested is that? $20k? $50k? $100k?

I don't know that, but my guess is probably anywhere between $20k - $50k. I just hear mostly stuff like "I got over 100% returns on these accounts".

For what I put in, I started with 2btc and when I stopped I had about 4. I was taking profits along the way of a few thousand every two weeks.

Of course, if you look at the crypto market last year, that's easy to see.

My question for everyone: Where do people get reliable data for back testing? Ideally I'd like data that goes back over 20 years. And with relatively few data integrity issues (e.g. does not exclude companies that no longer exist).

Even more important: How do I know my data is accurate?

I get my data from quandl.com

If you do equities Quantopian gives you a free backtesting platform with tick data going back to 2003. Pretty useful to just start hacking some ideas on it.

There isn't an easy answer for this. Large hedge funds have entire teams whose only job is to collect, process, and clean data.

I know, which makes me wonder how/why people are doing algorithmic trading on the side when they don't have a reliable way to backtest.

I don't want minute by minute data. Average price for the day is fine with me. Or max/min/average.

There's never a very 'reliable way' to backtest, as any interaction you would have done with the market is not accounted for. If you intend to trade (very) low volume it might work decently (on longer timeframes). Existing (open source) and my own home-made backtester use tweaks like slippage to try and 'simulate' this market interaction.. A few I have seen actually use tick-by-tick L2 data to try and get closer to the 'truth'. IMHO, the only really reliable way to evaluate a trading algorithm is to trade it live. This will cost you money, unless you get everything perfect the first time, but doesn't any kind of passive income generation require an initial investment? And yes, I have written, and currently operate, my own (quite basic) trading bot. Yes, it's profitable.

If I ever get into it, I do want to do low volume, with a longer time frame (minimum would be 5 years) - which is why I don't need minute by minute data.

I don't mind paying for data if it's not too expensive.

I use a combination AlphaVantage, RobinHood and Yahoo Finance. None are perfect by themselves and I'd be willing to pay for 20 years of intraday data.

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.

I am 100% convinced that there are people doing this. I know an ex-Google engineer who's doing it for stock options. I think, however, that to be successful, you'd need to have some comparative advantage, e.g. one or more of the following:

1. access to a data source others don't have easy access to;

2. a reasonably deep understanding of statistics and, particularly, a deep skepticism and conservatism about any data you look at; or

3. time to invest in looking for oddities in the market.

(3) is probably the "easiest" for a newbie, although it's not as conducive to algorithmic trading, since it requires manual research (though, if you were clever, you could probably come up with something to make this algorithmic). Here the example that comes to mind is the two guys Ledley and Mai mentioned in this chapter of the Big Short: http://www.bookcaps.com/the-big-short-chapter-summaries---ch...

Yes. I have a very simple algorithm. Expressed as a function

f(state of the market) = purchase shares in a fund that tracks the S&P 500

Total return: 12-20%/yr. Sometimes more, sometimes less

When does your algo close the position?

Once 4% of the current value equals my expenditures for the year, it'll start selling enough capital each month so that I recuperate all my personal living expenses. I doubt the positions will ever be fully closed out until I'm dead.

I'm going to pull out some small bits from your AHN and ask in return: If you think you might have found a niche that might work in your favour, why on earth broadcast it?

"...that would not be interesting enough for larger algorithmic trading firms"

This could have been your potentially unique insight.

"... But are there opportunities ..."

There probably are but you wont find them being researched on AHN.

"no need to disclose _how_ you actually do it"

So, you don't think it is original anyway.

Before you went AHN, you had an idea but instead of doing some original research on it, you dived straight in and published it here. No doubt you will (have already) get lots of ideas and responses but the idea is out there now whether you want it to be or not.

Honestly, I don't. I was merely wondering whether people are even able to make money doing this.

This is akin to, "are indie devs making money on the App Store in 2018?"

Fair one mate. I suppose I read too much into it and I apologise for perhaps being a bit aggressive.

I take you are more interested in the environment itself rather than actively exploiting it - although that might become an option later 8)

I tried some HFT between altcoins but order latencies killed my margins. Had a few days with up to 6% profit (per day) but net loss was 10%, mostly due failed attempts, bugs and transaction fees.

It felt just like gambling and ate my life away for a few weeks

I don't recommend algorithmic trading. Interactive Brokers shows that less than half of their forex traders are profitable and it's very consistent: https://www.interactivebrokers.com/en/index.php?f=3731

If you end up doing it then do it with a very small amount of money and scale up SLOWLY. I don't think you will have fun in cryptocurrency markets either. They are ridiculously volatile and your bot will probably be doing nothing for a while as it waits for the price to come back.

Forex seems like a market where the average trader would see less success than something like equities because Forex seems zero-sum at best. Do they have these statistics for other markets?

> less than half of their forex traders are profitable

Slightly less than half are profitable. This seams reasonable. And how much of IB trades are done by algo trading? Probably not much.

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


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.

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.

It seems pretty close? Insider trading is any trade that exploits non-public information, regardless of whether it's made by an employee.

We could be interpreting this document differently [1], but keeping track of public forum postings by people claiming to work at tech companies seems quite far from a reasonable definition of illegal insider trading.

1 = https://www.sec.gov/fast-answers/answersinsiderhtm.html

It is not close, since no agent-principal relationship exists.

Yes, made more money last year trading, than for all my previous jobs combined. Probably got lucky by betting big in an up-trending market, but I'll take it.

I use an automated inter-day scalping bot and a collection of scripts to help with manual longer-term technical trading or jumping into a P&D for quick profits.

Generating alpha was easier for me than setting everything up. I did not use any complicated model or strategy.

I suppose it will get more difficult, if not impossible, once the big boys jump in, but right now it is a market for makers.

Your answer is confusing... it sounds like you traded actively by "scalping" - but you admit that you got lucky via buy-and-hold ... So you didnt get paid on alpha - but just regular beta. Very few people have alpha....

~0.1% lending bot, ~12% scalping bot, ~7800% algo-assisted technical trading.

The luck was that when you took a BTC profit on alts, BTC would have 5x in the mean time, so you 5x your profits. And even if you made a loss on alts, you'd still break even dollar-wise.

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.

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.

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.

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.


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.

I've been using an AWS EC2 instance to run a trading algorithm I put together in Python for the last year or so. You can see the results at http://kandfx.com which I put together as a handy way to track its progress on the go.

I've been trading with Oanda's API for over a year but originally traded using Metatrader 4 and built the algorithm in the native MQL4 language. That ran for around 2 years and the 3 years prior to that was learning and developing my strategy.

Thanks to Docker containers, Python and Amazon EC2 I can finally say I have got the whole pipeline to a stable state which was probably the biggest hurdle after developing the algorithm in the first place.

As for the strategy I have been very reluctant to share it with anyone because on the surface it is very simple. That being said there are some fundamental reasons as to why I believe its been profitable which has more to do with psychology than anything else but it did take learning a lot just to try and distil the behaviour into something that could make money.

I've had some mild success with Crypto but I wouldn't ever try trading it the way I do Forex. The market behaves very differently and not to mention being in the UK any profits from Forex trading are non-taxable as I use a spread-betting account.

Long story short… yes, I do believe you can make money algorithmic trading. Is it easy? No, far from it especially when it comes to having a fault tolerant system.

Yes. I "algo" trade equity options. It's strange to me that I don't see much mention of this answer given all the argument about stocks being a 50-50 bet.

Options let you just roll the dice on probabilities off the assumption that the market is effectively random. You can use them to push the 50-50 probability much further in your favor.

For example, I stand to profit nicely at the next expiration (May) of most of my options as long as the market doesn't move more than a stddev in either direction. It could go up, down, sideways, no matter. I will make money. If it drops significantly, I will lose marginally until my "insurance" (far OTM puts) kick in and I start marking money again.

Edit: A common beginner's option strategy is to write a put for a stock you'd like to own. If the stock stays flat or goes up, you make money off the premium. If it goes down, you now own that stock. You can now turn around and sell calls against that stock, collecting premium until you're forced to sell the stock because it's moved back up again. You only "lose" if the stock makes an extremely large move down (like going bankrupt, or a GE style dividend) and you're stuck with a stock you can't sell premium against. Far from the 50-50 bet most people think of when they think of stocks.

I guess my question about what you've described is: can't I just give you my money, you do this for me with my money, and you make a cut off of it?

In other words, what products can I buy that basically do what you're doing already?

Not me, no. But if you've got a good money manager they can/will do this sort of thing if you ask. Otherwise, this is sort of how a hedge fund works--delta neutral portfolio management. You can always try to join one of those.

Thanks for answering my question, but I was being hypothetical. I just wanted to know what services do this sort of thing in theory, not like I have money I need to get involved in this idea!

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.

> 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.

Makes sense, thanks for the explanation.

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.

Excuse me for being ignorant, but what does TA mean in this context?

Trend analysis. Kind of the first thing they teach you in tutorials, I think mostly because it's easy to convey. I could explain it here, but you're better off reading the Investopedia article.


They do mean technical analysis.

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.

I have an equities strategy that I run on IB. I think it is possible to generate alpha with a small account if you do it right e.g. don't compete with big funds in HFT.

There's a cool article about this by Robert Carver who used to be a portfolio manager at one of the top quant funds.


do you think IB would close an account for algo trading? I have bad experience with sportsbooks

no, we support it, there's an api that you can use. Brokerages live off of volume.

IB and sportsbooks are completely different

IB charges you a fee and then matches your trade with someone else. After this trade happens, IB no longer carries any risk

Sportsbooks charge you a fee and then take the other side of your bet themselves

We have started something similar to the your question. It is project which generates useful signals for trading with Bitcoin and improves existing trading strategies with these signals. In case you would like to read more, we wrote a blog: https://www.smartcat.io/blog/2018/bitcoin-trade-signals/

If I would have developed an algo for very profitable trading, I wouldn't share it with anyone or maybe with close friends, but just making the freaking money...

That said, 99.99% out there claiming to have such a thing is just scam, crap, bs and/or non-sense.

But to your question: "smaller strategies" and "not be interesting enough for larger algorithmic trading firms": There is, but why would one tell??

I was until the exchange closed and kept everything. (I only had like $100 invested because I didn't fully trust my code yet...)

I had bigger plans for the project but lost interest after that.

Code is available if anyone is interested, though: https://github.com/nfriedly/Coin-Allocator

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.

I would like to give my 2 cents on where I see any opportunity!

A newer quant will be incentivized to create an equity strategy because the data is available and the markets are liquid. Because the equity markets have been automated for so long, a lot of the inefficiencies and arbitrage opportunities have been leveraged. If a user were to come across an opportunity, it would most likely disappear quickly, which then can lead to your strategy hemorrhaging capital.

An alternative would be to secure data feeds and invest time in less heavily traded securities, trading liquidity for reduced competition. This becomes a much scarier idea, because you may not be able to exit your positions if they slide away from you. It would generally be hard to get the right to trade these securities without large amounts of capital or a big name behind you, but this is part of your advantage.

I've built "successful" trading statregies. As some comment mentioned, trading on volatility is the key but it's extremely risky.

Everyone is trying to build a successful trading strategy. Honestly, a lot of my peers seem to be making the most from "insider trading" these days.

Is it "no" an accepted answer?

Our company works in the crypto space and we have a small research area that includes trading. We played with arbitrage strategies and have not seen a consistent return. Most times when you calculate a high return path it is because some exchange is not working really well (e.g. delaying transactions). Not saying that our observation is universal but I don't believe you can make right now a lot of money with arbitrage except in very discrete opportunities.

BTW, highly recommend the CCXT library[1] to connect with multiple exchanges.

[1] https://github.com/ccxt/ccxt

I know a few people who did this with commodities, but they gave it up after a while to pursue something totally unrelated. It appeared their assessment was that it can work for a while until suddenly it doesn't.

I was making 25$ per day trading manually during a specific 20-min time slot for about a year. That wasn't simply by chance -- nearly monotonic increase in total earned sum with 2-week averaging during the year. Though I didn't hedge against black swan events, and I'm not sure it would be profitable if I've tried to. That said my understanding was that nobody else cared to take those money. I've eventually lost all intrest too since it was impossible to scale.

That was not algorithmic trading, but maybe-could-be-possible to automate.

In crypto, yes, and there are tons of bots out there, many taking very different approaches.

There are a few very big ones that are quite easy to spot if you sit and watch GDAX for 5 minutes.

It's too high risk for most big firms to touch it, but I assure you many are writing bots for it. Many HFT, many AI based predictions.

I've got one that's ranged in return per year estimates from 15,000% to 1000% (the thing I capitalize on is decreasing steadily over time). Currently sitting up 100% in 3.5 months with a relatively low amount put in.

beware survivor bias on this thread.

The technique I came up with is based on re-balancing. You do a calculation of what prices you'd need to make a trade at to re-balance your portfolio. My calculator spits out a high and low price to make limit orders at, and if either of those trades happen, you're re-balanced. You can cancel the other trade, and calculate 2 more prices.

Which ever way the market moves you're better off. It's kind of the opposite of HFT.

I doubt there are systematic strategies you would run from home on a high frequency scale.

There are plenty of longer time horizon non systematic strategies that the big firms probably do not care so much about where you can make some money, mostly in special sits.

I've run also run a medium term systematic options premium harvesting strategy in my PA... It was profitable. But I ran out of discretionary ammo.

Of course there are people doing it successfully ... but very different industry than tech - those who know stay silent. It's really not worth getting into unless you already have years of experience imo. Keep in mind you're competing with the smartest people in the world who have much more resources than you. There's just more low hanging fruit elsewhere.

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

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..)

I once hacked together AI to try and predict if cost of Bitcoin will go up or down based only on time and history of price. The program worked, but I remember it didn't predict very well. Maybe tinkering and reworking it would lead to something, but the combining the AI with the exchange APIs is daunting.

This should have an extra clause: and that properly accounted for their per-trade profits in taxes.

I was until my trading provider eliminated API based trades 10 days ago. Commented on it here: https://news.ycombinator.com/item?id=16310321

Check out https://bitbank.nz for high frequency cryptocurrency price predictions, we also have an api and some open source plugins for bots like gekko too

I use neural networks to try to predict sports betting outcomes.

In financial markets, I badly wished there was a way to bet/lay a public company's metrics. (eg. next month's sales figures)... That would be heaven.

i have a huge database of historical data pm me

I am in this boat right now. I have been writing my own tools, refining my algos and getting ready to try my ideas. If anyone wants to talk about it, I am hap to share what I am working on to help others.

Hey Jason, I too have written my own tools and am hap to share. How do people get in touch directly on this site?

My email is in my profile.

Efficient market theory prevents predicting prices to a certain extent. But algorithms can take out emotions in trading and can limit your losses.

But efficient markets are not a law of nature. Depending on context (e.g. HFT) it might be a wrong assumption.

HFT is what makes the markets efficient, at their own profit.

I've been meaning to find a developer to build something for this. Anyone have experience with the INteractive Brokers API?

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 know a guy who makes so much money he got banned from the internet. He told me he makes 1000000 Btc a day. Fact.

So your guy makes $8,957,005,000 daily?

These things happen, and with much bigger amounts... Trend following or HFT strategies are not the only way to make profit in inefficient markets. Eg:


Anyone can make money while the markets rise, but HFT probably won't keep you afloat when the markets fall.

I was botting for arbitrage with sports betting. they will close your accounts fast

Its possible to do so, but it is difficult. A few years of experience in a successful systematic team is extremely helpful. Among many other things, you learn that running a profitable strategy involves the coordination of a number of different types of tasks, which are similar but different enough so that its difficult for one person to be simultaneously good enough at all of them.

To run a successful strategy requires strong signals (indicators that dictate what to buy/sell and when), execution (actual filling of orders on exchanges), risk management (which can include statistical risk modelling as well as draw-down controls), and infrastructure (the wrong type of bug can be costly enough to kill the whole operation!).

As mentioned earlier, there is overlap in the skills and experience required for these broad categories, but people in the quant hedge fund/asset management industry typically specialize in one. This is where larger shops have an advantage. The entire strategy is only as good as its weakest link. Its common for people who haven't worked in the space to focus mostly, or even exclusively, on the signals and infrastructure aspects.

If you were to group most of the successful quant funds out there by alpha time horizon you would see that funds within the same bucket are generally running very similar types of strategies using very similar signals (the general concepts behind successful signals/execution of varying time horizons are actually not that complicated, but just might take a while to explain). Again, that's not say its easy to do. With most of the equities and derivatives markets getting ever more efficient, tighter coordination and implementation of the entire strategy pipeline (signals, execution, risk mgmt, infrastructure) can lead to significant Sharpe/Information ratio improvements.

If you wanted to get a feel for how some successful people in the industry think about the problem, I would recommend reading through the following books in roughly the corresponding order:

1 - https://www.amazon.com/Efficiently-Inefficient-Invests-Marke...

2 - https://www.amazon.com/s/ref=nb_sb_noss_1?url=search-alias%3...

3 - https://www.amazon.com/Active-Equity-Management-Xinfeng-Zhou...

And I didn't personally like this one so much but its quite popular among the more "academic" types

4 - https://www.amazon.com/Active-Portfolio-Management-Quantitat...

wouldnt you rather do something to earn money?

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

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.

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).

Yes, but I certainly wouldn't mind supplementing it with some passive income from a little automated trading.

fair enough

petting your trading bots is doing something

Careful... If I was making a lot of money via an algorithm; I'd want to keep it secret. Otherwise, once other people knew about my algorithm, they'd try to game the system.

There are a lot of people using the very same algorithms for trading, and still make money.

Using a simple EMA crossover signal with RSI and volume support is quite sufficient to make lots of good trades, one big reason being the fact that a lot of traders actually use the very same indicators, and self-fulfilling the prophecy.

It takes more than just reading a few indicators to consistently trade successfully, but my point is that many 'algorithms' and 'trading systems' only really work when they are well known.

This is mentioned in the question itself.

Applications are open for YC Winter 2022

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact