Skip to main content
This section documents technical indicators derived from price action analysis, moving averages, and momentum oscillators.

Momentum Oscillators

RSI (14)
number
Relative Strength Index with 14-period lookback.Range: 0 to 100Example: 62.50Source: Dhan API technical snapshotExtraction:
rsi_14 = get_float(tech.get("DayRSI14CurrentCandle", 0))
stock_analysis["RSI (14)"] = round(rsi_14, 2)
Location: bulk_market_analyzer.py:261, 339Precision: Rounded to 2 decimal placesInterpretation:
  • RSI > 70: Overbought zone (potential reversal down)
  • RSI 30-70: Neutral zone
  • RSI < 30: Oversold zone (potential reversal up)
  • Divergences between RSI and price can signal trend changes

Simple Moving Average (SMA) Status

SMA Status
string
Current price position relative to key Simple Moving Averages with percentage distance.Format: "SMA {period}: {Above/Below} ({pct}%) | SMA {period}: {Above/Below} ({pct}%)"Example: "SMA 20: Above (4.9%) | SMA 50: Above (24.1%)"Tracked Periods: 20, 50, 200Source: Dhan API advanced technical indicatorsExtraction Logic:
sma_signals = []
smas = adv_tech.get("SMA", [])
target_smas = ["20", "50", "200"]

for s in smas:
    ind_name = s.get("Indicator", "").replace("-SMA", "")
    val = get_float(s.get("Value"))
    
    if ind_name in target_smas and val > 0 and ltp > 0:
        diff = ((ltp - val) / val) * 100
        status = "Above" if diff > 0 else "Below"
        sma_signals.append(f"SMA {ind_name}: {status} ({round(diff, 1)}%)")

stock_analysis["SMA Status"] = " | ".join(sma_signals)
Location: bulk_market_analyzer.py:284-297, 341Components:
  • SMA 20: Short-term trend (1 month)
  • SMA 50: Medium-term trend (2.5 months)
  • SMA 200: Long-term trend (10 months)
Interpretation:
  • All Above: Strong uptrend
  • All Below: Strong downtrend
  • Mixed: Consolidation or transition phase
  • Distance percentage indicates strength of trend

Exponential Moving Average (EMA) Status

EMA Status
string
Current price position relative to key Exponential Moving Averages with percentage distance.Format: "EMA {period}: {Above/Below} ({pct}%) | EMA {period}: {Above/Below} ({pct}%)"Example: "EMA 20: Above (6.3%) | EMA 200: Above (72.6%)"Tracked Periods: 20, 50, 200Source: Dhan API advanced technical indicatorsExtraction Logic:
ema_signals = []
emas = adv_tech.get("EMA", [])
target_emas = ["20", "50", "200"]

for e in emas:
    ind_name = e.get("Indicator", "").replace("-EMA", "")
    val = get_float(e.get("Value"))
    
    if ind_name in target_emas and val > 0 and ltp > 0:
        diff = ((ltp - val) / val) * 100
        status = "Above" if diff > 0 else "Below"
        ema_signals.append(f"EMA {ind_name}: {status} ({round(diff, 1)}%)")

stock_analysis["EMA Status"] = " | ".join(ema_signals)
Location: bulk_market_analyzer.py:299-311, 342Components:
  • EMA 20: Short-term momentum (reacts faster than SMA 20)
  • EMA 50: Medium-term trend
  • EMA 200: Long-term support/resistance
EMA vs SMA:
  • EMAs give more weight to recent prices
  • EMAs respond faster to price changes
  • EMAs are preferred for momentum trading

Technical Sentiment Summary

Technical Sentiment
string
Consolidated view of major technical indicators (RSI and MACD) with their current signals.Format: "RSI: {Bullish/Neutral/Bearish} | MACD: {Bullish/Neutral/Bearish}"Example: "RSI: Neutral | MACD: Bearish"Source: Dhan API advanced technical indicatorsExtraction Logic:
tech_inds = adv_tech.get("TechnicalIndicators", [])
sentiment_summary = []
for t in tech_inds:
    name = t.get("Indicator", "")
    action = t.get("Action", "")
    if "RSI" in name:
        sentiment_summary.append(f"RSI: {action}")
    elif "MACD" in name:
         sentiment_summary.append(f"MACD: {action}")

stock_analysis["Technical Sentiment"] = " | ".join(sentiment_summary)
Location: bulk_market_analyzer.py:313-322, 343Action Values:
  • Bullish: Indicator suggests upward momentum
  • Neutral: No clear directional bias
  • Bearish: Indicator suggests downward momentum
Components:
  • RSI Sentiment: Based on overbought/oversold levels
  • MACD Sentiment: Based on MACD line vs signal line crossover
Use Cases:
  • Quick sentiment check at a glance
  • Confluence detection (both bullish = stronger signal)
  • Divergence detection (conflicting signals = caution)

Pivot Points

Pivot Point
string
Classic pivot point level for intraday trading.Format: String representation of price levelExample: "245.50"Source: Dhan API advanced technical indicators (Classic Pivot Points)Extraction Logic:
pivots = adv_tech.get("Pivots", [])
classic_pivot = "N/A"
if pivots and isinstance(pivots, list):
     classic = pivots[0].get("Classic", {})
     classic_pivot = classic.get("PP", "N/A")

stock_analysis["Pivot Point"] = classic_pivot
Location: bulk_market_analyzer.py:324-329, 344Calculation (Classic Pivot):
PP = (Previous High + Previous Low + Previous Close) / 3
Usage:
  • Price > PP: Bullish bias
  • Price < PP: Bearish bias
  • Used to calculate support (S1, S2, S3) and resistance (R1, R2, R3) levels
Default: "N/A" if pivot data unavailable

Additional SMA Data Points

SMA 50 Value
number
Raw value of 50-day Simple Moving Average.Example: 2450.80Source: Dhan API technical snapshotExtraction:
sma_50 = get_float(tech.get("DaySMA50CurrentCandle", 0))
Location: bulk_market_analyzer.py:260Note: Used internally for calculating % distance in SMA Status field
SMA 200 Value
number
Raw value of 200-day Simple Moving Average.Example: 2150.30Source: Dhan API technical snapshotExtraction:
sma_200 = get_float(tech.get("DaySMA200CurrentCandle", 0))
Location: bulk_market_analyzer.py:259Note: Used internally for calculating % distance in SMA Status field

Data Sources

  1. Dhan API Technical Snapshot (tech): RSI, SMA 50/200 raw values
  2. Dhan API Advanced Technical Indicators (adv_tech): SMA/EMA signals, Technical Indicators, Pivot Points

Calculation Notes

  • All percentage distances are calculated relative to indicator value: ((price - indicator) / indicator) * 100
  • Positive percentage = Price above indicator
  • Negative percentage = Price below indicator
  • Status strings use pipe separator (|) for multiple indicators
  • Default values are 0.0 for numeric fields and "N/A" for string fields when data unavailable

Source Code Reference

  • Field extraction: bulk_market_analyzer.py:257-344
  • Advanced indicators parsing: bulk_market_analyzer.py:283-329
  • Output schema: all_stocks_fundamental_analysis.json

Build docs developers (and LLMs) love