Live data from Hacker News

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

github.com

121–130 of 134 posts

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

#123
post #66

Earlier quoted context omitted.

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.

there are a whole lot of people losing money in the markets while knowing all about prior art and terminology. There is a good reason successful hedge funds like RenTech are not hiring finance people but mathematicians who have no idea about "mean reversion" and other pseudo-scientific terms.

Quant funds hire theoretical physicists and mathematicians because it’s the math part in “financial mathematics” that is hard, it’s just easier to teach a mathematician finance and Python/C++, than taking an average finance major or developer.

It’s definitely not the case that they want people to reinvent the wheel. Options pricing for example is a Nobel prize winning discovery.

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

#124
post #104

Earlier quoted context omitted.

You seem to know your stuff about this. Do you know any good starting points to learn about algorithmic trading? Any youtube channel or book?

If you’re looking for information on quantitative trading, and are considering relying on a YouTube channel, please just park your money in an index fund and go read about LTCM, Black Tuesday/Friday, Knight Capital, Orange County, and the Global Financial Crisis. Just remember, finance is not like betting on the ponies. It’s worse, because the odds aren’t posted.

I have a day job I just think it would be a fun way to learn some applied ML. Anyway, what’s wrong with learning from YT?

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

#126
post #81

Earlier quoted context omitted.

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.

That’s the point - the choice of a normal distribution is misleading. It doesn’t model market behaviour on any time scale.

Backtesting is more likely to be meaningful. Am I missing something here?

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

#127

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…

> Go up 50% then down 50% and you're not even, you're down 25%. It helps if you measure in the right units[0], namely bits, orders of magnitude, or fractions thereof. Up 50% is log(1.5) = +0.58 bits, down 50% is log(0.5) = -1 bits, and indeed 0.58-1 = -0.42, or 1.5*0.5=0.75, down 25%. 0: Well, strictly speaking the problem is that up/down X% isn't even in units at all.

Obviously dollars.

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

#128
My impression is that the idea that the market average beats most strategies in the long term hides the fact that some strategies perform horribly, and some perform great in the long term, but many of the strategies that perform horribly look good in the short term, and distinguishing between the strategies that are attractive in the short term but horrible in the longer term, and those strategies that perform well in the longer term is a very hard problem.

Of course, this might be a rationalization of me not wanting to spend the time and effort to construct an effective trading strategy.

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

#129
post #126

Earlier quoted context omitted.

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

That’s the point - the choice of a normal distribution is misleading . It doesn’t model market behaviour on any time scale. Backtesting is more likely to be meaningful. Am I missing something here?

The question isn’t backtesting vs no backtesting. The question is do you use the arithmetic mean of daily returns as your metric or use the final return over the entire period. The arithmetic mean hides the fact that large downswings hurt your net return more than they would otherwise seem to, and is therefore misleading, making the strategy looking better than it actually is.

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

#130

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…

The uniform distribution is the wrong distribution for this. A normal distribution is better, but also wrong- the normal distribution significantly under-predicts extreme events relative to the stock market.

Can you try it with the Laplace distribution? It's a bell curve like the normal distribution, but has fat tails. Extreme events aren't common, but much more common than with a normal distribution.

https://arxiv.org/pdf/1906.10325.pdf

Post reply on HN