Skip to main content

Python SDK for NEXUS Alpha — institutional alternative data signals from SEC EDGAR filings

Project description

NEXUS Alpha Python SDK

Institutional alternative data signals from SEC EDGAR filings.

PyPI Python 3.9+ License: MIT

Installation

pip install nexus-alpha          # Core (REST API only)
pip install nexus-alpha[pandas]  # + DataFrame support
pip install nexus-alpha[stream]  # + WebSocket streaming
pip install nexus-alpha[all]     # Everything

Quick Start

from nexus_alpha import NexusAlpha

client = NexusAlpha("your-api-key")
# Or: NEXUS_ALPHA_API_KEY=your-key in env, then NexusAlpha()

# Top signals right now
for s in client.signals.top(limit=10):
    print(f"{s.ticker:6s} | {s.signal:12s} | conf={s.confidence:.3f} | {s.freshness_status}")
    print(f"  {s.rationale[:100] if s.rationale else ''}")

Output:

NVDA   | OVERWEIGHT   | conf=0.712 | LIVE
  GPU demand accelerating; data center revenue beat by 18%
MSFT   | BUY          | conf=0.683 | LIVE
  Azure growth +29% YoY; AI copilot ARR surpassed $5B

Signal Retrieval

# Search with filters
signals = client.signals.search(
    ticker="NVDA",
    signal="BUY",
    min_confidence=0.65,
)

# Full history → pandas DataFrame (Tier 1+)
df = client.signals.history(
    date_from="2024-01-01",
    date_to="2024-12-31",
    min_confidence=0.65,
    limit=500,
).to_dataframe()

print(df[["ticker", "signal_date", "signal", "confidence"]].head())

Bulk CSV Export (Tier 2+)

# Downloads up to 10,000 signals as a DataFrame
df = client.data.export(date_from="2022-01-01")
df.to_csv("nexus_signals.csv", index=False)
print(f"Downloaded {len(df)} signals")

Analytics & Backtest

perf = client.analytics.performance()

# Best hold period (highest Sharpe)
best = perf.best_hold_period
print(f"Best: {best.hold_days}d hold | Sharpe {best.sharpe_annualized} | WR {best.win_rate:.1%}")
# Best: 60d hold | Sharpe 1.2 | WR 70.6%

# Equity curve → DataFrame
eq_df = perf.equity_curve.to_dataframe()
print(eq_df[["quarter", "portfolio_return", "spy_return", "excess_return"]])

# Per-confidence-bucket breakdown
for band, stats in best.by_confidence_bucket.items():
    print(f"  {band}: {stats['win_rate']:.0%} WR, {stats['mean']:+.1f}% avg return")

Real-Time Signal Stream (Tier 1+)

Blocking (foreground)

def handle_signal(signal: dict):
    print(f"📡 NEW: {signal['ticker']}{signal['signal']} (conf={signal['confidence']:.3f})")
    print(f"   {signal.get('rationale', '')}")

client.stream(handle_signal)  # blocks; Ctrl-C to stop

Non-blocking (background thread)

import time

thread = client.stream_async(handle_signal)

# Do other work while signals stream in
while True:
    time.sleep(1)

Account Usage

usage = client.account.usage()
print(f"Tier: {usage.tier_name}")
print(f"Requests today: {usage.requests_today}")
print(f"Remaining this hour: {usage.remaining_this_hour()}")

Error Handling

from nexus_alpha import NexusAlpha, AuthError, RateLimitError, TierError

try:
    signals = client.signals.history(limit=5000)
except TierError as e:
    print(f"Need Tier {e.required_tier}+ — upgrade at nexusalpha.io")
except RateLimitError:
    print("Rate limit hit — wait for next hour window")
except AuthError:
    print("Invalid API key")

Environment Variable

Set NEXUS_ALPHA_API_KEY to avoid passing the key in code:

export NEXUS_ALPHA_API_KEY=your-api-key
client = NexusAlpha()  # reads from env automatically

API Tiers

Tier Price Rate limit History Bulk export Stream
Insight $5k/mo 100/hr 500 rows
Intelligence $15k/mo 500/hr 5,000 rows ✅ (10k)
Institutional $50k/mo 5,000/hr 5,000 rows ✅ (10k)

Subscribe at nexusalpha.io.

Backtest Summary

Walk-forward validated 2022–2025 (long-only signals):

Hold Period Avg Return vs SPY Sharpe Win Rate
20 days +0.61% −0.11% 0.35 58.8%
40 days +3.63% +1.34% 1.13 58.8%
60 days +4.79% +2.45% 1.20 70.6%

Key finding: 0.65–0.70 confidence band → 90% win rate, +12.3% avg return at 60d. IC is negative above 0.75 confidence → signals capped at 0.75.

⚠️ Important: Per-signal excess return (+2.45% vs SPY) reflects information edge per trade. Full equal-weight portfolio simulation: +9.5% vs SPY +26.2% (2022–2025). These signals are designed as information overlays on existing positions, not standalone portfolios. Full methodology →


Signals are informational only and do not constitute investment advice. NEXUS Alpha is not a registered investment adviser.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nexus_alpha-1.0.0.tar.gz (14.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nexus_alpha-1.0.0-py3-none-any.whl (11.8 kB view details)

Uploaded Python 3

File details

Details for the file nexus_alpha-1.0.0.tar.gz.

File metadata

  • Download URL: nexus_alpha-1.0.0.tar.gz
  • Upload date:
  • Size: 14.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for nexus_alpha-1.0.0.tar.gz
Algorithm Hash digest
SHA256 52d0446fdecdf5dfc53e4303ce8a54cea110cb8e12356ee3fd981358607848ca
MD5 123f02a4f3aa79bb3ecfdc4c7d2c7936
BLAKE2b-256 71b093b81889c9a0a1de8aaf8ab6478969b69a15ef911f61d1237da1bc34e9ce

See more details on using hashes here.

File details

Details for the file nexus_alpha-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: nexus_alpha-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 11.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for nexus_alpha-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 999c535f569a6a0aa2b0e757a9fbb9b7874d492b04ec3ca00e01934c1709a3fd
MD5 84a8d553538db25cb9921c5a9654477b
BLAKE2b-256 b66ec6e6f6ef00bb8d1da8ac145de475e90e93773a2d094c764420694a750d08

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page