Pro-Setups query language
prosetups.select.v1, used by the pro_setups_query tool
AI assistants connected to Pro-Setups can answer detailed questions by sending one read-only SELECT statement in this language. It runs only against the Pro-Setups stock datasets below, returns data the member's plan allows, and cannot change any data. This page documents what it supports. Most members never need it: the assistant writes these queries for you.
Datasets
stocks.snapshot: one row per stock per trading day with the 200+ screener fields.stocks.price_history: stored daily prices for dates before the snapshot range. One explicit date range per query, without joins.
Each name in FROM is bound to a dataset in the request, with either
trading_date (latest or YYYY-MM-DD) or an inclusive
start_date/end_date range of at most 92 calendar days, plus the
catalog_version returned by field discovery.
Field names
Fields use readable names made from the screener column name, for example
field_symbol, field_trading_date, field_price and
field_rs_rating_3_months. The pro_setups_list_fields tool lists every
name with its label, type and unit. Types are decimal, boolean, text and date.
Supported
- Columns, aliases with
AS, arithmetic (+ - * /) andDISTINCT. WHEREwith= <> > >= < <=,AND,OR,IN (...)(up to 100 values),BETWEENandIS NULL.CASE WHENandCASTtoTEXT,DECIMAL,BOOLEANorDATE.GROUP BY,HAVING,COUNT,SUM,AVG,MIN,MAX,ORDER BY(nulls last) andLIMIT.- Non-recursive
WITHstages, aliased subqueries inFROM, and oneINNER JOINon column equality perSELECT. - Window functions over ordered partitions:
LAGandLEAD(offsets 1-92),RANK,DENSE_RANK,ROW_NUMBERandAVGwithROWS BETWEEN n PRECEDING AND CURRENT ROW. - Named parameters such as
:symbol, declared as text, decimal, boolean or date. Compare dates withDATE 'YYYY-MM-DD'.
Not supported
Any statement other than one SELECT, writes, other functions, aggregate FILTER,
scalar or correlated subqueries, recursive queries, DISTINCT ON,
COUNT(DISTINCT ...) and access to any other table.
Limits
- 60 fields and 40 conditions per query; SQL up to 16 KiB.
- Up to 92 calendar days per binding and 10,000 output rows; pages of up to 500 rows.
- A 5-second limit per database read; multi-day work up to 5 minutes per query.
- Per member: 60 tool calls per minute and an hourly allowance of multi-day queries. Refused queries are not charged.
Example
Top five stocks by 3-month relative strength with a rising 50-day EMA on the latest day:
SELECT field_symbol, field_rs_rating_3_months AS rs
FROM stocks
WHERE field_rising_50ema = TRUE
ORDER BY rs DESC
LIMIT 5
with the binding {"stocks": {"dataset_id": "stocks.snapshot", "trading_date": "latest", "catalog_version": "…"}}.
Results
Results contain the rows, column types, row and stock counts, the actual data dates and missing-value counts. Data is for information only and is not investment advice. Questions: info@pro-setups.com.