<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: IO</title>
    <description>The latest articles on Forem by IO (@2144e0dfabcfd).</description>
    <link>https://forem.com/2144e0dfabcfd</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3822625%2F70e357f9-ac80-4fd3-bd6d-b433458775e4.jpg</url>
      <title>Forem: IO</title>
      <link>https://forem.com/2144e0dfabcfd</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/2144e0dfabcfd"/>
    <language>en</language>
    <item>
      <title>"Just Automate It" — When an Engineer Builds a Trading Bot</title>
      <dc:creator>IO</dc:creator>
      <pubDate>Sat, 14 Mar 2026 09:14:52 +0000</pubDate>
      <link>https://forem.com/2144e0dfabcfd/just-automate-it-when-an-engineer-builds-a-trading-bot-5g9o</link>
      <guid>https://forem.com/2144e0dfabcfd/just-automate-it-when-an-engineer-builds-a-trading-bot-5g9o</guid>
      <description>&lt;h1&gt;
  
  
  I Automated My Investments. Then Reality Hit.
&lt;/h1&gt;

&lt;p&gt;When I first got serious about this, my brain immediately went to the place every software engineer's brain goes: if the rules are clear, it can be automated.&lt;/p&gt;

&lt;p&gt;That's genuinely how I think about everything. If a process has defined inputs, defined outputs, and a logic chain connecting them, it's a candidate for code. Investing felt like it should qualify. Buy low, sell high. Use indicators to tell you when to buy and when to sell. Repeat. Where exactly is the human judgment required here?&lt;/p&gt;

&lt;p&gt;Turns out I was asking the wrong question, but I didn't know that yet.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Golden Cross and Why It Seemed Obvious
&lt;/h2&gt;

&lt;p&gt;I started reading about technical analysis. Not books, just the usual rabbit hole. Wikipedia, Investopedia, a few StackOverflow threads where someone asked a similar question. The concepts that kept surfacing were moving averages.&lt;/p&gt;

&lt;p&gt;The idea is simple. A moving average smooths out the noise in a price series by averaging closing prices over some window. The 50-day simple moving average of SPY on any given day is just the average closing price over the previous 50 days. As new days come in, the window slides forward. That's all it is.&lt;/p&gt;

&lt;p&gt;The interesting part is what happens when you put two of them together. A short-period moving average (say, 50 days) and a long-period one (200 days). The short one reacts faster to recent price changes. The long one reacts slowly. When the fast line crosses above the slow line, that's called a golden cross. Supposedly bullish. When it crosses below, that's a death cross. Supposedly bearish.&lt;/p&gt;

&lt;p&gt;The logic felt clean to me. You're essentially comparing recent momentum against longer-term momentum. If short-term prices are rising faster than the long-term average, things might be accelerating. That made intuitive sense.&lt;/p&gt;

&lt;p&gt;I also read about EMA, the exponential moving average, which weights recent prices more heavily instead of treating all days in the window equally. The formula is recursive. Each day's EMA is a blend of the current price and yesterday's EMA, controlled by a smoothing factor based on the window size. More responsive than SMA, potentially less lag on signals. I made a mental note to try both.&lt;/p&gt;

&lt;p&gt;And then I found RSI, the relative strength index. The math there is a bit more involved but the idea is elegant. You look at the average gains versus average losses over a 14-day window, compute a ratio, and scale it to a 0-100 range. Values above 70 are considered "overbought." Below 30 is "oversold." The theory is that extreme values mean a reversal is coming.&lt;/p&gt;

&lt;p&gt;I immediately thought about using RSI as a filter. Only act on golden cross signals if RSI isn't already overbought. That felt like I was being smart about it. Adding constraints. Reducing false positives.&lt;/p&gt;




&lt;h2&gt;
  
  
  Building the First Bot
&lt;/h2&gt;

&lt;p&gt;I pulled historical data using yfinance. If you haven't used it, it's a Python library that pulls from Yahoo Finance. Free, easy, works fine for daily OHLCV data going back decades. I grabbed SPY going back to 2000. That gave me two decades of data including the dot-com crash, the 2008 housing crisis, and the 2020 COVID drop.&lt;/p&gt;

&lt;p&gt;I used pandas for the data manipulation. Computing rolling means is literally a one-liner in pandas. The SMA is just &lt;code&gt;df['close'].rolling(window=50).mean()&lt;/code&gt;. For EMA there's a built-in &lt;code&gt;.ewm()&lt;/code&gt; method. These are the easy parts.&lt;/p&gt;

&lt;p&gt;The backtesting logic itself isn't much more complex. You iterate through the data chronologically. At each row, you check: did the 50-day cross above the 200-day yesterday? If yes, buy. Did it cross below? If yes, sell. At the end you compare what that strategy would have returned versus just buying and holding SPY the whole time.&lt;/p&gt;

