How Ryujin Works

A complete guide to the analysis methods, indicators, and signal scoring that power your trading insights.

The Analysis Pipeline

Every analysis in Ryujin follows a four-stage pipeline. Raw market data (OHLCV candles) flows through technical indicator calculations, then an AI model analyzes the indicators, and finally a multi-factor confidence scorer generates a weighted trading signal.

Market DataOHLCV CandlesIndicatorsEMA, RSI, MACD, BBAI AnalysisGrok via OpenRouterTrading SignalConfidence + Direction

Technical Indicators

Indicators transform raw price data into actionable signals. Ryujin calculates four core indicators in real-time, each revealing a different dimension of market behavior.

Exponential Moving Average (EMA) gives more weight to recent prices using a multiplier of 2 / (period + 1). Ryujin uses EMA-9 (fast) and EMA-21 (slow).

The first EMA value is seeded with a Simple Moving Average (SMA) of the first N closes. After that, each new EMA builds on the previous one: EMA = (close - prevEMA) × k + prevEMA

When EMA-9 crosses above EMA-21 (“golden cross”), it signals a potential uptrend. The reverse (“death cross”) signals a potential downtrend.

PriceEMA 9EMA 21

Relative Strength Index (RSI) measures the speed and magnitude of price changes on a scale of 0-100. Ryujin uses the standard 14-period RSI with Wilder's smoothing method.

The formula: RSI = 100 - (100 / (1 + RS)) where RS = average gain / average loss over the period.

RSI < 30 = oversold (bullish signal). RSI > 70 = overbought (bearish signal). Ryujin scores extreme readings (<20 or >80) even more heavily.

705030OverboughtOversold

MACD shows the relationship between two EMAs. Ryujin computes it with the standard parameters: fast=12, slow=26, signal=9.

MACD Line = EMA(12) - EMA(26)
Signal Line = EMA(MACD, 9)
Histogram = MACD - Signal

A positive histogram means bullish momentum (MACD above signal). The larger the histogram, the stronger the momentum. Ryujin needs at least 34 candles to compute MACD (26 for the slow EMA + 9 for the signal - 1).

0MACDSignalHistogram

Bollinger Bands show volatility by drawing bands around a moving average. Ryujin uses a 20-period SMA with 2 standard deviations.

Middle = SMA(20)
Upper = Middle + 2 × StdDev
Lower = Middle - 2 × StdDev

When price touches the lower band, it's a bullish signal (potential bounce). When it touches the upper band, it's bearish. Bandwidth (upper-lower)/middle measures overall volatility — a squeeze often precedes a breakout.

BounceUpperSMALower

Signal Scoring

Each indicator produces a score from -100 (extremely bearish) to +100 (extremely bullish). These are averaged into a single composite score that determines the final trading direction.

RSI-100 to +100EMA-100 to +100MACD-100 to +100Bollinger-100 to +100AverageEqual WeightComposite Score-100 to +100BUY / HOLD / SELL
BUYComposite > +15

Bullish consensus across indicators. Confidence and strength scale with the composite magnitude.

HOLD-15 to +15

No clear consensus. Indicators are mixed or neutral — wait for stronger alignment.

SELLComposite < -15

Bearish consensus. The more negative the composite, the higher the confidence in the sell signal.

Signal Strength Tiers

STRONG|composite| >= 70
MODERATE|composite| >= 40
WEAK|composite| < 40

AI-Powered Analysis

After computing indicators and scoring the signal, Ryujin sends all the data to an AI model (Grok via OpenRouter) for a natural-language analysis. The AI provides context that pure math can't capture.

Indicators +Signal ScoresGrok AIvia OpenRouter APIJSON structured outputAI AnalysisSummary + Factors

What the AI receives

  • Current price, 24h change, volume
  • All indicator values (RSI, EMA, MACD, BB)
  • Per-indicator scores with reasoning
  • Composite signal direction and confidence

What the AI returns

  • Natural-language market summary
  • Bullish and bearish factors
  • Risk factors to watch
  • Per-indicator breakdown with star ratings

Ready to see it in action?

All indicators, signals, and AI analysis running live on real market data.