7 ms·
Ask HN: Is anyone building automated long-term investing software?
Every now and then I see a post for automated HFT or similar trading bots, but these are usually research projects to pack a resume. This got me thinking: is anyone working on the opposite: automated long-term trading bots?
It should be designed to pick and hold a position for >12 months, use alternative data sources, and be open/hackable.
- forestcait 2y ago[dead]
- dan-robertson 2y agoDon’t people usually just buy etfs or funds for this sort of thing?
- ivanvanderbyl 2y agoI’m looking for something a bit more specialised, ETFs being the absolute far end of automated.
- malfist 2y agoSchwab has "slices" that act like an ETF that you decide the composition of
- fastily 2y agoThat’s what I do: VTSAX and chill. I set it and forget it and it has performed very well for me over the years. Also worth noting most institutional investors struggle to outperform this fund over extended periods of time
- TheAlchemist 2y agoI think brokerages have this kind of things ? I saw ads from Revolut recently with something similar. You are talking about 2 different things in your post though, I believe: 1 - automating long term investmenets (this is the Revolut thing) - ie, setup an amount you set for investment every month - and it automatically buys whatever you want 2 - a research tool ? (not a bot though) Or, it just hit me while writing, are you talking about quantitatives strategies ?? If yes, then yeah, half of Wall Street was working on that ! There were some open source attempts, I think the best known was Quantopian - look it up.
- al_borland 2y agoThere are sites like WealthFront. It's designed to act as an automated fund manager, from what I understand. Buying and selling as needed to take advantage of things like tax loss harvesting. I haven't looked at it in a while, but it was promoted heavily on some podcasts I listened to years ago when it came out.
- ivanvanderbyl 2y agoI don’t live in America so WealthFront and other robo-advisors aren’t available to me
- Rastonbury 2y agoIf you're willing to go to a robo just look at the funds/prospectus pages of robofunds, look at the holdings and rebalance every so often as needed
- jqpabc123 2y agoIf you actually succeeded at this, would you ever tell anyone? Why?
- ivanvanderbyl 2y agoMy theory on this is: algo trading on short term, if it works you don’t tell anyone because by trading on the opportunity they decrease the available opportunity to you (efficient market, chaotic systems etc). Long-term trading doesn’t work like this, in fact you want more people to identify the opportunity and buy to improve your position in the long term, but generally you should be investing on alternative signals not technical analysis.
- jqpabc123 2y agoIn other words --- what you and I think isn't nearly as significant as what others are persuaded to think. For example, I personally think TSLA is way, way, way over bought. The reasons for this are many and varied but still largely irrelevant. My opinion didn't stop an "analyst" from issuing a buy recommendation yesterday with a target price of $265. Maybe this "analyst" has clear, logical reasoning with supporting computer analysis --- or maybe his grandma is just heavily bought into TSLA. In any case, the stock jumped 2.5% yesterday. Bottom line --- everybody and his brother is using software. But opinion and psychology remain significant factors that defy computerization. The market can still stay irrational longer than you can stay solvent.
- muzani 2y agoFor one, if you wanted to make $20k per month, you'd need at least $200k invested. Oh wait, we're talking long term, not trading. In that case, you'll make about $20k per year. So you'd want $240k per year to pay that kind of salary, meaning you need around $2.4m in the bank. It's a lot easier to raise that money by selling the tool than it would by trading the stocks. It also doesn't hurt to share knowledge. Very often you can compare your notes to another. In fact, if you had an algorithm that picked winning stocks, just add a little delay to everyone else's bots. Your bot buys it first, then some whale buys it and pumps your stock.
- toomuchtodo 2y agohttps://www.bogleheads.org/wiki/Target_date_funds https://www.bogleheads.org/wiki/Target_date_funds
- malfist 2y agoSeriously. Target funds if you're lazy or a three fund portfolio you rebalance every couple of years. Don't need software for that
- toomuchtodo 2y agoShades of Parkinson's Law [1], along with the idea that more effort is more valuable than less effort. Sometimes, simplicity is the ultimate sophistication. I bet we would could reduce US capital market trading to four days a week and still arrive at a similar outcome wrt efficient price discovery and liquidity windows, tangentially [2]. [1] https://en.wikipedia.org/wiki/Parkinson%27s_law https://en.wikipedia.org/wiki/Parkinson%27s_law [2] https://www.bloomberg.com/opinion/articles/2021-10-06/why-not-trade-all-night https://www.bloomberg.com/opinion/articles/2021-10-06/why-no... | https://archive.today/Ykapv https://archive.today/Ykapv
- tecoholic 2y agoIn Indian markets, I think Shyam does this https://stockviz.biz/ https://stockviz.biz/ Edit: Ah, I just realised you might have means software part more than the financial part. Shyam does publish R code of various things on GitHub
- wavemode 2y agoLong term investing means buy and hold. And hold and hold and hold. A system that does that for you would not really be a trading bot per se, it would just be a general algorithm for "picking stocks". Automating the actual purchasing is probably unnecessary. If you find one, let us know! Most investors in the world are searching for the such a thing.
- chii 2y agoAnd the easiest of such algorithms - ala, just buy a bit of everything - seems to be the winner imho. AKA, indexc investing.
- stouset 2y agoAnd luckily, this involves roughly zero time and effort. And carries little to no risk of fucking it up enough that you lose everything (see: margin, selling short, day trading, crypto).
- seeknotfind 2y agoI guess it's time to tell the story online? When I graduated college, I spent 3 months as a programmer with my econ friend trying to build exactly this. I started off creating a system to paper trade stocks retroactively. So you imagine you go back in time and pretend it's January 1st, 1982 then have an algorithm look at the stocks then, then move it a day forward, and let it trade for the past 40 years and see how it does. We tried linear models, SVMs, neural networks, RNNs, ensembles, genetic algorithms, anything with stock data, news sentiment data, classic quant structures, and everything in-between. Basically, 3 solid months of coding before I started working. Anyway, I found out a lot of stuff the hard way, because I didn't have an econ degree. First off, you try enough methods, you end up p hacking or hill climbing the past anyway, and it's no good. Second off, historical clean data is hard to get. It may or may not have splits in it or other things, so you may inadvertantly supply information from the future when playing back from the past. It's hard to get this right. Third off, for many of the models we used, they were almost always competitive in the 80s (even a linear regression), but in the oughts or 2010's, they stopped being competitive. We thought computer based trading was becoming more competitive in hedge funds. Fourth, simple models tended to work better. So for instance we may have trained the model on data from 70s-80s, then starting in the 80s, we did online (continuous) training as we moved the model forward in time. There's just not enough data. You can train on all historical stocks or all stocks or related data streams in the industry up to that point, but I think we probably didn't have enough data and the market is competitive. Fifth, I wish I read a Random Walk Down Wall Street earlier, or all of Taleb's stuff. These are books that have deep mistrust of quants. Sixth, I think to be competitive, you need to have money in the game, many heuristics, and industry experience. Big firms have this and equipment, but it's hard to get in as an individual. Seventh, I put several hundred hours into this project and learned a bunch about machine learning and economics. In every way I loved the experience, and I'd encourage you to try it. Probably I'm a n00b here, but I hope some of my notes can help you.
- bionsystem 2y agoI have this idea that we only have one universe of historical financial data, and it is only 500 years long, which is ridiculously small. So backtesting and drawing conclusions is highly overrated. Another thing as you said is that it's hard to get quality data. For example most databases don't include price history for bankrupt companies (or miss quite a bunch), which makes some quantitative strategies like focusing on low PE and PB for example, completely bogus. Which is sad because most books will actually tell you to do that, without ever talking about how many of those backtests lack companies with -100% return in their virtual portfolios. Those tend to be low PE companies that the market consider risky, and it was right, but because they disappeared, the strategies outperform because they ignore so many losers.
- abhiyerra 2y agoI wrote a scraper that downloads 10-Ks from the SEC and then built a simple analysis based on high dividends/stock buybacks and a discounted cash flows analysis. It found some pretty undervalued companies that ended up doing fairly well over the last year, but not as well as the tech stocks. As others noted the datasets are not really standardized even with the SEC Edgar data so there is a lot of massaging you have to do.
- Rastonbury 2y agoHow automated was the DCF? The math is simple but requires many assumption at multiple steps
- abhiyerra 2y agoIt was completely automated. And you are right I made some assumptions.
- defrost 2y agoIn the long term stocks and software are smoke and tissues. Actual long term investors today are looking at an additional two billion people by 2050, increased demand for food and water, and regional destability due to climate change. Long term investors today are buying land and resource access about the globe, or moving to secure such things via private contractor | mercanary armies. China has purchased one in four US pigs (the farms, the feed, the processing), the Saudis have locked in access to large quantities of US aquifers, and Eric Prince wants the US to retake Africa: https://theintercept.com/2024/02/10/erik-prince-off-leash-imperialism-colonialism/ https://theintercept.com/2024/02/10/erik-prince-off-leash-im... These are all examples of securing access to water and food resources to ensure supply into the long term. The investment payoff of is having those resources when others don't, being secure in what you need and being able to profit from what you don't in times of extreme demand.
- namaria 2y agoYeah "long term investment" is called wealth management. It's a world apart from algorithm based or retail stock trading.
- defrost 2y agoIndeed, the software I worked on here in my home state back when I was interested in long term investment is still about today, 14+ years back it was broken into parts and sold on, here's one section, now run more or less "as was" by S&P https://www.spglobal.com/marketintelligence/en/campaigns/metals-mining https://www.spglobal.com/marketintelligence/en/campaigns/met... Our clients way back when were mostly all billionaires, some personal, some corporate; between client discussions, GIS data linking, trends, etc we were able to get a line on a bunch of penny stocks that were selling then ( ~2003 ) for 2c (AU) and now trade at $20+ each. None of that came from looking at day trading, it came from deeply looking at global energy and resource demands against known and suspected sources as yet unexploited.
- muzani 2y agoThe vast majority of my bet would be on climate change. People aren't acting on it fast enough to turn it. It's been modeled very well, so you know what will happen in 2050 if things don't change. It will cause an insane amount of damage, especially in archipelagos like where I live. You can't just add more drainage and try to drain the sea. New York and Singapore are raising their shorelines, but most places just don't have this kind of terraforming capacity. Property is the easy one, but it's useful to look at things like farms along affected areas.
- cl42 2y agoI'm using LLMs to basically build "junior analysts" that monitor very niche types of companies -- think, junior mining companies, or very specific commodities futures... A lot of these spaces have tons of terrible companies and there's a lot of noise, so if you use a framework that is concrete enough, you can have LLM agents do various types of research for you, fill in the framework, and sift through the noise for you. Case in point, my framework for mining companies is here: https://emergingtrajectories.com/a/pub/mining_company_risk_framework https://emergingtrajectories.com/a/pub/mining_company_risk_f... You can see the scores here: https://emergingtrajectories.com/c/copper_mining_companies https://emergingtrajectories.com/c/copper_mining_companies "Long term" -- we'll see, I expect to hold positions for 12-24 months. For those interested, my work above is influenced by two important books: "You Can Be a Stock Market Genius Even if You're Not Too Smart" by Joel Greenblatt and "Superforecasting: The Art and Science of Prediction" by Philip Tetlock. The idea from Joel's writing is to look for less liquid or less popular asset classes (or ones that structurally can't be invested in by the pros who are smarter/better-resourced than you), and Tetlock really drills process and research for long-term forecasting.
- yzydserd 2y agoMy automated long term investing bot is a standing order to transfer money each month from my cash account to a whole market index tracker. Happy to compare my returns to yours after a decade or few.
- constantcrying 2y ago>This got me thinking: is anyone working on the opposite: automated long-term trading bots? What would be the point? HFT works because you can beat the market by being faster, I don't see how long term trading could beat the market unless you have insider information. And if you can't beat the market, there is absolutely no point in the bot, as you can trivially just buy an index fund tracking the market. Which is also what I am doing, I would never use a bot over that, as it is just additional risk.
- loveparade 2y agoThere is no reason to make a long-term trading bot because that's what ETFs and various derivatives already are. They are algorithmic assets that you can customize according to your risk preferences, and you can just buy them.
- ein0p 2y agoWhere do you get the data for such a thing? Last time I looked into this (not to trade per se, but to see if I can come up with anything clever using machine learning) the complexity of the data landscape made my head hurt. As did the cost for some of the more comprehensive options.
- akg_67 2y ago> automated long-term trading bots You don't need trading bots for long term investing or even infrequent trading. In LT investing, portfolio tracking and asset allocation/reallocation are the primary tasks. Robo-advisors were very popular almost a decade ago. Most brokerages have integrated such features now. Also, checkout M1 Finance. I started investing first with the help of spreadsheet then shell scripting and now Jupyter Notebooks and Python. Beyond LT investing portfolio tracking, majority of time I spend on short to mid-term strategy development, back-testing and implementation; portfolio hedging and leverage; and options trading. Only manual aspect is actual order placement, which takes only few minutes at best.
- GoldenMonkey 2y agoWith most trading platforms. The api is available to do the trades. Obviously, look on github.com for projects, tie-ing into the trade platform of choice. This platform, allows one to do automated trading based on your own strategy. US only traders, for now. https://www.composer.trade https://www.composer.trade If you are just doing portfolio re-balancing. Say, twice a year. You could re-balance based on each stock's risk parity. i.e. Risk parity is an approach to investment portfolio management which focuses on the allocation of risk, rather than the allocation of capital. The risk parity approach asserts that when asset allocations are adjusted to have the same level of risk, the portfolio can achieve a higher risk-adjusted return. Some Quant Resources: https://quantpedia.com https://quantpedia.com They teach a class on quant. Pretty good. Python oriented. https://quantscience.io https://quantscience.io