Quant Python: Architecting Autonomous Trading Systems

Quant Python: Architecting Autonomous Trading Systems

Day 65 — CSV Writer: Appending Fills to the Master Trade Log

Python Quant's avatar
Python Quant
Jun 28, 2026
∙ Paid

Your engine got OOM-killed at 09:31:14 mid-append to master_trade_log.csv. The last fill’s row never got its trailing newline. The next fill wrote right after it, on the same line.

What you’re building

AppendOnlyCSVWriter and its companion CorruptionQuarantine boundary. The writer serializes every append behind an asyncio.Lock, builds each row as one comp…

User's avatar

Continue reading this post for free, courtesy of Python Quant.

Or purchase a paid subscription.
© 2026 Python Quant · Privacy ∙ Terms ∙ Collection notice
Start your SubstackGet the app
Substack is the home for great culture