Live data from Hacker News

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

github.com

31–40 of 134 posts

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

#31
post #11
post #7

You did not discover a trading algorithm that returns ~24.85% annually. You massaged an algorithm until it produced a 24.85% annual return training on historical data. Come back when you are ready to claim you have made ~24.85% per year with an algorithm you created 5-10 years ago. Deny it, Downvote it: Destiny still arrives.

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…

January effect.

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

#32
post #19

Earlier quoted context omitted.

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.

That is not what this algorithm would do.

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

#33
post #22

what time period did you backdate over? i’m curious what the backdated return would be for different time periods

January 30, 2005 - June 6, 2021.

You can try sampling different time periods by downloading data from Yahoo Finance. I may need to make the code more robust because there is some data that I hard-coded just for the dates I selected.

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

#34
post #26
post #21

Earlier quoted context omitted.

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.

To do that would be to presume I doubt the validity of your claim (I DO believe what you said).

I specifically asked how overfitting applies to a simple procedural technique, rather than a multi-dimensional method like a neural network.

Trying myself, and losing money, doesn't explain how overfitting applies to procedural steps (as I said, my ML is rusty)

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

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

There is no spread when you trade at the open and the close. There could be slippage (you can create a market impact) but it would be minimal on sectorial ETF because they are extremely liquid.

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

#36
post #19

Earlier quoted context omitted.

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.

As I read it, the strategy never goes long -- it's always simply short one ETF. The bad cases look like "one sector consistently outperforms", or "leading sectors have bull runs of consecutive days before losing steam".

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

#37
post #19

Earlier quoted context omitted.

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.

It will short it for one market day and then ignore it.

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

#38
post #8
post #6

Earlier quoted context omitted.

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

Taxes would be a good one to add

This would all be short term trading, so it would be counted as ordinary income, which is bracketed.

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

#39
post #8
post #6

Earlier quoted context omitted.

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

Taxes would be a good one to add

If one of my algos makes money, I'm happy to pay.

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

#40
As previously said, this is probably just mean reversion. It’s a commonly used signal that appears to print money all the time, until you take transaction costs into account. If you want to have even more fun, try back testing this same idea on intraday data. Your performance should look phenomenal, and your Sharpe ratio should be well above 10.
Post reply on HN