&lt;p&gt;My first pass used SMA crossovers, no RSI filter. I ran it and stared at the results.&lt;/p&gt;

&lt;p&gt;The backtest showed something like 340% total return over 20 years. Buy and hold over the same period was around 280%. I was beating the market.&lt;/p&gt;

&lt;p&gt;I remember sitting there in my apartment at maybe 11pm on a Tuesday, running the numbers again because I didn't trust them. They kept coming back the same. I added the RSI filter. The drawdowns got smaller. The return stayed competitive. Sharpe ratio went up.&lt;/p&gt;

&lt;p&gt;This is the thing about backtesting. When it works, it feels like you discovered something real. You can see every trade laid out chronologically. There's that one trade in March 2009 where the strategy got you back in near the bottom. There's that clean exit before the 2020 crash. The chart of your portfolio equity curves nicely upward. You can point to specific moments and say, look, the signal worked here.&lt;/p&gt;

&lt;p&gt;It genuinely looks like evidence. That's what makes it so dangerous.&lt;/p&gt;




&lt;h2&gt;
  
  
  What Backtesting Actually Is
&lt;/h2&gt;

&lt;p&gt;I'll be honest about what I did and didn't understand at this point.&lt;/p&gt;

&lt;p&gt;I understood that backtesting was simulated. Obviously the trades didn't really happen. But I thought that if the rules were deterministic and applied consistently to historical data, the results would be predictive of future results, assuming the underlying market dynamics didn't fundamentally change.&lt;/p&gt;

&lt;p&gt;That sounds reasonable. It's mostly wrong, for a few reasons I hadn't fully appreciated.&lt;/p&gt;

&lt;p&gt;The big one is lookahead bias. It's surprisingly easy to accidentally let future information contaminate past decisions in your backtest. For example, if you compute an indicator using the full dataset and then simulate trades, you've cheated without meaning to. I was careful about this one because I'd read about it.&lt;/p&gt;

&lt;p&gt;The one I missed was overfitting. When you backtest a strategy and then tweak it to improve the results, then backtest again, then tweak again, you're fitting the strategy to the historical noise. The 14-day RSI window, the 50/200-day crossover. Why 50 and 200? Why not 45 and 180? Why not 60 and 250? I tried a few combinations and picked the ones that looked best. I didn't fully register that I was doing this. I thought I was just validating that the classic parameters worked. But the act of checking was itself a form of fitting.&lt;/p&gt;

&lt;p&gt;There's also transaction costs. In my first backtest I didn't account for them at all. When I added a $5 commission per trade and a couple basis points of slippage, the edge shrank. Still positive, still convincing, but smaller.&lt;/p&gt;

&lt;p&gt;And survivorship bias doesn't apply to SPY directly, but if I'd been testing on individual stocks I'd have been pulling data only for stocks that still existed. The ones that went to zero aren't in the historical dataset. Your backtests automatically avoid them.&lt;/p&gt;

&lt;p&gt;I understood most of these things intellectually. I thought I'd been careful. I had no idea what I was walking into.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Decision to Go Live
&lt;/h2&gt;

&lt;p&gt;I set a budget. Not my whole portfolio, just a portion I could afford to lose. This felt like responsible risk management. I told myself it was tuition.&lt;/p&gt;

&lt;p&gt;I connected my broker's API, which is straightforward with alpaca-trade-api if you're using Alpaca for US equities. They have a paper trading environment where you can run your bot with fake money against real market conditions. I did about two weeks of paper trading. Everything looked fine.&lt;/p&gt;

&lt;p&gt;Then I pushed the go-live commit.&lt;/p&gt;

&lt;p&gt;I remember watching the first real trade execute. SPY, market order, real money. It felt different from looking at backtest output in a pandas dataframe. There was a small adrenaline hit I hadn't expected. I'm a pretty calm person normally. I wasn't calm.&lt;/p&gt;

&lt;p&gt;The bot ran on a cron job on a cheap DigitalOcean droplet. Every day after close it would pull the latest data, recompute the indicators, check for crossover signals, and place orders if needed. I'd get a Slack notification when a trade executed. I kept checking Slack.&lt;/p&gt;

&lt;p&gt;At that point I genuinely believed I'd done the work. The code was clean, the logic was sound, the backtest results were strong. The gap between that confidence and what was about to happen was pretty wide.&lt;/p&gt;




&lt;p&gt;The first few weeks were fine. Not great, not bad. The market was doing its thing and my bot was doing its thing and they weren't interacting in any dramatic way. That was actually the most misleading part. Nothing obviously wrong.&lt;/p&gt;

&lt;p&gt;Then the choppiness started.&lt;/p&gt;




