Whole file

SilentFleetKK/ai-market-pulse

The author described this change as fix: use is-not-None checks in scoring so zero-valued indicators aren't skipped. It counts as a record because the check below fails on the code as it stood at 7f773c9c1 and passes on 9add4d681, with nothing else changed between the two runs.

Fix saved2026-07-09
Sharing licenceMIT · LICENSE
Change size+4 4

What the code was meant to do, written into the code itself as a save note

fix: use is-not-None checks in scoring so zero-valued indicators aren't skipped

The change

2020 atr_pct = _num(metrics.get("atr_pct"))
2121 volume_ratio = _num(metrics.get("volume_ratio_20d"))
2222
23- if last and sma20:
23+ if last is not None and sma20 is not None:
2424 if last > sma20:
2525 score += 8
2626 reasons.append("Price is above the 20-day average.")
2727 else:
2828 score -= 6
2929 reasons.append("Price is below the 20-day average.")
30- if last and sma50:
30+ if last is not None and sma50 is not None:
3131 if last > sma50:
3232 score += 8
3333 reasons.append("Price is above the 50-day average.")
3434 else:
3535 score -= 7
3636 reasons.append("Price is below the 50-day average.")
37- if last and sma200:
37+ if last is not None and sma200 is not None:
3838 if last > sma200:
3939 score += 5
4040 reasons.append("Long-term trend remains above the 200-day average.")
4141 else:
4242 score -= 8
4343 reasons.append("Long-term trend is below the 200-day average.")
44- if sma20 and sma50:
44+ if sma20 is not None and sma50 is not None:
4545 if sma20 > sma50:
4646 score += 5
4747 reasons.append("Short trend is stronger than medium trend.")

The check that tells the two apart

failpass·tests/test_scoring.py::test_zero_sma200_is_treated_as_a_valid_value_not_missing

Check file tests/test_scoring.py, taken without changes from the fix and copied onto the older code, so the exact same check runs against both versions.

Origin and history

The code before it7f773c9c111e573ba4aa7643d2ebf6a61cdaaed1
Broken version dated2026-07-09
Moduleai_market_pulse.scoring
Units changedscore_asset
Fingerprintdc3896d26eda489a
Checked2026-08-18 by goldset/0.1

Every field above is generated by our program. None of it is written by hand.

Other bugs found in SilentFleetKK/ai-market-pulse