Skip to main content
The Event Markers system provides at-a-glance visual indicators for significant corporate events, regulatory actions, and market activities.

Field Overview

Event Markers
string
Pipe-separated string of event icons and descriptions.Format: "{Icon}: {Description} | {Icon}: {Description} | ..."Example: "πŸ“Š: Results Recently Out | πŸ”‘: Insider Trading | β˜…: LTASM"Default: "N/A" when no events detectedSource: Aggregated from multiple data sources via add_corporate_events.pyExtraction:
events = refined_map.get(sym, [])
stock["Event Markers"] = " | ".join(events) if events else "N/A"
Location: add_corporate_events.py:248-249

Event Types & Triggers

1. Surveillance Events

β˜…: LTASM
marker
Stock in Long-Term Additional Surveillance Measure (ASM) framework.Icon: β˜…Trigger: Stock listed in nse_asm_list.json with Stage containing β€œLTASM”Source File: nse_asm_list.jsonDetection Logic:
if os.path.exists(asm_file):
    with open(asm_file, "r") as f:
        asm_data = json.load(f)
        for item in asm_data:
            sym = item.get("Symbol")
            stage = item.get("Stage", "")
            if sym:
                if "LTASM" in stage:
                    add_event(sym, "β˜…: LTASM")
Location: add_corporate_events.py:33-44Implication: Stock under NSE surveillance due to price volatility or other concerns. Higher risk for retail traders.
β˜…: STASM
marker
Stock in Short-Term Additional Surveillance Measure (ASM) framework.Icon: β˜…Trigger: Stock listed in nse_asm_list.json with Stage containing β€œSTASM”Source File: nse_asm_list.jsonDetection Logic:
elif "STASM" in stage:
    add_event(sym, "β˜…: STASM")
Location: add_corporate_events.py:43-44Implication: Short-term surveillance, may be removed sooner than LTASM.

2. Results & Earnings

πŸ“Š: Results Recently Out
marker
Financial results released in the last 7 days.Icon: πŸ“ŠTrigger: Results announcement detected within last 7 daysSource File: all_company_announcements.jsonLookback Window: 7 daysDetection Logic:
today = datetime.now()
marker_limit = today - timedelta(days=7)

for ann in ann_data:
    sym = ann.get("Symbol")
    event_text = (ann.get("Event") or "")
    etype = ann.get("Type", "")
    date_str = ann.get("Date", "")
    
    if sym and date_str:
        a_date = datetime.strptime(date_str.split(" ")[0], "%Y-%m-%d")
        if a_date >= marker_limit:
            if "results are out" in event_text.lower() or etype == "Results Update":
                add_event(sym, "πŸ“Š: Results Recently Out")
Location: add_corporate_events.py:172-191Related Fields:
  • Quarterly Results Date
  • Returns since Earnings(%)
  • Max Returns since Earnings(%)
⏰: Results (DD-Mon)
marker
Upcoming results announcement scheduled.Icon: ⏰Format: "⏰: Results (12-Mar)"Trigger: Quarterly results scheduled within next 14 daysSource File: upcoming_corporate_actions.jsonLookback Window: Today to +14 daysDetection Logic:
today = datetime.now()
results_limit = today + timedelta(days=14)

for event in upcoming_data:
    sym = event.get("Symbol")
    etype = event.get("Type", "")
    edate_str = event.get("ExDate")
    
    if not sym or not edate_str: continue
    
    edate = datetime.strptime(edate_str, "%Y-%m-%d")
    if today.date() <= edate.date() <= results_limit.date():
        d_str = edate.strftime("%d-%b")
        if "QUARTERLY" in etype:
            add_event(sym, f"⏰: Results ({d_str})")
Location: add_corporate_events.py:46-69

3. Insider Activity

