A price pattern is easy to describe loosely. Testing it requires a more exact statement: which shares qualify, when the necessary information is available, when entry happens and what it costs to act on the signal. Without those details, two runs can appear to test the same idea while doing different things.
I asked Claude Code to build a fresh research system for my small-cap data using an existing methodology. I wanted rolling evaluation, checks for weakening patterns and enough documentation for another session to continue the work. Reusing a collection of old scripts was not the brief.
The result was a Python and DuckDB prototype. DuckDB calculates tables in SQL; Python generates named candidates and collects their comparisons. It can test individual conditions and combine selected conditions into pairs or triples.
The archived research contains failed robustness checks and deterioration in later periods. It established an implemented way to investigate candidates, not a proven trading strategy. One candidate shows the decisions more clearly than the module list.
Give the idea a definition that stays with its result
gap_dn_green_fb describes a share opening more than 2% below the previous session, followed by a first one-minute bar that closes above its own opening price. The candidate tests buying in the expectation of a rise.
Its stored condition is:
f.gap_pct < -2 AND f.first_bar_green = 1The name remains attached to the direction, filters and results. Adding a second condition creates a traceable variation of that test instead of another unexplained result.
Preparation makes one row per symbol and trading session from one-minute bars. It also builds prices at timed exits so different exits can be compared. Session filtering uses America/New_York and 09:30 to 16:00, which accounts for daylight-saving changes rather than assuming one fixed UTC offset.
A daily row can hide an important timing mistake. A feature built from the first five minutes cannot justify an entry before those minutes have happened. The feature-to-entry timing still needs a complete audit before these research calculations can be treated as executable trades.
The same commission changes a cheap share’s result more
The cost model assumes $0.005 per share on entry and again on exit, plus 0.05% slippage on each side. Slippage represents the difference between the modeled price and the price a trade might receive.
cost_pct = (0.005 / entry_price * 2 + 0.0005 * 2) * 100At a $2 entry, those assumptions cost 0.6% round trip. At $10, they cost 0.2%. A result that survives costs at the higher price might disappear at the lower one. Calculating with the candidate's entry price preserves that distinction.
These are explicit research assumptions, not verified fills or an account's actual fees.
“Not enough data” cannot mean the same thing as “passed”
A good combined total can depend on one strong year or a handful of extreme observations. The validation code compares years, removes a strong year, increases costs and checks sensitivity to extremes. These comparisons help locate what carries a candidate's result.
The reviewed source also contains a reporting defect. If either the bullish or bearish group has fewer than 20 trades, test_regime_stability() records “insufficient data” but returns passed=True. A count of passed tests can therefore include a comparison that never had enough evidence to be made.
Too little evidence can still return a pass
bull_n < 20 or bear_n < 20Insufficient sampleOne side of the regime comparison lacks enough trades.
passed = TrueCurrent return valueThe detail explains the missing evidence, but the flag reports a pass.
I would give insufficient evidence its own outcome before using that count to rank candidates. This is a proposed correction, not a repair already made. Selection also revisited historical years, so those years cannot later be presented as untouched tests.
Preserve the failed ideas as well as the candidate definitions
A recorded 22 March 2026 development run reported 67 passing unit tests. That is historical test output, separate from the research result. Passing tests did not stop candidates from failing robustness checks or deteriorating on later data.
The original project folder and dataset are unavailable on this Mac. Selected source was reconstructed from successful writes and edits in the local Claude Code history; the full research was not rerun. The archive supports the implemented profiler, hypothesis generation, cost comparisons, validation, exits and monitoring. It does not establish live audited returns or working brokerage execution.
I also asked for the methodology and pitfalls to be documented so a fresh session could continue with less occupied context. Keeping named conditions, failed ideas and open checks makes that possible without reducing the work to its most promising headline number.
Project sources & checks
Local Claude Code history contains successful source writes and edits for the profiler, hypothesis miner, validation checks, cost model, exit comparison and monitoring modules.
A recorded 22 March 2026 unit-suite run reports 67 passing tests. This is historical output, not a fresh run of the complete project.
Selected source snapshots were reconstructed from successful operations in the local history. The original project folder and dataset are unavailable on this Mac.
The history records failed robustness checks and later-period deterioration. No live audited returns or qualified brokerage execution are established.