Live data from Hacker News

Show HN: I discovered a trading algorithm that returns ~24.85% annually

github.com

21–30 of 134 posts

Re: Show HN: I discovered a trading algorithm that returns ~24.85% annually

#21
post #14
post #11

Earlier quoted context omitted.

Serious question: I fully understand the idea of historical algorithms being no true indicator of the future. With that said....... If an algorithm consistently performs over 20+ years of data (through multiple black swan events, multiple major events), then why is it not safe to assume it likely will continue going forward? Wouldn't 20 years of "evidence" be a huge amount, such that future events likely wouldn't dev…

Overfitting, even on a 20 year dataset.

Interesting

My ML knowledge is somewhat rusty... does overfitting occur more often on models with many input parameters (ie.. neural networks).

His algorithm seems very simple, without really using ML at all, it's more of just a procedural 1-2-3 step thing, with no actual learning.

Can you explain how overfitting works into his algorithm?

Re: Show HN: I discovered a trading algorithm that returns ~24.85% annually

#23
post #6

Earlier quoted context omitted.

I decided not to add trading commissions because most brokers have removed them after Robinhood entered the market.

There is still a spread.

And shorting is not free.

Re: Show HN: I discovered a trading algorithm that returns ~24.85% annually

#24
post #19

The algorithm of just selling the best performing etf of yesterday???

Yup

It is a mean reversal bet. It can work. But what if one of the ETFs goes to zero? Then the algorithm will continously buy that all the way down.

Erm - edit - scratch that: But what if one of the ETFs goes to the moon? Then the algorithm will continously sell that all the way up.

Re: Show HN: I discovered a trading algorithm that returns ~24.85% annually

#26
post #21
post #14

Earlier quoted context omitted.

Overfitting, even on a 20 year dataset.

Interesting My ML knowledge is somewhat rusty... does overfitting occur more often on models with many input parameters (ie.. neural networks). His algorithm seems very simple, without really using ML at all, it's more of just a procedural 1-2-3 step thing, with no actual learning. Can you explain how overfitting works into his algorithm?

If you really want the answer to this question on your own, try out his algorithm and you will see what happens. Either he's right, and you make the suggested returns in a year, or he's wrong and you slowly realize why. It will be a learning experience. Don't take anyone's word for it.

Re: Show HN: I discovered a trading algorithm that returns ~24.85% annually

#27
Congrats. While it can be exciting to come up with a profitable algorithm, publicizing a mean reversion algorithm is counterproductive if you intended to make any money with it. The returns here are low enough that it could stay under the radar for a while, but all the same.

Some other metrics to measure your performance are drawdown, best month/worst month (to see if a small number of events account for the majority of returns), and Sharpe ratio. As other commenters said, try backtesting with fees/slippage. Even if there aren't fees now, you should include fees at points in history when there were higher fees. HFT's have been forced to tighten their spreads as retail traders have become more liquid with lower/nonexistent fees, so that will affect any mean reversion strategy being tested across fee change periods.

I do like the idea of spot mean reverting on large indices. Takes a lot of risk out of it (while a company can tank overnight, any decently weighted index will lack that volatility).

Re: Show HN: I discovered a trading algorithm that returns ~24.85% annually

#29
post #6
post #3

Now add trading commissions :-)

I decided not to add trading commissions because most brokers have removed them after Robinhood entered the market.

Short selling, though, incurs an additional borrowing cost. That's been going up for ETFs since 2020. "The price of short-selling U.S. exchange-traded funds has jumped dramatically since the beginning of March as investors seek to stem heavy losses in the wake of the coronavirus epidemic, according to data from S3 Partners."[1]

This needs to be re-run with the borrowing costs added.

The fact that EFT short selling costs have gone up indicates that others are active in this space, which means the profit opportunities for a simple algorithm have probably been already taken.

[1] https://www.reuters.com/article/us-usa-stocks-shorts-etfs-id...

Re: Show HN: I discovered a trading algorithm that returns ~24.85% annually

#30
post #15
post #11

Earlier quoted context omitted.

Serious question: I fully understand the idea of historical algorithms being no true indicator of the future. With that said....... If an algorithm consistently performs over 20+ years of data (through multiple black swan events, multiple major events), then why is it not safe to assume it likely will continue going forward? Wouldn't 20 years of "evidence" be a huge amount, such that future events likely wouldn't dev…

Another issue is that once the algorithm becomes known, and used be many people, it will not work any more.

It would eventually fail to perform even if it was kept secret.
Post reply on HN