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

PartWhat it means
MarketUS stocks, crypto perps, India stocks, ETFs
ConditionRSI below 30, price above EMA 200, PE below 15
Timeframeon H4, daily, weekly
Windowtoday, last 7 days, this month, during London session
Rankingtop 10, lowest 20, sort by ATR

Query Types

Threshold filters

Find symbols where a metric is above, below, equal to, or between values.

RSI below 30 on the 4H chart
Stocks with PE below 15 and ROE above 20%
Price above the 200 day EMA

Ranking filters

Sort a market by a metric and return the top or bottom symbols.

Top 20 crypto perps by 24 hour gains
Lowest RSI stocks in the S&P 500
Most volatile ETFs over the last 30 days

Streak filters

Find repeated behavior across consecutive candles or sessions.

Stocks with 5 green daily candles in a row
Crypto perps with 3 consecutive red H4 candles
ETFs with 4 weekly closes above the prior close

Composite filters

Combine technical, fundamental, and derivative conditions in one query.

RSI below 40 and price above EMA 200 on daily
Negative funding and rising open interest with price above VWAP
Large cap India stocks with PE below 20 and RSI below 35

Session and calendar filters

Restrict the scan to a session, date, holiday, or named event when data supports it.

Top crypto gainers during New York session yesterday
Forex pairs that moved most during London session
Nifty stocks with highest range on Diwali 2025

Benchmark comparisons

Compare each symbol against another instrument or benchmark over the same window.

Coins that outperformed BTC last week
Stocks that beat SPY by 5% this month
ETFs underperforming gold over the last 30 days

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.