DEV Community

Igor Ganapolsky
Igor Ganapolsky

Posted on • Originally published at igorganapolsky.github.io

AI Trading: Day 86/90 — 7 Lessons (January 22, 2026)

Day 86/90 — Thursday, January 22, 2026

6 critical issues hit today. The worst: Position Accumulation Bug - Iron Condor Trader. Here's the full breakdown.

7 lessons learned today (6 critical, 0 high priority)

Position Accumulation Bug - Iron Condor Trader

iron_condor_trader.py was placing partial fills that accumulated to 8 contracts instead of max 4.

Cumulative Position Risk Bypass - Individual Trades Accum...

  1. Trade gateway _check_position_size_risk() only checked individual trade risk

Crisis Mode Failure Analysis - Jan 22, 2026

The AI trading system failed catastrophically over three days (Jan 20-22, 2026):

Alpaca API Bug - Close Position Treated as Opening Cash-S...

When attempting to SELL TO CLOSE a LONG put position, Alpaca API treats it as OPENING a new short position (cash-secured put), requiring $113,000 buying power:

Use close position() API for Closing Orphan Positions

When closing options positions via Alpaca API, use client.close_position(symbol) instead of client.submit_order(MarketOrderRequest(...)). The close_position() method automatically handles:


Follow our journey: AI Trading System on GitHub | Blog

Top comments (0)