- PLAN.md: full implementation plan from issue - config.py: configurable thresholds, API keys via .env - ingestion/: EDGAR RSS poller + Form 4 XML parser - db/: SQLite schema + interface (WAL mode) - signals/: filter engine (buy/10b5-1/value/role) + cluster detector - alerts/: Slack webhook alert with score gating - broker/: Alpaca paper/live trade execution - backtest/: historical signal backtesting with yfinance - main.py: CLI entrypoint (run | fetch-once | backtest)
41 lines
1.1 KiB
Python
41 lines
1.1 KiB
Python
import os
|
|
from dotenv import load_dotenv
|
|
|
|
load_dotenv()
|
|
|
|
EDGAR_POLL_INTERVAL = 600
|
|
MIN_TRANSACTION_VALUE = 50_000
|
|
MIN_CLUSTER_SIZE = 1
|
|
CLUSTER_WINDOW_DAYS = 30
|
|
HOLDING_PERIOD_DAYS = 90
|
|
POSITION_SIZE_PCT = 0.02
|
|
MAX_POSITIONS = 20
|
|
SCORE_ALERT_THRESHOLD = 5.0
|
|
|
|
ROLE_WEIGHTS = {
|
|
"ceo": 3.0,
|
|
"chief executive officer": 3.0,
|
|
"cfo": 2.5,
|
|
"chief financial officer": 2.5,
|
|
"president": 2.5,
|
|
"coo": 2.0,
|
|
"chief operating officer": 2.0,
|
|
"director": 1.5,
|
|
"vp": 1.2,
|
|
"vice president": 1.2,
|
|
"10% owner": 1.0,
|
|
}
|
|
DEFAULT_ROLE_WEIGHT = 1.0
|
|
|
|
SLACK_WEBHOOK_URL = os.getenv("SLACK_WEBHOOK_URL", "")
|
|
ALPACA_KEY = os.getenv("ALPACA_KEY", "")
|
|
ALPACA_SECRET = os.getenv("ALPACA_SECRET", "")
|
|
ALPACA_BASE_URL = os.getenv("ALPACA_BASE_URL", "https://paper-api.alpaca.markets")
|
|
|
|
DB_PATH = os.getenv("DB_PATH", "insider.db")
|
|
DATA_DIR = os.getenv("DATA_DIR", "data/filings")
|
|
|
|
EDGAR_RSS_URL = "https://www.sec.gov/cgi-bin/browse-edgar?action=getcurrent&type=4&dateb=&owner=include&count=40&search_text=&action=getcurrent"
|
|
EDGAR_SEARCH_URL = "https://efts.sec.gov/LATEST/search-index?q=&forms=4"
|
|
EDGAR_BASE_URL = "https://www.sec.gov"
|