The setup

Since August 2026, a Raspberry Pi Zero 2 W has been running a trading bot I built. It trades stocks, ETFs and crypto through the Alpaca brokerage API, checks the market every 5 minutes, and runs 24/7 as a systemd service with a Wi-Fi watchdog so it recovers on its own.

It only trades on paper. No real money. That was a deliberate choice, and so was most of what I want to talk about here: not the part that buys, but the part that refuses to.

The stack is TypeScript, Node.js and Express on the backend, React for the dashboard, SQLite for storage and Jest for tests.

Two simple strategies

The bot is rule-based. There's no LLM and no machine learning in the signals, and I wanted it that way: every trade should be something I can explain.

Stocks and ETFs: momentum. The bot works from a fixed list of 21 symbols. It ranks them by blended trailing returns over 140, 160 and 180 days, holds the top 10, and sells a holding when it drops to rank 14. That gap between 10 and 14 keeps it from selling something the moment it slips one spot.

Crypto: SMA 20/50 crossover. A classic moving average crossover, on pairs I chose because they have low correlation with each other.

Neither strategy is new. The interesting part is everything around them.

The part that says no

Before any order reaches the broker, it has to pass risk rules that live in the code, not in my head:

  • Size caps. Every order and every position is capped as a percentage of equity.
  • Hold times. Minimum hold times keep the bot from tripping pattern day-trading rules.
  • A rank-aware stop-loss. The stop-loss respects the momentum ranking instead of fighting it.
  • A separate step to arm live trading. Switching from paper to real money is not a config flag the bot can flip. It needs its own deliberate step.

Since August 4, the bot has made 94 order attempts. Its own rules blocked 37 of them.

That number is the one I like most. A bot that does everything its signals say is easy to build. A bot that checks itself before acting is the one I'd actually trust.

Testing my own results

I built an offline backtesting tool and an analytics dashboard (equity curve, drawdown, exposure, profit per symbol), then used them to compare more than 10 strategy changes.

Most of my ideas didn't survive. I rejected 8 of them based on the results, including trailing stops and a wider list of symbols. Ideas that sounded smart on paper made things worse in the data.

Then I found a problem in my own numbers. My symbol list was picked with today's knowledge, so the backtest was quietly favoring companies I already knew had done well. When I retested on a historical S&P 100 list instead, survivorship and selection bias showed up in my results. Whether the strategy beat buy-and-hold also depended on the start date I picked.

That's why I don't lead with a return number when I talk about this project. The honest result is the testing process, not a headline figure.

What I took from it

Put the limits in code. Rules you only keep in your head get skipped the first time a trade looks exciting.

Make the dangerous switch hard to flip. Going live should take a separate, deliberate step.

Test against yourself, not just against the market. The bias I found wasn't in the strategy. It was in how I picked the data.

I write about this and my other projects on my portfolio: andresmunoz.app.

How do you test your own assumptions on side projects?

This is a personal project running on paper trading only. Nothing here is financial advice.