Trading Scratchpad
An agentic trading pipeline that kept getting less exciting as the evidence got better.
the problem
The first question was whether a scanner plus an agent plus live market context could safely act on intraday setups. the more useful question became whether the strategy and the automation deserved to exist at all.
what i built
A TradingView-to-agent pipeline with deterministic validation, catalyst checks, risk sizing, strategy research harnesses, broker-state reconciliation, arm-specific ledgers, paper execution, journals, and repeated adversarial audits.
what i'm testing
Archived after an explicit handoff with the live side shut down and paper state current. it is more valuable now as a record of strategy revision and risk hardening than as a promise of an autonomous trader.
the trading system kept getting less exciting and more responsible.
this repo began as the deterministic risk half of an agentic intraday pipeline. the scanner surfaced candidates. the validator's job was to kill them. over time, the strategy itself got killed and rebuilt more than once.
relay the alert, then try to reject it.
TradingView fed a Cloudflare relay into an agent routine. live data was rechecked outside the scanner, executable R:R was recalculated, catalysts and dilution were screened, and the validator returned BLOCK, MANUAL, or FULL_AUTO.
the VWAP funnel took zero trades, so it lost its monopoly on the strategy.
a 3-EMA plus RSI trend-pullback setup was added and measured on real historical data instead of pretending the original funnel was selective by genius. latency studies also showed the slow agentic chain was a bad fit for fast intraday execution.
a 59-agent review pushed the system toward daily swing.
the review changed timeframe, fixed repaint issues, added whole-share fail-safes for small accounts, and killed weaker filters. another research pass found that options were structurally too large for the account size and explicitly deferred them until the capital base was bigger.
the promotion gate and scaling rule were wrong.
the repo records that criticism as owned, not hand-waved. the response was a broker-truth reconciler, arm-specific ledgers, stopless-exposure limits, liveness rules, slippage tripwires, and a new promotion ladder tied to clean fills instead of optimistic calendar time.
eventually the owner directive was simple: simulate the orders.
the full pipeline kept running, but fills became paper fills and skipped trades kept counterfactuals for judgment grading. the final handoff explicitly shut down the Claude side with paper state and contracts current on main.