Live data from Hacker News

Case study: Algorithmic trading with Go

polygon.io

21–30 of 311 posts

Re: Case study: Algorithmic trading with Go

#22

This is really interesting. Have your strategies out performed buy and holding index funds, or are you mainly just doing this with a small amount of capital to learn how the markets work? I have always wanted to try algorithmic trading to learn about it, but I have always read it is a fools errand to think you will beat just buy and hold.

1. I think buying and holding is more probable to have a higher return

2. Sometimes you get a cool api and think wow this would be fun, and next thing you know you've lost thousands on boneheaded trades.

I did something similar during the pandemic with Rust with the Polygon API (and instead of interactive brokers, I used tradier). Eventually I learned I actually had more fun building the thing than actually trying to beat the market.

Re: Case study: Algorithmic trading with Go

#23
post #15
post #2

Happy to answer any questions about this. It's been a side project that turned into a full blown obsession. There is nothing too secret about the system since it's more about having a solid platform that you can plug your strategies into. I'd probably even open source it but I'd have to clean up all my hacks :)

Do you have an email? I've been building a similar system for awhile except in F#, would love to connect.

[deleted]

Re: Case study: Algorithmic trading with Go

#24
>I went from not knowing how to solve a problem, blindly googling around and reading books, to just telling ChatGPT the problem, and then asking how it would solve it, then asking it to code the solution. This is absolutely insane and has easily 3x my productivity.

Very interesting. We can facetiously say that ChatGPT is using you as a medium between setting up algorithmic trading in Go!

Re: Case study: Algorithmic trading with Go

#25

This is really interesting. Have your strategies out performed buy and holding index funds, or are you mainly just doing this with a small amount of capital to learn how the markets work? I have always wanted to try algorithmic trading to learn about it, but I have always read it is a fools errand to think you will beat just buy and hold.

This is going to sound crazy given all the scams out there. But I was interested in testing the idea of small compounding returns. Like, could you get a daily 0.5% compounding return. Sure, you could go all in on TSLA for example and get a 1% daily return. But, could you do that with automation, using lots of small bets, across the entire market. You can, but there is a scale issue here. In that you need to make exponentially large bets as your bank roll increases. So, it's capped. Well, that's what I've seen. So, yes you can beat it but only with smaller amounts of money.

Re: Case study: Algorithmic trading with Go

#26
post #25

This is really interesting. Have your strategies out performed buy and holding index funds, or are you mainly just doing this with a small amount of capital to learn how the markets work? I have always wanted to try algorithmic trading to learn about it, but I have always read it is a fools errand to think you will beat just buy and hold.

This is going to sound crazy given all the scams out there. But I was interested in testing the idea of small compounding returns. Like, could you get a daily 0.5% compounding return. Sure, you could go all in on TSLA for example and get a 1% daily return. But, could you do that with automation, using lots of small bets, across the entire market. You can, but there is a scale issue here. In that you need to make expo…

That makes sense to me and lines up with what buffet says about there are alot of people on wall street who can average 50% returns with 100k but once it gets into the millions it is much harder to find alpha.

Re: Case study: Algorithmic trading with Go

#27

This is really interesting. Have your strategies out performed buy and holding index funds, or are you mainly just doing this with a small amount of capital to learn how the markets work? I have always wanted to try algorithmic trading to learn about it, but I have always read it is a fools errand to think you will beat just buy and hold.

1. I think buying and holding is more probable to have a higher return 2. Sometimes you get a cool api and think wow this would be fun, and next thing you know you've lost thousands on boneheaded trades. I did something similar during the pandemic with Rust with the Polygon API (and instead of interactive brokers, I used tradier). Eventually I learned I actually had more fun building the thing than actually trying to…

I have won and lots thousands for sure. Haha. When stocks were on a rip the bot was making lots of money just because everything was going way up. Then, in 2022 when everything went way down, like tons of tech stocks, my bot sucked. So, I really need to add shorting or something. I'm still exploring things on the strategy side.

Re: Case study: Algorithmic trading with Go

#28
post #14

Excellent write-up! Is there somewhere where I can read up on all the trading jargon? Also I wonder how can there be changes in the price of a stock after market if the exchange has closed? Isn’t the whole point that trades need to happen for stocks to get a certain value?

https://www.investopedia.com/ is probably the best resource and chatgpt. I honestly, just google stock related terms and all roads lead to investopedia.

Re: Case study: Algorithmic trading with Go

#29
post #16
post #11

Earlier quoted context omitted.

@WestCoastJustin I've been really wanting to use Go, but as you say, much of the community is Python due to the data analysis strengths. To the detriment of the other things Python does do poorly. Can you give some thoughts with your experimentation on the following from a Go perspective. 1. Supported TA libraries in Go. I'm familiar with TAlib (python), bloom, etc. - certain forks tailored to real time rather than h…

Why not switch to Mojo lang for this? It's Python-compatible with Golang like performance from what I hear.

@eshnil (& others familiar with Mojo)

I had not looked at Mojo... thanks for the pointer. In the past, I've had issues with library compatibility with compiled derivative languages of interpreted ones (eg: Crystal of Ruby, etc, etc).

Know if Mojo directly uses existing Python ecosystem?

I've been using Polars, etc.

Re: Case study: Algorithmic trading with Go

#30
post #14

Excellent write-up! Is there somewhere where I can read up on all the trading jargon? Also I wonder how can there be changes in the price of a stock after market if the exchange has closed? Isn’t the whole point that trades need to happen for stocks to get a certain value?

There's after market trading on venues. But because most of the liquidity has "gone home" you can't transact as much at those prices and those prices are based on relatively few/small transactions.

Yeah, this is where a system like this shines. In that you can build a tool, like top, but for the stock market. You have all the real-time data. So, you can look at where the party is happening at. Just by looking at the trade flows. This is where building your own system absolutely kills anything else.
Post reply on HN