Writing Queries
Sortefi works best when a query states the market, condition, timeframe, and optional scan window. You can still write naturally, but precise words produce more reliable results.
Query Building Blocks
Query Types
Threshold filters
Find symbols where a metric is above, below, equal to, or between values.
Ranking filters
Sort a market by a metric and return the top or bottom symbols.
Streak filters
Find repeated behavior across consecutive candles or sessions.
Composite filters
Combine technical, fundamental, and derivative conditions in one query.
Session and calendar filters
Restrict the scan to a session, date, holiday, or named event when data supports it.
Benchmark comparisons
Compare each symbol against another instrument or benchmark over the same window.
Effective Query Habits
Name the market before you scan. Different markets have different data and timeframe support.
Include the candle timeframe when it matters: H1, H4, daily, weekly, or monthly.
Use plain comparison words: above, below, between, crossed above, crossed below, near, rising, falling.
For fundamentals, name the field directly: PE, PB, market cap, ROE, ROA, dividend yield, sector, industry.
For volume-based forex queries, switch to price or volatility indicators because forex volume is not reliable.
When a phrase can mean two things, be explicit. For example, say RSI for Relative Strength Index, or outperformed SPY for benchmark strength.