Period Returns
Percentage change in price over the past 1 trading day.Example: Location:
2.30Source: Dhan API technical snapshotExtraction:bulk_market_analyzer.py:334Interpretation:- Positive: Stock gained today
- Negative: Stock declined today
- Large moves (>5%) may indicate news/events
Percentage change in price over the past 1 week (5 trading days).Example: Location:
5.80Source: Dhan API technical snapshotExtraction:bulk_market_analyzer.py:335Use Case: Short-term momentum screeningPercentage change in price over the past 1 month (~22 trading days).Example: Location:
12.40Source: Dhan API technical snapshotExtraction:bulk_market_analyzer.py:336Use Case: Medium-term trend identificationPercentage change in price over the past 3 months (~63 trading days).Example: Location:
28.60Source: Dhan API technical snapshotExtraction:bulk_market_analyzer.py:337Use Case: Quarterly performance trackingPercentage change in price over the past 6 months (~126 trading days).Example: Location:
45.20Source: Calculated from OHLCV historical dataCalculation:advanced_metrics_processor.py:53-55, 96Precision: Rounded to 2 decimal placesNote: Requires OHLCV data; defaults to 0.0 if unavailablePercentage change in price over the past 1 year (~252 trading days).Example: Location:
78.90Source: Dhan API technical snapshotExtraction:bulk_market_analyzer.py:338Use Case: Annual performance comparison52-Week Benchmarks
Percentage distance from 52-week high.Calculation:Example:
-8.50 (stock is 8.5% below its 52-week high)Location: bulk_market_analyzer.py:198-201, 254Precision: Rounded to 2 decimal placesInterpretation:- 0%: Stock at 52-week high (potential breakout or resistance)
- -5% to -10%: Near highs (strong momentum)
- -20% to -30%: Moderate correction
- < -40%: Deep correction (potential value opportunity or structural issue)
Percentage distance from 52-week low.Calculation:Example:
85.30 (stock is 85.3% above its 52-week low)Source: Calculated from OHLCV historical dataLocation: advanced_metrics_processor.py:57-59, 97Precision: Rounded to 2 decimal placesInterpretation:- 0% to 10%: Near lows (potential reversal or further downside)
- 10% to 30%: Recovery phase
- 50%+: Strong recovery from lows
- > 100%: More than doubled from 52-week low
All-Time High Benchmark
Percentage distance from All-Time High.Calculation:Example:
12.80 (stock is 12.8% below its all-time high)Source: Calculated from complete OHLCV historical dataLocation: advanced_metrics_processor.py:37-39, 92, 146-151Precision: Rounded to 2 decimal placesNote: Uses live LTP to eliminate 1-day lag when availableInterpretation:- 0%: Stock at all-time high (momentum/breakout)
- < 10%: Near ATH (strong long-term trend)
- 10% to 30%: Moderate pullback from peak
- > 50%: Significant decline from peak
Intraday Metrics
Percentage gap between today’s open and previous day’s close.Calculation:Example:
2.80 (stock opened 2.8% higher than yesterday’s close)Source: Calculated from OHLCV dataLocation: advanced_metrics_processor.py:42, 94Precision: Rounded to 2 decimal placesInterpretation:- Positive: Gap up (bullish opening, possible news/results)
- Negative: Gap down (bearish opening)
- > 5%: Significant gap (investigate catalyst)
0.0 in bulk_market_analyzer.py:340, later updated by advanced_metrics_processor.pyIntraday high-low spread as a percentage of the low.Calculation:Example:
3.50 (today’s high is 3.5% above today’s low)Source: Calculated from OHLCV dataLocation: advanced_metrics_processor.py:43, 95Precision: Rounded to 2 decimal placesInterpretation:- < 2%: Low volatility day
- 2% to 5%: Normal range
- 5% to 10%: High volatility
- > 10%: Extreme volatility (possible news/event)
Data Sources
- Dhan API Technical Snapshot (
tech): 1D/1W/1M/3M/1Y returns, 52W high - OHLCV CSV Data (
ohlcv_data/*.csv): 6M returns, % from 52W low, % from ATH, Gap Up %, Day Range % - Hybrid Approach: Live LTP from master data used to eliminate lag in ATH calculation
Calculation Notes
- All percentage calculations use the formula:
((current - base) / base) * 100 - Negative values for ”% from High/ATH” indicate price is below the benchmark
- Positive values for ”% from Low” indicate price is above the benchmark
- OHLCV-dependent fields default to
0.0if historical data is unavailable - Safe division with zero-check prevents calculation errors
Source Code Reference
- Dhan API fields:
bulk_market_analyzer.py:198-201, 334-340 - OHLCV calculations:
advanced_metrics_processor.py:37-59, 92-97 - Hybrid ATH fix:
advanced_metrics_processor.py:146-151 - Output schema:
all_stocks_fundamental_analysis.json