| name | longbridge-technical |
| description | Core technical-indicator signal engine for stocks listed in HK / US / A-share / Singapore via Longbridge Securities. Computes and interprets MACD, KDJ, RSI, Bollinger Bands, EMA, ADX, and OBV from OHLCV data; combines multi-dimensional votes (trend / mean-reversion / volume-price) to produce a composite buy / sell / neutral signal. Triggers: "技术指标", "MACD", "KDJ", "RSI", "布林带", "布林线", "EMA", "ADX", "OBV", "金叉", "死叉", "超买", "超卖", "技术分析", "趋势指标", "量价", "技術指標", "布林帶", "技術分析", "超買", "超賣", "technical indicator", "MACD signal", "KDJ overbought", "RSI oversold", "Bollinger Bands", "moving average", "golden cross", "death cross", "technical analysis".
|
| license | MIT |
| metadata | {"author":"longbridge","version":"1.0.0","risk_level":"read_only","requires_login":false,"default_install":true,"requires_mcp":false,"tier":"read"} |
longbridge-technical
Computes seven classic technical indicators from 200 days of OHLCV data and produces a composite buy / sell / neutral signal via a multi-dimensional voting mechanism.
Response language: match the user's input language — Simplified Chinese / Traditional Chinese / English.
When to use
- "NVDA MACD 金叉了吗", "TSLA RSI 超买了吗", "700.HK 技术指标怎么看"
- "600519.SH 布林带收口", "AAPL 技術分析信號", "ADX 趋势强吗"
- "technical analysis for NVDA", "is TSLA overbought on RSI", "MACD signal"
Workflow
- Resolve the symbol to
<CODE>.<MARKET> format.
- Fetch 200 daily candles:
longbridge kline <SYMBOL> --period day --format json
- Run the Python analysis below to compute all indicators and their individual votes.
- Report each indicator's current value and signal, then summarise with the composite vote tally.
CLI
longbridge kline NVDA.US --period day --format json
longbridge kline 700.HK --period day --format json
longbridge kline 600519.SH --period day --format json
Run longbridge kline --help to verify current flag names and defaults.
Python analysis
import pandas as pd, json, sys
data = json.loads(sys.stdin.read())
df = pd.DataFrame(data)
df = df.rename(columns={"open":"o","high":"h","low":"l","close":"c","volume":"v"})
df[["o","h","l","c","v"]] = df[["o","h","l","c","v"]].apply(pd.to_numeric)
votes = {}
def ema(s, n): return s.ewm(span=n, adjust=False).mean()
ema12 = ema(df["c"], 12); ema26 = ema(df["c"], 26)
macd = ema12 - ema26; signal = ema(macd, 9); hist = macd - signal
votes["MACD"] = +1 if hist.iloc[-1] > 0 and hist.iloc[-1] > hist.iloc[-2] else (
-1 if hist.iloc[-1] < 0 and hist.iloc[-1] < hist.iloc[-2] else 0)
delta = df[].diff(); gain = delta.clip(lower=); loss = (-delta).clip(lower=)
avg_g = gain.ewm(alpha=/, adjust=).mean()
avg_l = loss.ewm(alpha=/, adjust=).mean()
rsi = - / ( + avg_g / avg_l.replace(, ))
rsi_last = rsi.iloc[-]
votes[] = - rsi_last > (+ rsi_last < )
low9 = df[].rolling().(); high9 = df[].rolling().()
rsv = (df[] - low9) / (high9 - low9 + ) *
K = rsv.ewm(alpha=/, adjust=).mean()
D = K.ewm(alpha=/, adjust=).mean()
J = *K - *D
votes[] = + J.iloc[-] < (- J.iloc[-] > )
mid = df[].rolling().mean(); std = df[].rolling().std()
upper_bb = mid + *std; lower_bb = mid - *std
c_last = df[].iloc[-]
votes[] = + c_last < lower_bb.iloc[-] (
- c_last > upper_bb.iloc[-] )
e50 = ema(df[], ); e200 = ema(df[], )
votes[] = + e50.iloc[-] > e200.iloc[-] -
tr = pd.concat([df[]-df[], (df[]-df[].shift()).(),
(df[]-df[].shift()).()], axis=).(axis=)
dm_plus = (df[]-df[].shift()).clip(lower=)
dm_minus = (df[].shift()-df[]).clip(lower=)
atr14 = tr.ewm(alpha=/, adjust=).mean()
di_plus = * dm_plus.ewm(alpha=/, adjust=).mean() / atr14
di_minus = * dm_minus.ewm(alpha=/, adjust=).mean() / atr14
dx = (di_plus - di_minus).() / (di_plus + di_minus + ) *
adx = dx.ewm(alpha=/, adjust=).mean()
votes[] = + adx.iloc[-] > di_plus.iloc[-] > di_minus.iloc[-] (
- adx.iloc[-] > di_minus.iloc[-] > di_plus.iloc[-] )
obv = (df[] * df[].diff().apply( x: x > (- x < ))).cumsum()
votes[] = + obv.iloc[-] > obv.iloc[-] (- obv.iloc[-] < obv.iloc[-] )
total = (votes.values())
composite = total >= ( total <= - )
()
()
()
()
()
()
()
()
Output
Present a table of indicator values, individual votes (+1 / 0 / -1), and a composite summary row. End with a one-sentence interpretation in the user's language.
| 指标 / 指標 / Indicator | 当前值 / 當前值 / Value | 信号 / 訊號 / Signal |
|---|
| MACD | hist 值 | 多/空/中性 |
| RSI(14) | 数值 | 超卖/中性/超买 |
| KDJ J | 数值 | 超卖/中性/超买 |
| Bollinger | 价格位置 | 超卖/中性/超买 |
| EMA 50/200 | 多空排列 | 多头/空头 |
| ADX | 趋势强度 | 趋势/震荡 |
| OBV | 5日趋势 | 流入/流出 |
Error handling
| Situation | 简体回复 / 繁體回覆 / English reply |
|---|
command not found: longbridge | 请安装 longbridge-terminal / 請安裝 longbridge-terminal / Install longbridge-terminal first |
stderr not logged in / unauthorized | 请运行 longbridge auth login / 請執行 longbridge auth login / Run longbridge auth login |
| Other stderr | 直接展示错误信息 / 直接顯示錯誤訊息 / Surface error verbatim |
MCP fallback
When the CLI is unavailable, fall back to the MCP server. Discover available tools from the MCP server's tool list at runtime.
Related skills
longbridge-kline — raw OHLCV data and charting
longbridge-candlestick — K-line pattern recognition
longbridge-ichimoku — Ichimoku Cloud system
longbridge-capital-flow — intraday capital-flow signals