Skip to content
← Trading engine

TradingView for research

v6 · 25 Sep · TradingView for research · see v7, the current engine →

v6 was a small change on top of v5: TradingView quotes and bars reached the intraday agents as research input. They never touched prices, fills or orders.

Figure 01 · v6 · 25 September 2026

Where the data comes from, and what each night does with it

Sources on the left, one writer in the middle, decisions and fills, then the evidence on the right. The dashed boxes have no order authority. Nothing here moves a strategy to real money on its own.

  • Data
  • Ranked names
  • Next-open fill
  • Verdict
Yahoobars · actions · intradayNasdaquniverse · price checkMacro feedsFRED · Cboe · FINRANot connectedAlpaca · SEC EDGAR1STOOQ: BLOCKEDcollectjob queue · batchedCOMMITDUCKDB · ONE WRITER2pricescache · verifiedfactsraw, time-stampedpaper ledgerfills · cashintraday agentsTradingView quotes · no ordersscreen~4,100 names3STANDOUTSAI agentlocked tool6ONE PORTFOLIOpaper portfolios21 rules + agentorderssignal at closefillnext open only4FILLS · DIVIDENDSagent ledgereach call vs its controlforward monitorskill rule fixed up front5SAME RULES, OLD BARSwalk-forwardSundays · 10 foldsKEEP · DROPreports · API · UIstandings · status APII DECIDE GO-LIVESOURCESSTOREDECIDEPROVE
fig. 1 — v6. ① Yahoo, Nasdaq and a set of macro and sentiment publishers feed the collectors; Alpaca, SEC EDGAR and licensed history stay off, and Stooq is blocked. ② One writer commits every batch to DuckDB and keeps each provider's raw response. ③ The screen ranks about 4,100 liquid names and each portfolio turns the ranking into orders at the close. ④ Orders fill at the next open and nowhere else. ⑤ The monitors read the equity paths against a rule frozen before the first signal, and the Sunday walk-forward replays the rule portfolios on older bars. ⑥ The AI agent trades its own paper portfolio through a locked simulator tool; the intraday agents read TradingView quotes and only observe.

Running unattended

Cron starts the nightly run at 22:30 UTC: universe, collect, screen, corporate actions, portfolio step, the three forward monitors, sync, then the heavier jobs through a queue with per-job timeouts and a resource cap. DuckDB has one writer; the collector releases it between batches so the API and the UI are never locked out for a multi-hour pull. Saturdays a verifier re-checks the full universe against a second source and reports disagreements instead of quietly patching them. Sundays the walk-forward replays every portfolio through the live league.py daily step with the config frozen in its database row, so the report can never describe a rule no portfolio is trading.

Coding agents built the engine from a written spec. Even after the research answer became “nothing works yet, wait for evidence”, the agents kept building anyway: forty-six thousand lines of governance for a broker that does not exist. The repo now carries a written rulebook, a list of what is in scope with size limits the test suite enforces, and a status snapshot every coding session must publish. For now, I want it to keep collecting data and reporting against the existing rules while the experiments run.

paper portfolios
21 rule-based (18 replayable) · 1 run by an AI agent
strategy modules
30 · one file each, rules fixed in advance
test plans with a kill rule
10 · 7 closed as rejected or inconclusive
data sources
Yahoo · Nasdaq · FRED · Cboe · FINRA · CFTC · AAII · NAAIM · SqueezeMetrics
research-only source
TradingView quotes and bars, for the intraday agents
not connected yet
Alpaca IEX (dormant) · SEC EDGAR · licensed history
liquid universe
~4,100 US names, refreshed weekly
walk-forward
10 folds · train 24 mo · validate 12 mo
api
34 local-only routes · reads plus paper orders
tests
3,280 collected · warnings are failures
python
~89k lines outside tests · started 2026-07-16

Ong Jun Xiong

SOFTWARE ENGINEER · SINGAPORE

ContactHobbiesArchiveNotesUI PackGitHubLinkedInSource

© 2026 Ong Jun Xiong