| name | technical-analysis |
| description | Computes technical indicators for stock data including MACD, RSI, moving averages, Bollinger Bands, ATR, and volume analysis. Generates trading signals based on indicator conditions. Trigger when the user requests technical indicators, chart patterns, or signal calculations. |
| metadata | {"hermes":{"tags":["technical-analysis","indicators","MACD","RSI","signals"],"category":"trading","requires_toolsets":["terminal"]}} |
Technical Analysis
Computes and interprets technical indicators for financial time series data.
Real Code Reference
tradinglearn/utils/technical_indicators.py — calculate_macd(), calculate_ema(), calculate_sma()
tradinglearn/strategies/macd_strategy.py — MACDStrategy.generate_signals() with golden-cross/dead-cross logic
tradinglearn/pytdx2/macd_golden_cross.py — A-share MACD golden cross scanner
Supported Indicators
- Trend: SMA, EMA, WMA, MACD, Parabolic SAR, ADX
- Momentum: RSI, Stochastic Oscillator, Williams %R, ROC, CCI
- Volatility: Bollinger Bands, ATR, Keltner Channels
- Volume: OBV, Volume Profile, Money Flow Index, VWAP
- Patterns: Doji, Hammer, Engulfing, Morning/Evening Star
Typical Workflow
- Fetch K-line data via
fetch_stock_data(ticker) or QuotationClient.get_KLine_data()
- Compute indicators with existing functions in
utils/technical_indicators.py
- Generate signals: crossover events, overbought/oversold thresholds, divergence detection
- Return DataFrame with indicator columns + signal columns
Usage
from utils.technical_indicators import calculate_macd, calculate_ema, calculate_sma
macd_df = calculate_macd(data, fast_period=12, slow_period=26, signal_period=9)
signal = macd_df['MACD'] > macd_df['Signal']