4 ms·
I’m a terrible trader, and had no shame in admitting it. The moment I saw red, I panicked and sold. If I had open orders on the market, I couldn’t concentrate o
by jw1224 6y ago
I’m a terrible trader, and had no shame in admitting it. The moment I saw red, I panicked and sold. If I had open orders on the market, I couldn’t concentrate on anything else. I found trading to be all-consuming, exhausting, and completely demoralising.
But I also couldn’t bear to just let my hard-earned savings sit there, wasting away. A cup of coffee cost more than I was earning in annual interest!
About 3 months ago, it suddenly dawned on me... If I know I’m too emotionally volatile to trade effectively, why not get an algorithm to do it for me? I don’t know much about the stock market, but I’m good with statistics and can write code. Why should the hedge funds have all the fun?
I spent a month researching technical indicators and quantitative analysis, then another few weeks building my automated trading system from scratch. I put it on a server last week, and it’s been chugging along quietly, 24/7, ever since.
I don’t have to get involved in any way — it picks stocks automatically, A/B tests different algorithms against one another, and manages its own budgets. I just set it and forget it.
The only time I hear from it is when it sends me a Slack notification — with moneybags emoji, of course — whenever it makes a profitable trade.
Honestly, it’s been the most fun I’ve had on a personal project for years. It’s taught me lots, kept me busy during lockdown, and might one day provide a little extra cash. We’ll see!
- chrchang523 6y agoI assume you've heard of index funds; out of curiosity, what makes that investing choice unappealing to you?
- optimiz3 6y agoCliche but the best investment is in yourself. The parents project was a form of this. Doesn't mean they don't also have a percent of portfolio in other asset classes like indexes.
- jw1224 6y agoOh yeah, I'm well aware there are probably far more sensible ways to invest my money. This sort of thing just really suits my personality type — it was an exciting idea, and I just ran with it. I have my own business too, which needs investment every so often, so that'll always be the first priority for me.
- bredren 6y agoSounds like a fun project. How much rope does your bot have? What did you write it in / what’s the deployed stack?
- jw1224 6y agoI was really hoping nobody would ask me about the stack... because... it's PHP! Hahahaha! Most hobbyists write these things in Python, which I did give some serious consideration to learning... But I know what I'm like — my interest in anything is very short-lived (ADHD!), so I wanted to get a prototype built with a language I'm already proficient in. It's built with Laravel 8, and hosted on DigitalOcean. It stores and analyses market data in PostgreSQL, and uses Redis for queue management with Laravel Horizon. Would you believe PHP has its own TA-Lib implementation? https://www.php.net/manual/en/intro.trader.php https://www.php.net/manual/en/intro.trader.php — that was a nice surprise to discover. This gave me a good head-start on running actual analysis, although my algorithms are pretty simple and only use a few basic indicators to filter out any potential mistakes. There's no web UI (maybe one day), but it has some simple controls and and reports available through an SSH console. Ideally I won't need to interact with it at all, so Slack notifications keep me informed when anything interesting happens. I wrote a custom backtester, which runs through the console. There's no pretty graphs or anything, it's basic but makes it extremely easy to experiment with strategy variations on historical data. I ran it for a week making the smallest trades possible (~$10) whilst I ironed out some kinks and made sure things were working smoothly. It's now week 3, and I'm trusting it with $1500. I'll keep increasing that over time as I make improvements. Individual trades vary from ~$50 to ~$250, depending on algorithmic confidence and profit/loss from the previous day's trading (those margins are pretty meaningless at this level, but it's built to scale nicely in future).
- IIAOPSW 6y agoI've done something similar but the actual moves are still entered manually. What API do you use that lets you do algorithmic trades?
- gerritsg 6y agoAlso curious about the platform you're using, because I was kind of dissuaded from using Alpaca when I learned about the good old pattern day trading rule. Are you trading with > 25k in whatever platform you use, or do you have a limited number of trades you execute to stay away from PDT?
- Ntrails 6y agoActive investing is a negative sum game. Even if your broker is not directly charging you comms, they exist. So, the average trade is a loss. However, I don't even think that is the main insight here. No single trade is really profitable. There is one conceptual entity, your portfolio. There is a benchmark (An index representing your investing universe). As a straw man: Making 20% on every trade when you always have half your portfolio in cash feels good but is not a useful perspective. Don't focus on the micro, analyse overall performance dispassionately vs an equivalent level of risk and discover whether you actually have an edge. Good luck!
- MajorSauce 6y agoI recently made a bot to find profitable cryptocurrency pairs loops and while most exchanges already have dozens of users doing exactly the same thing (if the exchange itself is not doing it), I really liked the motivation it gave me to start a new coding project in a language I did not touch for some time (C#) instead of my traditional python approach. You post just inspired me to make something similar (whether stocks or crypto) and I wanted to thank you for that. I too see trading as pretty stressful and demoralising (even for trivial amounts) and implementing my own stocks/crypto manager could transform those failed trades into "that's interesting" moments.
- gerritsg 6y agoAre you having much success with it? What platform are you using? I've wanted to do something similar in Rust. Or if your bot is just _finding_ the pairs now but not trading, is there a platform you plan to use?
- MajorSauce 6y agoSo far the only exchanges where I found some opportunities are the ones that do have a public API, probably because there is less competition on those. For example, I have yet to find a single profitable pair loop on Binance, despite parsing their WebSocket feed. But on exchanges that implement anti-scripts, it is not uncommon to have pair loops with a ±1% profit after fees. The hassle is to implement trading with tools like Selenium to proceed with the trade.
- benibela 6y agoAre you going to make it open-source? I need something like that. I started trading this month, and the first thing I did was putting $1000 on AMC shares which then lost half their value :/
- atleta 6y agoIf a lot of people will start running it, it will lose profitability (assuming it is profitable now). The same software acting on the same set of signals means the signals will be cleared pretty quickly.
- benibela 6y agoThis guy said TA has no meaning, it only works because other people think it works: https://news.ycombinator.com/item?id=26286655 https://news.ycombinator.com/item?id=26286655 In that sense, the more people would use the software, the more profitable it becomes. The software thinks the price of some stock will increase, so it buys the stock. If more people use the software, more will buy the stock, so the price rise even faster
- atleta 6y agoYep, I almost wanted to add that as well. TA doesn't work and I think this has been (kind of) proven. Though if you look into it just superficially, you'll see that it's a total sham/self deception. However, it does not mean that the system we're talking about would create a positive feedback loop. (And, if it would, that would probably also be bad and just waiting to be exploited by some other players.) Because even if TA is fake, IF their system works they somehow have an algorithm that works that may to some extent be based on some indicators. (BTW, looking at the comment it's not clear that they simply use TA. The guy just said "spent a month researching technical indicators and quantitative analysis,".) The thing is that, based on what they said is that it's some tunable algorithm that tries to extract some information. And even if TA worked (which I don't think it does) acting on those formations would still erase the signal or the usefullness of the signal, because when someone uses TA looking for these random shapes, they still try to predict the future and act ahead of the others.