1,902 Errors Later: The Buying Power Bug
MM grows up with risk controls, buying power gating & volatility sizing
Lots of lessons, implemented immediately
The positions yesterday then:
Let’s focus on the negatives (Why break the habit of a lifetime? ) MATV was the bombing position I start the video with
Two problems here:
The buy confidence threshold for this analyst was too low.
Position size was equal to the others, even though this one is more volatile.
Related, buying power bugs meant that other (good) positions didn’t open.
Explanation from my AI friend:
Today the system opened three large positions (TS, MATV, TALK) totaling ~$186K in rapid succession at market open, which drove the Reg-T buying power down to $0 while the daytrading buying power still showed ~$51K. Because the sizing code was reading the wrong buying power field (daytrading instead of Reg-T), it sized two more positions (TFPM and FTI) at $51K each — but Alpaca rejected every order since Reg-T was actually zero. Worse, the insufficient buying power check was advisory-only (just a warning log, didn’t block the order), and there was no retry limit, so the system hammered Alpaca with doomed buy orders every 10 seconds for over 4 hours, generating 1,902 error log entries. FTI eventually squeezed through around 9:51, and TFPM finally opened at 12:11 after MATV’s stop-loss freed up buying power — but by then TFPM’s trade value had shrunk from $51K to $27.73 (1 share). The fixes use the correct Reg-T buying power for sizing, block orders when buying power is insufficient instead of just warning, and give up on positions that can’t open after 30 minutes.
All deployed.
Sizing & Volatility
My friend Feederico works in Real Finance™ and warned me (from day one) that volatility should always be factored into position size.
Like so many times in life, I had to learn my preferred way, the hard way.
Currently, volatile and calm stocks get the same dollar exposure, meaning a single bad earnings reaction on a volatile name could cause an outsized loss relative to the rest of the portfolio i.e. what happened yesterday.
The system added volatility metrics (ATR, historical volatility, and average earnings move) then simulated yesterday’s positions. The MATV position was cut from from $62k to $16k, reducing its loss from -$6,035 to -$1,534 and improving the day’s total P&L from -$3,259 to -$455. Still a loss but a mild one.
Yesterday with volatility-adjusted sizing
Magic.
Let me know if any more feedback or ideas, whether on MM or this here content (also is my mic loud enough??)
There were no buys today but that’s ok, I’m happier with these upgrades done.
Let’s hope for more luck next week.