&lt;p&gt;Next: I'll walk through what actually happened when the strategy started generating signals in a sideways market. The whipsaws, the false signals, and the moment I opened my brokerage statement and did the math on what the fees were adding up to. Spoiler: the backtest did not mention any of this.&lt;/p&gt;

</description>
      <category>investment</category>
      <category>automation</category>
      <category>engineering</category>
      <category>python</category>
    </item>
    <item>
      <title>Side Hustle Hell — The Engineer Who Tried Everything</title>
      <dc:creator>IO</dc:creator>
      <pubDate>Fri, 13 Mar 2026 16:33:10 +0000</pubDate>
      <link>https://forem.com/2144e0dfabcfd/side-hustle-hell-the-engineer-who-tried-everything-1nhc</link>
      <guid>https://forem.com/2144e0dfabcfd/side-hustle-hell-the-engineer-who-tried-everything-1nhc</guid>
      <description>&lt;h1&gt;
  
  
  I Spent Two Years Trying to Make Money on the Side. Here's How Badly I Failed.
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fadmryssr8qgs2pd5kyzo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fadmryssr8qgs2pd5kyzo.png" alt=" " width="800" height="591"&gt;&lt;/a&gt;&lt;br&gt;
It's 11pm on a Tuesday. I have Binance open in one tab, a half-finished pull request in another, and a Slack notification I've been ignoring for forty minutes. My portfolio is down six percent. I have standup in eight hours.&lt;/p&gt;

&lt;p&gt;This was my life for most of 2021.&lt;/p&gt;




&lt;p&gt;I make decent money as a software engineer. Not "quit your job and move to Bali" money, but good money. The kind where you're not stressed about rent but you're also not building any real wealth, because San Francisco has a way of consuming paychecks that would feel enormous anywhere else. I was maxing my 401k and throwing whatever was left into a Vanguard index fund because that's what the Bogleheads subreddit told me to do.&lt;/p&gt;

&lt;p&gt;That was fine. Responsible, even. But fine wasn't what I was after.&lt;/p&gt;

&lt;p&gt;I wanted something that scaled. Something where I put in the work once and it kept paying. The engineer brain does this thing where it looks at every problem as a system to be optimized, and I kept looking at my income and thinking: there's only one input here. Me. That's a single point of failure. What if I get sick? What if the job market tanks? I needed another stream.&lt;/p&gt;

&lt;p&gt;So I started trying things.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Forex Phase
&lt;/h2&gt;

&lt;p&gt;A guy in my company's random Slack channel posted about how he was making an extra two grand a month trading forex. I asked him about it, he sent me some YouTube links, and three weeks later I had a demo account on MetaTrader 4 and I was convinced I was about to become a currency trader.&lt;/p&gt;

&lt;p&gt;I learned what pips were. I learned about the spread. I watched probably fifteen hours of content about support and resistance levels and I drew lines on charts with complete confidence that I understood what they meant.&lt;/p&gt;

&lt;p&gt;Then I opened a real account with five hundred dollars.&lt;/p&gt;

&lt;p&gt;I lost a hundred and forty bucks in the first week. Not because the market was crazy. Because I had a full-time job and I was trying to day trade currencies, which is insane. The yen moves when Tokyo opens. The dollar moves during the US session. The euro has its own thing happening in the morning before I'm even out of bed. Forex doesn't care about your sprint planning meeting. It just keeps moving, and if you're not watching it, you're losing.&lt;/p&gt;

&lt;p&gt;I closed the account after about six weeks.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Crypto Phase
&lt;/h2&gt;

&lt;p&gt;This one hurts more to write about because I actually believed in it, not just as a trade but as a technology. I still kind of do. But there's a difference between believing in a technology and being a competent trader of that technology, and I confused those two things badly.&lt;/p&gt;

&lt;p&gt;2021 was a wild time to get into crypto. Everything was going up and then everything was going down and then things I'd never heard of were going up a thousand percent and I was reading about Solana at three in the morning like that was a normal thing to do.&lt;/p&gt;

&lt;p&gt;I bought ETH, some SOL, a little MATIC. I had a rough thesis about layer-two scaling being the future. The thesis wasn't even wrong, honestly. But I had no position sizing, no exit strategy, no risk management at all. I was just... holding things and hoping. When stuff dropped forty percent in May of that year I panic-sold half my position at the worst possible time, which is the most human thing you can do and the most expensive.&lt;/p&gt;

&lt;p&gt;The part that really got me was the opportunity cost. I spent probably four hours a week reading crypto Twitter, which is four hours I'll never get back, and I made essentially nothing for it.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Affiliate Marketing Detour
&lt;/h2&gt;

