Field reference / trend

trend_distance_ma40_pct

Signed distance of the close from its 40-period simple moving average (SMA), in percent of the SMA: 5.0 = 5% above, -5.0 = 5% below. Daily rows use daily closes, weekly rows weekly closes, adjusted for splits up to the row date. Null until the SMA exists (fewer than 40 bars).

LevelPer stock, ETF and coin, one value per date
Typenumber
Can be nullYes
Categorytrend
Returned by/v1/history, /v1/search

Getting it

Its history for one ticker:

curl -G "https://api.tickerdb.com/v1/history" \ --data-urlencode 'tickers=AAPL' \ --data-urlencode 'fields=trend_distance_ma40_pct' \ --data-urlencode 'start=2025-01-01' \ -H "Authorization: Bearer YOUR_API_KEY"

Stocks matching it today:

curl -G "https://api.tickerdb.com/v1/search" \ --data-urlencode 'filters=[{"field":"trend_distance_ma40_pct","op":"gte","value":0}]' \ --data-urlencode 'fields=["ticker","trend_distance_ma40_pct"]' \ -H "Authorization: Bearer YOUR_API_KEY"

Every field, with its type and values, is also in /v1/schema/fields.