πŸ”‘: Insider Trading
marker
Insider trading activity detected in last 15 days (SEBI Reg 7(2) / Form C filings).Icon: πŸ”‘Trigger: Regulatory filings indicating insider/promoter transactionsSource File: company_filings/*_filings.jsonLookback Window: 15 daysDetection Logic:
recent_limit = today - timedelta(days=15)

for item in items:
    desc = (item.get("descriptor") or "").lower()
    caption = (item.get("caption") or "").lower()
    cat = (item.get("cat") or "").lower()
    body = (item.get("news_body") or "").lower()
    n_date_str = item.get("news_date", "").split(" ")[0]
    
    if n_date_str:
        n_date = datetime.strptime(n_date_str, "%Y-%m-%d")
        if n_date >= recent_limit:
            is_insider = False
            full_text = f"{desc} {caption} {cat} {body}"
            trade_keywords = ["regulation 7(2)", "reg 7(2)", "inter-se transfer", "form c", "continual disclosure"]
            if any(k in full_text for k in trade_keywords):
                is_insider = True
            elif ("insider trading" in full_text or "sebi (pit)" in full_text or "sebi pit" in full_text):
                if "trading window" not in full_text and "closure" not in full_text:
                    is_insider = True
            if is_insider:
                add_event(sym, "πŸ”‘: Insider Trading")
                break
Location: add_corporate_events.py:146-167Keywords Detected:
  • β€œregulation 7(2)” / β€œreg 7(2)”
  • β€œinter-se transfer”
  • β€œform c”
  • β€œcontinual disclosure”
  • β€œinsider trading” (excluding trading window closure notices)
  • β€œsebi (pit)” / β€œsebi pit”

4. Block & Bulk Deals

πŸ“¦: Block Deal
marker
Bulk or Block deal reported in last 7 days.Icon: πŸ“¦Trigger: Block/Bulk deal transaction within last 7 daysSource File: bulk_block_deals.jsonLookback Window: 7 daysDetection Logic:
today = datetime.now()
recent_limit = today - timedelta(days=7)

for deal in deals_data:
    sym = deal.get("sym")
    dtype = deal.get("deal", "")
    d_date_str = deal.get("date", "").split(" ")[0]
    if sym and d_date_str:
        try:
            d_date = datetime.strptime(d_date_str, "%Y-%m-%d")
            if d_date >= recent_limit:
                if "BLOCK" in dtype or "BULK" in dtype:
                    add_event(sym, "πŸ“¦: Block Deal")
        except:
            pass
Location: add_corporate_events.py:100-118Implication: Large institutional buying/selling activity.

5. Circuit Limit Revisions

#: -ve Circuit Limit Revision
marker
NSE reduced the circuit limit band (increased trading restrictions).Icon: #Trigger: Circuit limit decreased (e.g., 20% β†’ 10% or 10% β†’ 5%)Source File: incremental_price_bands.jsonDetection Logic:
for item in rev_data:
    sym = item.get("Symbol")
    f_band = item.get("From")
    t_band = item.get("To")
    if sym and f_band and t_band:
        try:
            if float(t_band) < float(f_band):
                add_event(sym, "#: -ve Circuit Limit Revision")
Location: add_corporate_events.py:82-93Implication: Exchange imposed tighter controls due to volatility concerns.
#: +ve Circuit Limit Revision
marker
NSE increased the circuit limit band (relaxed trading restrictions).Icon: #Trigger: Circuit limit increased (e.g., 5% β†’ 10% or 10% β†’ 20%)Detection Logic:
elif float(t_band) > float(f_band):
    add_event(sym, "#: +ve Circuit Limit Revision")
Location: add_corporate_events.py:94-95Implication: Exchange removed heightened surveillance/restrictions.

6. Upcoming Corporate Actions

🎁: Bonus (DD-Mon)
marker
Bonus issue scheduled.Icon: 🎁Format: "🎁: Bonus (25-Mar)"Trigger: Bonus ex-date within next 30 daysSource File: upcoming_corporate_actions.jsonDetection Logic:
if today.date() <= edate.date() <= action_limit.date():
    d_str = edate.strftime("%d-%b")
    if "BONUS" in etype:
        add_event(sym, f"🎁: Bonus ({d_str})")
Location: add_corporate_events.py:72-73
βœ‚οΈ: Split (DD-Mon)
marker
Stock split scheduled.Icon: βœ‚οΈFormat: "βœ‚οΈ: Split (18-Mar)"Trigger: Split ex-date within next 30 daysDetection Logic:
elif "SPLIT" in etype:
    add_event(sym, f"βœ‚οΈ: Split ({d_str})")
Location: add_corporate_events.py:74-75
πŸ’Έ: Dividend (DD-Mon)
marker
Dividend ex-date scheduled.Icon: πŸ’ΈFormat: "πŸ’Έ: Dividend (20-Mar)"Trigger: Dividend ex-date within next 30 daysDetection Logic:
elif "DIVIDEND" in etype:
    add_event(sym, f"πŸ’Έ: Dividend ({d_str})")
Location: add_corporate_events.py:70-71
πŸ“ˆ: Rights (DD-Mon)
marker
Rights issue scheduled.Icon: πŸ“ˆFormat: "πŸ“ˆ: Rights (30-Mar)"Trigger: Rights ex-date within next 30 daysDetection Logic:
elif "RIGHTS" in etype:
    add_event(sym, f"πŸ“ˆ: Rights ({d_str})")
Location: add_corporate_events.py:76-77

Time Windows Summary

Event TypeLookback/Lookahead Window
Results Recently OutLast 7 days
Upcoming ResultsNext 14 days
Insider TradingLast 15 days
Block/Bulk DealsLast 7 days
Corporate Actions (Bonus/Split/Dividend/Rights)Next 30 days
Circuit RevisionsCurrent snapshot
ASM/GSM SurveillanceCurrent snapshot

Data Processing Flow

  1. Load master data from all_stocks_fundamental_analysis.json
  2. Scan surveillance lists (ASM/GSM)
  3. Check upcoming corporate actions with date filtering
  4. Detect circuit limit changes
  5. Parse bulk/block deals within 7-day window
  6. Scan company filings for insider trading keywords
  7. Process live announcements for results markers
  8. Aggregate events per symbol in refined_map
  9. Update master JSON with pipe-separated event strings

Helper Function

def add_event(sym, event_str):
    """Add event to symbol's event list (avoid duplicates)"""
    if sym not in refined_map:
        refined_map[sym] = []
    if event_str not in refined_map[sym]:
        refined_map[sym].append(event_str)
Location: add_corporate_events.py:26-30

Source Code Reference

  • Main event mapping: add_corporate_events.py:6-263
  • Surveillance: Lines 33-44
  • Corporate actions: Lines 46-79
  • Circuit revisions: Lines 82-97
  • Deals: Lines 100-118
  • Insider trading: Lines 146-167
  • Results markers: Lines 172-191
  • Event aggregation: Lines 243-249
  • Output field: all_stocks_fundamental_analysis.json["Event Markers"]

Build docs developers (and LLMs) love