I worked in HFT for a while. I find the whole space fascinating. I'm glad OP found similar thrills. "This aspect, the platform itself, seems to be often overlooked in most discussions. Many conversations revolve around strategies (mean reversion, trend following, linear regression, etc.), and backtesting, without fully addressing the practical mechanics or logistics of strategy implementation, particularly in the con…
Case study: Algorithmic trading with Go
191–200 of 311 posts
Re: Case study: Algorithmic trading with Go
#192I worked in HFT for a while. I find the whole space fascinating. I'm glad OP found similar thrills. "This aspect, the platform itself, seems to be often overlooked in most discussions. Many conversations revolve around strategies (mean reversion, trend following, linear regression, etc.), and backtesting, without fully addressing the practical mechanics or logistics of strategy implementation, particularly in the con…
Seems more pointless than crypto to be honest.
Re: Case study: Algorithmic trading with Go
#193I worked in HFT for a while. I find the whole space fascinating. I'm glad OP found similar thrills. "This aspect, the platform itself, seems to be often overlooked in most discussions. Many conversations revolve around strategies (mean reversion, trend following, linear regression, etc.), and backtesting, without fully addressing the practical mechanics or logistics of strategy implementation, particularly in the con…
Seems more pointless than crypto to be honest.
It's a bit like stock brokers - and why wouldn't we want stock brokers to operate at drastically faster-than-human timescales, because we all know the value of a company changes every nanosecond! And "flash crashes" create opportunities for investors to make huge amounts of money!
And just as crypto has poured money into GPU companies (providing opportunities for enterprising secondary market resellers of same) HFT has poured money into networking companies.
Short of creating the great firewall or helping governments slurp up all the traffic on the internet, what could be a more beneficial application of network technology?
HFT (like finance in general) has also gobbled up lots of tech grads, making it easier to find jobs at tech companies.
Re: Case study: Algorithmic trading with Go
#194Earlier quoted context omitted.
Hey, thanks. Yeah, I agree with you. That's an oversight on my end. I'll tell you here though. I'm just using go routines and channels to talk between them and then a giant mutex for locking. That's basically it. So, as new data comes in, it builds aggregates (tick based candlesticks) as needed, this then triggers the the BUY logic loop on that new data, if something is detected, that triggers a IB API order. It is d…
Also, what's your approach to risk management? For example: 1. Do you have anything that limits the size of a single trade or position? 2. How do you measure and manage overall volatility/risk/VAR to your portfolio? 3. What kind of safeguards do you have to avoid catastrophic bugs? (For reference, see Knight capital and how a single bug brought down the entire company: https://www.henricodolfing.com/2019/06/project-f…
- No single bet can be more than 5% of all money. The small bet sizes are what really saves your bacon in that even if a few lose 10+% you're still fine overall. - I'm also limiting the amount of shares I bet and try to keep it in the low hundreds so that I get really fast fills. - I have something that stops everything if I lose more than 1k in a day.
I don't do anything to measure overall risk or volatility. Almost everything I'm in is highly volatile. I'm basically betting as things go up and then try to cash out. Sometimes you hit the top.
Yeah, I inspect all the trades at the end of the day, well and during the day, and try to feed anything new back into the system. This is 100% manual. But, like if a single trade loses $100 or something definitely I'm in there looking at what happened.
Re: Case study: Algorithmic trading with Go
#195Earlier quoted context omitted.
> We as a society have managed to allocate so many of the “best and brightest” to either fintech wankery or placing ads in front of eyeballs. Those things have driven a load of proprietary and open source tech that helps everyone else.
Rising levels of inequality would suggest this is false.
Re: Case study: Algorithmic trading with Go
#196Earlier quoted context omitted.
Also, what's your approach to risk management? For example: 1. Do you have anything that limits the size of a single trade or position? 2. How do you measure and manage overall volatility/risk/VAR to your portfolio? 3. What kind of safeguards do you have to avoid catastrophic bugs? (For reference, see Knight capital and how a single bug brought down the entire company: https://www.henricodolfing.com/2019/06/project-f…
Here's some simple rules. I basically just read about these and then stole the ideas. I wish I had data to back this up and it seems to be working. - No single bet can be more than 5% of all money. The small bet sizes are what really saves your bacon in that even if a few lose 10+% you're still fine overall. - I'm also limiting the amount of shares I bet and try to keep it in the low hundreds so that I get really fas…
What is your 'win' rate? (Percentage of trades that make money as a fraction of overall trades)?
How many trades does your system make on average in a given day?
Do you hold positions overnight?
Re: Case study: Algorithmic trading with Go
#197Earlier quoted context omitted.
"they are the more straightforward part to build" More straightforward, heh, sure. But still damnably complicated. Which just goes to show how much money and how much engineering talent is invested in this world that these things are so taken for granted.
So many intelligent people applied for something that has no value whatsoever to humanity regardless of how you look at it.
Re: Case study: Algorithmic trading with Go
#198Earlier 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…
> 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,…
Re: Case study: Algorithmic trading with Go
#199Earlier quoted context omitted.
Seems more pointless than crypto to be honest.
Nonsense - what could be more beneficial to society than providing imaginary "liquidity" by interposing yourself between legitimate buyers and sellers? It's a bit like stock brokers - and why wouldn't we want stock brokers to operate at drastically faster-than-human timescales, because we all know the value of a company changes every nanosecond! And "flash crashes" create opportunities for investors to make huge amou…
Now when I say the same thing about index funds people get all huffy
Re: Case study: Algorithmic trading with Go
#200Earlier quoted context omitted.
Hey, thanks. Yeah, I agree with you. That's an oversight on my end. I'll tell you here though. I'm just using go routines and channels to talk between them and then a giant mutex for locking. That's basically it. So, as new data comes in, it builds aggregates (tick based candlesticks) as needed, this then triggers the the BUY logic loop on that new data, if something is detected, that triggers a IB API order. It is d…
Does it work synchronously or asynchronously? For example, if you integrate WebSockets then you could act as soon as you get new data. If it works synchronously then you regularly request data (say, every second) and then act. If you process many positions and then choose top 5 candidates then do you choose one of them for buying or you can allocate resources between them (depending on some score)?
That logic is happening for 5500+ stocks all in real-time which is pretty insane. But, it works really really well. Go is amazing. At market open and close there is like 60k+ events per seconds across trades and quotes. So, that loop is processing like 60k events at times, and building each stock out, and then looking to see if we should buy/sell.