Compendium-TA Quick Reference: Templates, Tips, and Cheat Sheets
What is Compendium-TA
Compendium-TA is a modular toolkit for technical analysis workflows, combining data ingestion, indicator calculation, visualization, and reproducible reporting. Use it to standardize analysis, reduce repetitive setup, and share reproducible templates across teams.
Quick-start templates
Use these concise templates to get fast, repeatable results.
1) Daily market snapshot (single-symbol)
- Inputs: symbol, date range (default: last 90 days), interval (daily)
- Steps:
- Ingest OHLCV for symbol and date range.
- Compute moving averages: MA20, MA50, MA200.
- Compute RSI(14) and MACD(12,26,9).
- Generate candlestick chart with overlays (MAs) and subplots (volume, RSI, MACD).
- Export PNG and JSON summary: latest price, MA positions, RSI value, MACD histogram.
- Outputs: snapshot.png, snapshot.json
2) Multi-symbol relative strength table
- Inputs: list of symbols, date range (default: 1 year), return window (default: 3 months)
- Steps:
- Fetch adjusted close prices.
- Compute total return over windows: 1M, 3M, 6M, 1Y.
- Compute volatility (annualized std) and Sharpe-like ratio.
- Rank and color-code table.
- Outputs: strengths.csv, strengths.html (sortable)
3) Strategy backtest skeleton
- Inputs: symbol, entry rule, exit rule, initial capital, slippage, commission
- Steps:
- Prepare price series and signals.
- Run vectorized backtest (position sizing, cash accounting).
- Compute performance metrics: CAGR, max drawdown, win rate, expectancy.
- Plot equity curve and drawdowns.
- Outputs: backtest_report.pdf, trades.csv
4) Event study (earnings / announcements)
- Inputs: symbol, event dates, window (e.g., -10 to +10 days)
- Steps:
- Align returns around each event.
- Compute average cumulative abnormal returns (CAR) vs. benchmark.
- Bootstrap confidence intervals.
- Produce heatmap of individual event responses.
- Outputs: event_study.png, event_stats.csv
5) Indicator library quick-check
- Inputs: symbol(s), indicator list
- Steps:
- Compute chosen indicators (Bollinger Bands, ATR, OBV, Stochastic, ADX).
- Tabulate latest values with interpretation flags (e.g., ATR high/low).
- Produce one-page cheat-sheet per symbol.
- Outputs: indicators_summary.pdf
Tips for efficient use
- Modularize: Keep ingestion, feature engineering, and reporting as separate modules to reuse across templates.
- Cache data: Store raw fetched data with timestamps to avoid repeated API calls.
- Vectorize calculations: Prefer vectorized operations over per-row loops for speed.
- Version templates: Tag templates with version and changelog so analyses are reproducible.
- Parameter sweep: Use grid search with summary metrics saved to a results table for fast tuning.
Cheat sheets (quick reference snippets)
Common indicator formulas
- SMA(n): mean of last n closes.
- EMA(n): alpha = 2/(n+1); EMA_t = alphapricet + (1-alpha) * EMA{t-1}.
- RSI(14): RSI = 100 – 100 / (1 + RS), RS = avg_gain / avg_loss.
- MACD: MACD = EMA12 – EMA26; Signal = EMA9(MACD); Histogram = MACD – Signal.
- ATR(n): ATR = EMA(n) of True Range; TR = max(high-low, abs(high-prev_close), abs(low-prev_close)).
Performance metrics
- CAGR: (Ending_Value / Starting_Value)^(1/years) – 1
- Max Drawdown: max over t of (peak_to_t decline)
- Sharpe-like: (mean_return – risk_free) / std_return (annualized)
- Win rate: wins / total_trades
- Expectancy: (win_rate * avg_win) – (loss_rate * avg_loss)
Plotting defaults
- Candlestick colors: green up, red down.
- Moving averages: MA20 (blue), MA50 (orange), MA200 (purple).
- RSI overbought/oversold lines: 70 / 30.
- MACD histogram: positive green, negative red.
Reproducible reporting checklist
- Record data source, query parameters, and fetch time.
- Save raw and cleaned datasets.
- Log parameter values used for indicators and backtests.
- Include version of Compendium-TA template and code commit hash.
- Export both human-readable report (PDF/HTML) and machine-readable outputs (CSV/JSON).
Example workflow (brief)
- Run Daily market snapshot template for target symbols.
- Feed top-ranked symbols into Indicator library quick-check.
- For candidates, run Strategy backtest skeleton.
- Compile results into a ranked strengths table and final PDF report.
For a ready-to-use package, adapt the templates above to your codebase: separate ingestion, indicator functions, backtest engine, and reporting exporter.
Leave a Reply