Live data from Hacker News

Case study: Algorithmic trading with Go

polygon.io

11–20 of 311 posts

Re: Case study: Algorithmic trading with Go

#11
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 :)

@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 historical (eg: no re-compute on ticks)

2. Data storage (article mentioned you're all in memory). I've been using S3 & ArticDB

3. If your in-data memory is treating you well for multiple TA calculations (example: in Python, you can compute & save pickled dataframes - and re-read those over longer time periods)

Re: Case study: Algorithmic trading with Go

#12
post #9

did you use TWS API or Web portal API for IBKR?

Go app -> TWS API (on the desktop client) -> IB

What's cool about this is that you can look at the IB TWS client and see things happening in real-time. So, it acts as sort of a sanity check. I know they have that gateway too but personally I like to look at the client all the time too. My workflow is to run the bot and the TWS client side-by-side and watch it make trades, see how things are moving, etc.

Re: Case study: Algorithmic trading with Go

#13
post #5
post #3

Slightly related: when running 3 screens like that, put the middle (primary) one in landscape, so the array is like a big H. It works better for videos and code, IMO. You still have two huge portrait fields for documentation/webpages/etc, or 8 portrait-oriented quarters. I usually run 8 portrait-shaped windows quartered on the sides, then two side by side on the middle, which are each approximately square. I don't li…

Yeah, personally, it's been a game changer just being able to load so much more into your field of view. Having two side-by-side makes it really easy to look at other parts of your code and make changes. I'm loving it! I'll give the H method a try for a few days and see how it goes.

What is h method?

Re: Case study: Algorithmic trading with Go

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

Re: Case study: Algorithmic trading with Go

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

Re: Case study: Algorithmic trading with Go

#16
post #11
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 :)

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

Re: Case study: Algorithmic trading with Go

#17
post #13
post #5

Earlier quoted context omitted.

Yeah, personally, it's been a game changer just being able to load so much more into your field of view. Having two side-by-side makes it really easy to look at other parts of your code and make changes. I'm loving it! I'll give the H method a try for a few days and see how it goes.

What is h method?

Oh, sorry. I was referencing the OP comment there.

> 3 screens like that, put the middle (primary) one in landscape, so the array is like a big H.

Re: Case study: Algorithmic trading with Go

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

Re: Case study: Algorithmic trading with Go

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

Re: Case study: Algorithmic trading with Go

#20
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 :)

Awesome write up. I have a similar project in Go myself, although I just use minute bar data instead of realtime ticks.

Can you share your approach for plugging in various strategies? I quickly learned that having a pluggable strategy system is tricky as it could span across multiple layers of the system.

Also, with backtesting, are you storing and replaying all the quote/tick data? or just using the historical aggregates?

Post reply on HN