Live data from Hacker News

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

github.com

1–10 of 134 posts

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

#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 ETF at market open and close your short position at market close.

Because this algorithm operates on Vanguard's 11 Sector ETFs, it is resilient against the volatility of individual stocks.

### Caution

Hindsight is 20/20 and because this is a backdating algorithm, similar results are not guaranteed in the future. Use at your own risk.

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

#4
This is mean reversion, right? Essentially fading market volatility. I recall an article on Bloomberg about a quant fund using VIX ETNs to implement something similar. Gradually adding short positions as volatility rises. Knowing it will dissipate once turmoil subsides. My recommendation: try entering a trading contest on Alpaca ;)

https://alpaca.markets/data

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

#5
post #4

This is mean reversion, right? Essentially fading market volatility. I recall an article on Bloomberg about a quant fund using VIX ETNs to implement something similar. Gradually adding short positions as volatility rises. Knowing it will dissipate once turmoil subsides. My recommendation: try entering a trading contest on Alpaca ;) https://alpaca.markets/data

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 worst performing sector.

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

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

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

#9
What software do you use to implement algorithms like this? Do you have to write your own python/other scripts and interact with trading API's for whatever service you use, or are there nice pre-written open source trading algorithms that make building stuff like this easier.

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

#10
post #9

What software do you use to implement algorithms like this? Do you have to write your own python/other scripts and interact with trading API's for whatever service you use, or are there nice pre-written open source trading algorithms that make building stuff like this easier.

I just downloaded historical data on Yahoo Finance and parsed the CSV files. There are definitely more efficient ways to do this.
Post reply on HN