margin-ta

Read-only technical-analysis pipeline — generate multi-horizon stances with indicator consensus, tiered S/R and market/sector risk dashboard.

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 + pykrx public 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

READMERepositoryIssuesPages canonical

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

LayerModule(s)Responsibility
L0 Orchestrationmargin_ta.pyTicker validation, provider selection, pipeline flow
L1 Datalayer1_data, layer1_market2y daily OHLCV + metadata (market cap, sector, beta); market-regime fetch
L2 Indicatorslayer2_indicators30+ vectorized indicators via pandas ta and TA-Lib
L3 Signalslayer3_signals, layer3_consensusTiered S/R, Entry Score (0–100), consensus, multi-horizon stances
L4 Pricinglayer4_pricingTrigger-based entry plans, ATR stops, tiered targets, risk/reward
L5 Outputlayer5_outputRich 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

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.