Overview
A read-only technical-analysis pipeline for US and Korean equities (and crypto pairs). Combines 30+ vectorized indicators, multi-horizon daily/weekly/monthly stances, an indicator-consensus layer, tiered support/resistance detection, and a macro market/sector risk dashboard into a single CLI — and doubles as the analysis engine behind an MCP server.
- Python 3.10+,
yfinance+pykrxpublic data by default - 30+ vectorized indicators (SMA/EMA, MACD, RSI, Stochastic, ADX, Bollinger, ATR, Ichimoku and more)
- Never places orders — every output is decision-support data
Quick start
pip install -r requirements.txt
python margin_ta.py --ticker AAPL
python margin_ta.py --ticker 005930.KS --json
python margin_ta.py --help
MCP server: see README for mcp integration. Charts and JSON outputs are written alongside the console table.
Architecture — 6 layers
| Layer | Module(s) | Responsibility |
|---|---|---|
| L0 Orchestration | margin_ta.py | Ticker validation, provider selection, pipeline flow |
| L1 Data | layer1_data, layer1_market | 2y daily OHLCV + metadata (market cap, sector, beta); market-regime fetch |
| L2 Indicators | layer2_indicators | 30+ vectorized indicators via pandas ta and TA-Lib |
| L3 Signals | layer3_signals, layer3_consensus | Tiered S/R, Entry Score (0–100), consensus, multi-horizon stances |
| L4 Pricing | layer4_pricing | Trigger-based entry plans, ATR stops, tiered targets, risk/reward |
| L5 Output | layer5_output | Rich console tables, chart PNG, JSON, TradingView links |
Multi-horizon stances (short/mid/long) collapse into aligned_bull, aligned_bear, mixed_pullback, mixed_rally, or mixed. Horizons with insufficient history report insufficient_data.
Features
- Multi-horizon analysis — daily, weekly (∼60 bars), monthly (∼36 months) stances
- Indicator consensus — directional agreement across 30+ indicators
- Tiered support/resistance — near / intermediate / major
- Market & sector risk — 0–100 risk score, regime
calm/caution/stress/crisis - Rich output — console, PNG chart, JSON, TradingView deep links
Project links
License and ownership
Owner: ianlyoo — License: MIT — Version: 3.0.0 — Language: Python
Limitations and scope: Read-only analysis — never places orders. Data from public providers (yfinance, pykrx) may be delayed or incomplete; verify before any decision. No investment advice. Past indicator performance does not predict future results. Market regimes and thresholds are heuristic.