Live data from Hacker News

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

github.com

91–100 of 134 posts

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

#91

As others have said, "Average return is just one statistic". When trading, losses hit harder than wins. Go up 50% then down 50% and you're not even, you're down 25%. The degree of overestimation from this mean return -> "annualized return" calculation depends on what the returns distribution looks like. Here's the calculation used in main.js line 77 applied to a very extreme unrealistic example. I simulated 253 days…

Is it normal to deal with returns over time as log-returns log(R) rather than simple returns (R - 1) for this reason? The average log return does the right thing.

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

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

The concern with these sorts of strategies is that you might discover the problem quickly. Say for instance if the stock you shorted doubles in value and you lose all your money. Even if there's only a small probability of that happening in a given year, going bankrupt by definition negates all the gains you got previously. Worse still, when you short stocks it is actually possible to lose more than your entire investment so a strategy can work amazingly 99/100 times and still have negative expected value.

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

#93
post #81

As others have said, "Average return is just one statistic". When trading, losses hit harder than wins. Go up 50% then down 50% and you're not even, you're down 25%. The degree of overestimation from this mean return -> "annualized return" calculation depends on what the returns distribution looks like. Here's the calculation used in main.js line 77 applied to a very extreme unrealistic example. I simulated 253 days…

Where do you take that uniform distribution from? I don’t think any ETF would conform to that.

> I chose uniformly distributed returns with a wide range to make the reason against this calculation very obvious.

The uniform distribution is a pedagogical choice, to explain why OP's average return calculation is misleading.

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

#94
post #66
post #5

Earlier quoted context omitted.

It looks like it is mean reversion. This is my first time hearing that term. The way I discovered this algorithm was initially I wanted to buy the previous day's best performing sector ETF, with a hypothesis that the momentum would continue. But I learned that it actually ended up losing money. So I decided to inverse the algorithm. There are still a few optimizations I can test out, e.g. Buying the previous day's wo…

No offence, but how can you have spent any time trading without knowing about mean reversion? It's the most basic and well known phenomenon in trading, along with momentum.

Not everyone learns by studying prior art. Some people's brains are wired to need to get their hands dirty before an abstract concept or solution makes sense.

I'm sure that in the ~60 seconds I wrote this post, some brilliant future software engineer just reinvented binary search.

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

#95
post #2

This is a simple trading algorithm I discovered that operates on the Vanguard sector ETFs. This backdating algorithm provides on average a return of ~0.0878% for each trading day, or ~24.85% annualized return assuming 253 trading days per year. ## The Algorithm This algorithm is really simple. 1. On day `n`, determine which ETF gave the highest return 2. On day `n+1`, short sell the previous day's highest performing…

I forked your project and added a financial metrics analysis package. .067 sharpe ratio, .11 sortino, largest drawdown was ~41% Not very good numbers. Fun stuff though! [0] https://github.com/maxto/ubique

If there a link to your fork?

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

#96
This is a shorting strategy, which means you need to decide on how much of a collateral do you set aside for the short. As you increase the collateral, your real returns are reduced, but as you reduce the collateral, your chances of getting short squizzed increase and you depend more on the intraday volatility.

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

#98
This is a good time to note that it is incredibly easy to overestimate your ability to determine a trend based on historical data and also incredibly easy to underestimate the likelihood of a never-before-seen occurrence. “The turkey that gets fed well every day relies on that trend continuing and never sees the week before Thanksgiving coming.”

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

#100
post #95

Earlier quoted context omitted.

I forked your project and added a financial metrics analysis package. .067 sharpe ratio, .11 sortino, largest drawdown was ~41% Not very good numbers. Fun stuff though! [0] https://github.com/maxto/ubique

If there a link to your fork?

all forks on GitHub are public, i took the liberty and did some snooping, the only fork which had some new commits was this one: https://github.com/jesshowe/SectorTradingAlgorithm
Post reply on HN