Day 30 : Architecture Complete
#Day 30 — Architecture Complete sqx-quant-agent **Build an efficient automation system for StrategyQuant Pro** — cycle through predefined instruments, timeframes, and templates to generate profitable strategies at scale; no manual intervention in the generation loop What the SQX Quant Agent Actually Does — Step by Step PART 1 — STARTUP 1. The agent loads config.json from config/ — this tells it where SQX is installed, where the projects folder is, what the Finals Collector project is named, what the thresholds are (min OOS count, min Final count to promote, etc.). 2. It loads .api-keys.env for any credentials needed (data feed keys etc.). 3. It starts the HTTP dashboard — a static HTML snapshot of queue state, updated periodically. 4. It starts sqcli.exe as a persistent background process, connecting to SQX's HTTP API. SQX itself must already be running (or sqcli starts it — confirm which). 5. It reads combinations.csv from config/ — this is the master list of what to run. Each row is one instrument+template combination, with columns for symbol, template name, directions (long/short/both), timeframes, eod_timeframes, status, notes. 6. It reads queue.json from state/ — this is the live queue. If queue.json already exists (crash recovery), it loads the prior state and resumes from wherever it left off. If it doesn't exist, it builds the queue fresh from combinations.csv. 7. It reads history.json from state/ — the accumulated log of every step ever run. Appended to, never overwritten. 8. It checks control.json for any operator signals (pause, stop-safe, stop-now) left over from a prior session. If stop-now is set, it halts immediately. 9. It is now running. The main loop begins. PART 2 — THE MAIN LOOP The agent loops continuously. Each iteration: 11. It reads control.json. If stop-now is set, it exits immediately, mid-run if necessary. If stop-safe is set, it finishes the current step then exits. If pause is set, it waits in a sleep loop, checking every few seconds, until the operator clears the signal. 12. It looks at queue.json to find the next pending step. The queue is a list of combinations; each combination has an explicit list of steps (e.g. ["H2-long-step1", "H2-long-step2", ..., "H2-long-step10", "H1-long-step1", ...]). It picks the first step whose status is pending. 13. If no pending steps exist in the queue, it checks combinations.csv for any rows not yet imported. If found, it imports them, generates their step lists, appends to queue.json, and continues. If there is genuinely nothing left to do, it idles and waits (or exits, depending on config).