Price Versus Moving Averages
These filters measure the signed percentage distance between current close and EMA or SMA.
What this is
price_vs_ema_pct and price_vs_sma_pct calculate (close - moving average) / moving average * 100 . Positive values mean price is above the average; negative values mean it is below.
When to use it
Use these filters for trend bias, pullback depth, overextension, or a price crossing of a moving average. They remain comparable across instruments with different price levels.
Before you start
- Both filters default to period: 20 and value 0 .
- Operators are above , below , cross_above , and cross_below .
- 0 represents price exactly at the moving average.
- EMA reacts faster; SMA provides a more evenly weighted baseline.
Step by step
Step 1: Choose EMA or SMA
Choose EMA for a more responsive reference or SMA for a steadier one. Keep the choice aligned with the strategy idea.
Step 2: Set period and timeframe
Together these settings define the baseline duration. A longer period or timeframe produces slower changes.
Step 3: Define the distance condition
Use above 0 for price above the average and below 0 for price below. Use a positive or negative nonzero value to require distance. Use crossing zero only when the crossing event matters.
What you should see
A value of 1.5 means close is approximately 1.5% above the selected average. A value of -1.5 means it is approximately 1.5% below.
Common mistakes
- entering a quote price instead of a percentage
- using cross_above 0 when a persistent above 0 condition is needed
- treating a large distance as automatic continuation rather than possible overextension
- stacking EMA and SMA distance rules that express nearly the same condition
Related articles
- Filters Reference
- EMA
- SMA
- Parabolic SAR And Price Versus Supertrend