Skip to main content

Overview

A stock’s compliance status can change when new filings are released or market cap shifts. Stability metrics help portfolio managers assess rebalancing risk — how likely a stock is to flip status in the near future.

Metrics

Flip rate

How often the stock has changed compliance status over its analysis history.
{
  "flip_rate": 0.125,
  "quarters_compliant": 7,
  "quarters_total": 8
}
A flip rate of 0.0 means the stock has never changed status. A flip rate of 0.5 means it changes status every other quarter.

Distance to threshold

How close the stock’s ratios are to the compliance thresholds. Expressed as a decimal (e.g., 0.105 means the ratio is 10.5 percentage points away from the threshold).
{
  "closest_threshold": {
    "screen": "cash_receivables_to_market_cap",
    "current_distance": 0.105,
    "median_distance": 0.12,
    "trend": "narrowing"
  }
}
A small distance means the stock is close to flipping — useful for setting up alerts or applying buffer zones.

Trend

The direction the closest ratio is moving relative to its threshold:
TrendMeaning
stableDistance to threshold is consistent
narrowingGetting closer to threshold (higher risk)
wideningMoving away from threshold (lower risk)

Stability rating

A summary classification derived from flip rate and threshold distance:
RatingCriteria
stableLow flip rate, comfortable distance from all thresholds
watchModerate proximity to a threshold or occasional flips
borderlineVery close to a threshold or frequent status changes

Using stability for portfolio construction

# Find compliant stocks with stable compliance
curl -X POST https://api.halal.sh/v1/screen \
  -H "X-API-Key: your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"status": "compliant", "stability": "stable"}'
Stability metrics are included in:
  • Compliance responsessummary.stabilityRating and summary.stabilityDrivers
  • Evidence Packets — full stability object with flip rate, threshold distances, and trends
  • Screening results — filterable by stability rating