3 ms·
I 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 se
by jw1224 6y ago
I 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?