Find candidate funds NOT in the DB: exhaustive EDGAR 497-universe pass

fundlab/edgar_universe.py - the 'search' for funds we don't have:
  1. SEC full-index (Archives/edgar/full-index/YYYY/QTRn/company.gz)
     lists every filing; CIKs that filed a base 497/497K in the past 4
     quarters = every currently-active US open-end fund (1,668).
  2. one small fetch per CIK: the full-submission .txt carries the
     line-based SGML prospectus cover (<SERIES-NAME> ... unclosed
     <CLASS-CONTRACT-TICKER-SYMBOL> tags) - fund name + every class
     ticker, often several funds per filing.
  3. alpha-leaning name filter (expanded dbmine PATTERN: +relative
     value, risk allocation, dynamic global, real return, hedged),
     drop local-DB + shortlist tickers,
  4. Yahoo chart verify: instrumentType MUTUALFUND (OTC open-end;
     exchange name is useless - OTC funds report 'Nasdaq'),
     >=5y daily history,
  5. share-class dedupe (longest history), goget download, same
     screen_fund engine.
  Resumable (per-CIK covers cache), 4-thread, Range-free small files.

First pass results (46 funds screened, 5 NEW candidates):
  egrix/ecgmx Eaton Vance Global Macro Absolute Return: R2 0.07,
    +7.9%/+4.8% 5y alpha, t 4.9/4.6, corr-port 0.22 - pure macro idio
  dmszx Destinations Multi-Strategy Alternatives: R2 0.57, +3.3%, t3.5
  cbhax Victory Market Neutral Income: R2 0.07, +4.6%, t2.9, corr 0.11
  pdinx Putnam Diversified Income: semi-alpha (full t5.8, 62% 6m+)
  (+ wmnux/gioax = 2nd share classes of already-known candidates)
  vmnix Vanguard MN: alpha but corr 0.35 (portfolio already 50% MN)

app Fund Lab alpha table now also reads search_external.json.
tests: parse_cover unit tests (unclosed-tag SGML, ticker series
attach, malformed rejected). 65/65 fundlab, 32/32 app.
This commit is contained in:
gmp
2026-08-26 15:22:52 -04:00
parent afec7bda73
commit 592d12958f
6 changed files with 1050 additions and 2 deletions
+34
View File
@@ -305,6 +305,39 @@ def test_search() -> None:
check("ticker regex slash format", t2 == ["FMSDX"], str(t2))
def test_universe() -> None:
print("edgar universe cover parser", flush=True)
from fundlab import edgar_universe as eu
sample = (
"<SERIES-AND-CLASSES-CONTRACTS-DATA>\n"
"<SERIES>\n<SERIES-NAME>1290 Multi-Alternative Strategies Fund\n"
"<CLASS-CONTRACT>\n<CLASS-CONTRACT-NAME>Class A\n"
"<CLASS-CONTRACT-TICKER-SYMBOL>TNMAX\n</CLASS-CONTRACT>\n"
"<CLASS-CONTRACT-NAME>Class I\n"
"<CLASS-CONTRACT-TICKER-SYMBOL>TNMIX\n</CLASS-CONTRACT>\n"
"</SERIES>\n"
"<SERIES-NAME>1290 High Yield Bond Fund\n"
"<CLASS-CONTRACT-TICKER-SYMBOL>TNHAX\n</CLASS-CONTRACT>\n"
"</SERIES-AND-CLASSES-CONTRACTS-DATA>\n"
"<OTHER>JUNK-TICKER-LINE\n" # after the series block: ignored
)
s = eu.parse_cover(sample)
check("two series", len(s) == 2, str(s))
check("series 1 name", s[0]["name"] ==
"1290 Multi-Alternative Strategies Fund", s[0]["name"])
check("series 1 tickers", s[0]["tickers"] == ["TNMAX", "TNMIX"],
str(s[0]["tickers"]))
check("series 2 tickers", s[1]["tickers"] == ["TNHAX"],
str(s[1]["tickers"]))
check("ticker before any series ignored",
eu.parse_cover("<CLASS-CONTRACT-TICKER-SYMBOL>NOPE\n") == [],
"")
check("malformed ticker rejected",
eu.parse_cover("<SERIES-NAME>F\n"
"<CLASS-CONTRACT-TICKER-SYMBOL>1BAD\n")[0]
["tickers"] == [], "")
def test_curated() -> None:
print("curated", flush=True)
import fundlab.fundinfo as fi
@@ -327,6 +360,7 @@ def main() -> int:
test_nport()
test_decompose()
test_search()
test_universe()
test_curated()
test_edgar_live()
print(f"\n{PASS} passed, {FAIL} failed")