&lt;p&gt;I'm not going to spend much time here because it's embarrassing. I built a personal finance blog. I wrote maybe eight articles. I spent two weekends getting the SEO setup right because that's the kind of thing engineers do: we perfect the infrastructure and never ship the content. The site got eleven organic visitors in its entire existence, ten of which were probably me checking if Google had indexed it yet.&lt;/p&gt;

&lt;p&gt;The fundamental problem with affiliate marketing as a side project is that it takes eighteen months to see results, minimum, and that's if you're putting in real hours. I was putting in like three hours a week while exhausted. Content marketing rewards consistency and volume. I am consistent and high-volume at my job. I have almost nothing left after that.&lt;/p&gt;




&lt;p&gt;So by late 2022 I'm batting zero on the side income thing. And I'm tired. Not just sleep-tired, though I was that too. Tired of starting things and not finishing them. Tired of the mental overhead. Tired of feeling like I was hustling and going nowhere.&lt;/p&gt;

&lt;p&gt;I almost just gave up and accepted that index funds were enough. Maybe they are, for some definition of enough.&lt;/p&gt;

&lt;p&gt;But I kept coming back to this one thought. All of my failed attempts had the same failure mode. They required my active attention during market hours, or they required consistent creative output, or they required me to be present in a way that competed directly with my job. The moment I got slammed at work, the side thing died. Every time.&lt;/p&gt;

&lt;p&gt;What if that constraint was the actual problem to solve?&lt;/p&gt;

&lt;p&gt;I'm an engineer. I build systems that run without me. I've written cron jobs that have been running without a single human touch for four years. I've built data pipelines that process millions of events while I'm asleep. The thing I'm actually good at, professionally, is making things that run automatically.&lt;/p&gt;

&lt;p&gt;Why was I trying to do a job that required me to be awake and alert and watching a screen? That's not a system. That's just a second job. A worse job, with no salary and no benefits.&lt;/p&gt;

&lt;p&gt;Investing, though. Investing has this property that most things don't: the underlying action, buying and selling financial instruments, is fully automatable. A broker with an API doesn't care if the order came from a human clicking buttons or a Python script running on a VPS at 4am. The execution is the same.&lt;/p&gt;

&lt;p&gt;I'd vaguely heard about algorithmic trading. Quant funds, HFT, all that. I'd always assumed it was out of reach for a regular person. You needed Bloomberg terminals and PhDs and co-location servers next to the NYSE. That whole world seemed sealed off.&lt;/p&gt;

&lt;p&gt;Then I started actually looking into it, and I realized that landscape had changed a lot. (Last time I use that word, I promise.) Brokers like Interactive Brokers and Alpaca had opened up real API access to retail traders. There were Python libraries. There were backtesting frameworks. There was an entire ecosystem of people building exactly the kind of automated systems I was imagining.&lt;/p&gt;

&lt;p&gt;It wasn't easy. I want to be clear about that upfront because this is where a lot of these stories turn into hype. I'm not going to tell you I found a magic indicator or figured out some trick the institutions don't know. The stuff I eventually built took months to work, failed in ways I didn't expect, and still has problems I'm actively dealing with.&lt;/p&gt;

&lt;p&gt;But the basic idea held up. If I built something solid, it could run while I was in meetings. It could place orders while I was asleep. My attention wasn't the limiting input anymore.&lt;/p&gt;

&lt;p&gt;That realization was enough to make me actually focus for once.&lt;/p&gt;




&lt;p&gt;I remember the specific night I decided to take it seriously. It was a Saturday in November, I think. I had a coffee that had gone cold, I was reading the Alpaca docs at my kitchen table, and I got this feeling I sometimes get at work when I'm looking at a gnarly problem and I can suddenly see the shape of the solution. Not the whole thing. Just the shape.&lt;/p&gt;

&lt;p&gt;That's enough. That's all you need to start.&lt;/p&gt;

&lt;p&gt;My roommate walked through and asked what I was working on. I told him I was maybe going to try automated trading. He said "isn't that what caused the 2010 flash crash" and went to bed.&lt;/p&gt;

&lt;p&gt;He wasn't wrong, technically. But I wasn't building anything that was going to move markets. I was trying to build something that would let me not check my phone at 2pm during a code review.&lt;/p&gt;

&lt;p&gt;Small ambitions. Good enough.&lt;/p&gt;




&lt;p&gt;Next: I'll get into what automated trading actually is for someone without a quant background. Not the theory. The practical stuff. What a strategy even looks like when you write it in Python, why backtesting is both essential and deeply misleading, and the first mistake I made that cost me real money.&lt;/p&gt;

</description>
      <category>investment</category>
      <category>automation</category>
      <category>engineering</category>
      <category>python</category>
    </item>
  </channel>
</rss>
