News for hackers. Stuff that matters.
Re:Algorithmic Trading with Go by czbond on Friday June 30, 2023 @02:14PM (#36539638)
@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:Algorithmic Trading with Go by eshnil on Friday June 30, 2023 @02:16PM (#36539675)
Why not switch to Mojo lang for this? It's Python-compatible with Golang like performance from what I hear.
Re:Algorithmic Trading with Go by czbond on Friday June 30, 2023 @02:31PM (#36539916)
@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:Algorithmic Trading with Go by maest on Friday June 30, 2023 @07:36PM (#36544115)
> Know if Mojo directly uses existing Python ecosystem?

They say they do, including libs with C bindings.

Re:Algorithmic Trading with Go by jjtheblunt on Friday June 30, 2023 @02:34PM (#36539963)
It's not available yet outside of hosted environments provided by Modular.
Re:Algorithmic Trading with Go by WestCoastJustin on Friday June 30, 2023 @02:44PM (#36540145)
Haven't looked. Honestly, I'm so invested in this now it would be a pain to change anything.
Re:Algorithmic Trading with Go by silisili on Friday June 30, 2023 @03:03PM (#36540449)
I'm excited for Mojo, but it'll be years before it's ready for prime time as a general purpose language. It's not even available to download yet AFAIK...
Re:Algorithmic Trading with Go by bberrry on Saturday July 01, 2023 @08:53AM (#36549585)
Hilarious how you suggest someone use a technology that isn't even publicly available, showing how extremely shallow your knowledge is.
Re:Algorithmic Trading with Go by WestCoastJustin on Friday June 30, 2023 @02:43PM (#36540128)
> 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)

I've been basically, just manually coding the algorithms from python into Go. ChatGPT is amazing at this. I really only just about 4 so it was a one time thing.

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

Yeah, I ran into issues and then was like what would be the fastest, then just went in-memory. I download all raw trades/quotes each night and store then into gob+lz4 compressed files. Then for backtesting and stuff I can load these in and build the aggrogate bars on the fly.

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

Yeah, I have a historical lookup table that I build nightly too. This gives me a reference point when I'm doing % change calculations and stuff. I should probably have mentioned that.

Re:Algorithmic Trading with Go by iakh on Friday June 30, 2023 @08:37PM (#36544772)
I'd be careful using ChatGPT for this. I tried the same recently to bootstrap spot yields from par, which is a fairly common code problem with hundreds of examples online. ChatGPT couldn't do it. It produced code that looked right, but would fail my tests abysmally. I ended up writing it by hand. I hope you are validating their code with known data.
Re:Algorithmic Trading with Go by WestCoastJustin on Friday June 30, 2023 @08:51PM (#36544931)
Yeah, I'm heavily testing everything it writes. So, I'm very sure it's correct or get it close enough and then code it. I've seen ChatGPT add imports, functions, etc that don't even exist in Go. What I've found so useful though, is not even coding, but asking it how to solve problems, and then having it code things up. With Google, you need to pretty much already know how to solve the problem then go looking for answers. With ChatGPT you can ask it how it would solve this problem. For algorithms and stuff it have been unreal. Thanks for the warning though. You're totally right.
Re:Algorithmic Trading with Go by pdimitar on Friday June 30, 2023 @03:06PM (#36540496)
Not a complete answer but I quite liked https://github.com/markcheno/go-talib for technical indicators.