Data & Quant
From vibe coding and AX to AI agents, the tools I build, and real-world cases. Canonical long-form versions of my posts, gathered by topic.
- 2026-08-22
For large-cap stocks, buy-and-hold still wins
Buy-and-hold means you buy and sit. On Korean 1x ETFs and the 25 largest names, daily from 2010, stop-losses, scaled entries, rebound filters, and a five-indicator composite almost never beat buy-and-hold on full-window return. KODEX 200: hold +427% with a -41% max drawdown. Buy a 50-day high and sell 15% off the peak: +318% and -26%. You pay about 110 percentage points of return for 15 points of drawdown. That is insurance, not alpha. The exception is a 3x Korea ETF, where buy-and-hold is a -96% path. There a 20% trail and a 20-day high re-entry is the strategy. Hold 1x large caps. Cut only the 3x.
- 2026-08-13
What does it mean to predict pharma stocks from clinical trial data
It means filtering pharma and biotech names by trial schedules rather than by charts. When a Phase 3 readout is coming is already written down in a public registry called ClinicalTrials.gov, and institutional order flow starts moving roughly two months before the announcement rather than on the day. So the pipeline keeps only trials whose estimated completion falls inside 60 days, attaches short-selling and order-flow data, and folds six dimensions into a single score out of 100. This piece opens up that pipeline end to end and explains why the most important design decision was deleting a good-looking number from the screen.
- 2026-08-07
RSI, MACD and Bollinger Bands — Five Indicators a Quant Agent Calls
Technical indicators are second-order values derived from one primary dataset: open, high, low, close and volume. There are hundreds of them, but an AI trading agent calls exactly five through a single tool — RSI(14), MACD(12/26/9), Bollinger Bands(20, 2σ), SMA(20/50/200) and EMA(20) — and those five cover overheating, trend reversal, volatility and long-term direction. The catch is that the same name does not mean the same number. RSI splits depending on whether you smooth with Wilder's method (ewm alpha=1/14) or a simple moving average (rolling 14); Bollinger Bands split depending on whether the standard deviation uses ddof=1 or ddof=0. The thing to check before wiring up an indicator is not the threshold. It is the formula.
- 2026-08-05
KRX Open API — Measuring KOSPI Daily Swings Yourself
The KRX Open API is the Korea Exchange's public data service at openapi.krx.co.kr. Put your key in an AUTH_KEY header, pass one date as basDd, and you get that day's open, high, low and close as json. Applying takes the four steps printed on the site: sign up and request a key, browse the service list for the API you want, file a usage request, then build once approved. Almost everyone stalls here, because key approval and per-service usage approval are separate gates and a key alone returns 401 on every call. With that key, thirty lines of standard-library Python produce the mean, median and extreme-day count for any window. Run it around 27 May 2026, when single-stock leveraged ETFs listed, and the 48 trading days on either side show mean absolute daily change rising from 2.56% to 4.08% and mean intraday range from 2.99% to 5.81%. Whether the numbers grew and what made them grow remain separate questions, and this data does not settle the second.
- 2026-07-25
What does it take to let an AI trade stocks through the Toss Securities Open API?
The Toss Securities Open API is a REST API that covers market data and stock information, accounts and holdings, order creation, modification and cancellation, and conditional orders that watch a price and fire automatically once it is hit. You log in to the Toss Securities WTS, issue a client_id and client_secret under Settings and then Open API, and register the IP you will call from in the allowed list. Add a terminal AI agent such as Claude Code or Codex and you can automate reads and orders by describing your trading rule in plain words instead of writing the code yourself. But the moment reads work, orders work too, so a human has to put gates in front of live orders first: dry-run defaults, an explicit execution flag, an amount ceiling and an idempotency key.