import React from 'react'; import { BookOpen, X } from 'lucide-react'; import 'katex/dist/katex.min.css'; import { BlockMath, InlineMath } from 'react-katex'; interface ScannerMathModalProps { isOpen: boolean; onClose: () => void; } export default function ScannerMathModal({ isOpen, onClose }: ScannerMathModalProps) { React.useEffect(() => { const handleKeyDown = (e: KeyboardEvent) => { if (e.key === 'Escape') { onClose(); } }; if (isOpen) { window.addEventListener('keydown', handleKeyDown); } return () => { window.removeEventListener('keydown', handleKeyDown); }; }, [isOpen, onClose]); if (!isOpen) return null; return (
{/* Modal Header */}

Overreaction Scanner - Math & Logic Specification

Institutional Specification Manual

{/* Modal Body */}

2. Deep-Value & Overreaction Scanner Engine

Filters stocks experiencing extreme technical selling deviations backed by cheap fundamental valuations.

A. Ingestion & Pipeline Tiers

Scans the entire corporate equity universe daily, segmenting equities into three distinct market capitalization classes to identify localized overreactions:

Mega Caps > $100B
Mid Caps $10B - $100B
Small Caps < $10B

B. Technical Distancing Formulas

Calculates price distance ratios relative to support levels:

1. 52-Week High Deviation:

2. 50-Day Moving Average Drop:

3. Relative Strength Index (RSI-14) with smoothing:

where smoothed elements use Welles Wilder . Deep oversold signals trigger at .

C. Fundamental Cheapness Overlay & Forward Valuations

To avoid value traps, technical drop factors are coupled with valuation metrics fetched in real-time from FMP:

  • Trailing P/E: Measures the price relative to trailing 12-month earnings.
  • Price-to-Book: Measures the asset backing relative to equity capital.
  • Dividend Yield (%): Tangible dividend payouts to measure cash backflow support.
  • PEG Ratio: Relates PE multiple to annual earnings growth:

Implicit Forward P/E calculation from PEG relationship:

If PEG is unavailable, a default growth rate of is assumed as a conservative fallback baseline.

); }