What You'll Learn
- The building blocks (values, functions, operators)
- How to combine conditions with AND/OR
- Practical patterns: crossovers, momentum, volatility, fundamentals
- Common mistakes and how to fix them fast
- Tips to keep scans fast and readable
What Are Formulas?
Formulas are advanced expressions you can use when the visual builder is not enough.
They can define:
- Conditions: Which stocks to include in results.
- Columns: What data to display for each stock.
They use a simple language (SKIF) designed for stock analysis.
Quick Wins (Copy/Paste)
Try these in Advanced Formula mode:
rsi(14) < 30 # Oversold
c > sma(50) and v > 1M # Uptrend with liquidity
market_cap > 10B and rsi(14) > 50 # Large caps with positive momentum
Basic Building Blocks
Simple Indicators
rsi(14)
14-period Relative Strength Index
sma(20)
20-period Simple Moving Average
market_cap
Market capitalization
Default Column Formulas
When you open a watchlist, these columns appear by default:
c- Close priceroc(1)- 1-day percentage changev- Volumemarket_cap- Market caprsi(14)- RSI (14 periods)atrp(14)- Average True Range as percentage
These are the building blocks — combine them to create filters.
Comparison Operators
Find stocks matching conditions:
rsi(14) < 30
RSI below 30 (oversold)
market_cap > 1B
Market cap greater than $1 billion
c > sma(50)
Price above 50-day moving average
Available operators:
<Less than>Greater than<=Less than or equal>=Greater than or equal=or==Equal to!=Not equal to
Logical Operators
Combine multiple conditions:
AND (both must be true)
rsi(14) < 30 and market_cap > 1B
Oversold stocks with large market cap
OR (either can be true)
rsi(14) < 30 or rsi(14) > 70
Oversold OR overbought
NOT (invert condition)
not (rsi(14) > 50)
RSI not above 50 (same as rsi(14) <= 50)
Combining with Parentheses
(rsi(14) < 30 or rsi(14) > 70) and market_cap > 1B
Extreme RSI levels in large caps only
Math Operators
Perform calculations:
(c - sma(20)) / sma(20) * 100
Percentage distance from 20-day MA
Available operators:
+Addition-Subtraction*Multiplication/Division%Modulo (remainder)
Common Functions
Price & Volume
c- Close priceo- Open priceh- High pricel- Low pricev- Volumeroc(n)- Rate of change over n periods (percentage). Prefer this for price momentum and leader scans.change(x, n)- Absolute delta over n periods. Mostly useful for non-price series likechange(obv(), 1).
Moving Averages
sma(n)- Simple Moving Averageema(n)- Exponential Moving Average
Momentum Indicators
rsi(n)- Relative Strength Indexmacd()- MACD line (default 12,26,9)macd_signal()- MACD signal linemacd_hist()- MACD histogram
Volatility
atr(n)- Average True Rangeatrp(n)- ATR as percentage of pricebb_upper(n, k)- Bollinger Band upper (n periods, k std devs)bb_lower(n, k)- Bollinger Band lower
Fundamental Data
market_cap- Market capitalizationpe_ratio- Price-to-Earnings ratiops_ratio- Price-to-Sales ratiorevenue_ttm- Trailing 12-month revenuerevenue_growth_yoy- Revenue growth versus the same quarter last year (fraction, so0.15= 15%)eps_growth_yoy- EPS growth versus the same quarter last year (fraction)gross_margin- Gross margin percentageoperating_margin- Operating margin percentagecurrent_ratio- Current ratiodebt_to_ebitda- Debt / EBITDA ratiofcf_yield- Free cash flow yield percentagerule_of_40- Rule of 40 score
Numeric Literals
Use standard notation:
market_cap > 1000000000
Or convenient suffixes:
M- MillionB- BillionT- Trillion
market_cap > 1B
Same as 1,000,000,000
Crossovers
Detect when one value crosses another:
cross_above(c, sma(50))
Price just crossed above 50-day MA
cross_below(rsi(14), 30)
RSI just crossed below 30
Important: Crossovers detect the event, not the sustained state.
Operator Precedence
Order of operations (high to low):
- Parentheses
( ) - Functions
rsi(14),sma(20) - Multiplication/Division
*,/,% - Addition/Subtraction
+,- - Comparisons
<,>,<=,>=,=,!= - NOT
not - AND
and - OR
or
Use parentheses when unsure:
(rsi(14) < 30) and (market_cap > 1B)
Common Errors (And Fixes)
Unknown identifier
Error: Unknown identifier 'rsi14'
Fix: Add parentheses → rsi(14)
Missing operator
rsi(14) 30
Fix: Add comparison → rsi(14) < 30
Mismatched parentheses
(rsi(14) < 30
Fix: Close all parentheses → (rsi(14) < 30)
Invalid function arguments
sma()
Fix: Provide period → sma(20)
Formula Patterns (Start Here)
Oversold Bounce Setup
rsi(14) < 30 and c > sma(200) and market_cap > 1B
Fundamental Growth Screen
revenue_growth_yoy > 0.15 and eps_growth_yoy > 0.20 and gross_margin > 50 and pe_ratio < 25
Momentum Breakout
c > sma(20) and sma(20) > sma(50) and v > sma(v, 20) * 1.5
Volatility Contraction
atrp(14) < 2 and market_cap > 500M
MACD Bullish Crossover
cross_above(macd(), macd_signal()) and c > sma(200)
Tips
- Start simple: Test individual conditions first
- Build incrementally: Add complexity one piece at a time
- Use the default columns: They show the most useful formulas
- Check validation: Red error text appears as you type
- Test on small watchlists: Faster feedback than full market scans
What's Next?
- Cookbook Recipes - Ready-made strategies
- Your First Scan - Apply your formulas
- Troubleshooting - Common issues