Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Active momentum day trading requires spotting low-float runners the split second

**NewsAlerts bridges this gap with a focused, zero-bloat institutional trading terminal designed for pure execution speed:**

- ⚡ **Zero-Latency Inbound Alerts**: Plays an instant audio chime (with interactive volume control & one-click pause) and sends Telegram push notifications the exact second a ticker breaches your screening criteria.
- ⚡ **Zero-Latency Inbound Alerts & Dual Topbar Toggles**: Instant audio chimes (with interactive volume control & dedicated in-app audio bell) alongside independent Telegram push notifications with a dedicated 1-click topbar toggle (Telegram paper plane + bell) to silence mobile phone alerts when operating directly at your desk.
- 🌊 **Running Momentum Tape**: Warrior-Trading style High of Day (HOD) and Squeeze Breakout prints with 4-day local disk persistence for weekend and off-hours trade review.
- 🎯 **Interactive Strategy Builder & Tape Quick-Filter**: Construct customized momentum rules (`+ Add Strategy`) with trigger selectors, float ranges, and surge velocities in Settings, with instant one-click toggles right from the tape header (`Strategies 11/13`).
- 📋 **TradingView Cloud Watchlist Sync & 1-Click Quick-Add**: Real-time cloud watchlist selector bar docked directly above news headlines, paired with 1-click quick-add (`+`) buttons next to tickers in the Screener, Tape, and News header. Features 3-second green/red flickering feedback and instant cloud sync directly into your TradingView Desktop app.
Expand All @@ -52,7 +52,7 @@ Active momentum day trading requires spotting low-float runners the split second
<img src="docs/img/terminal.png" alt="NewsAlerts Real-Time Momentum Terminal" width="100%" style="border-radius:10px; border:1px solid #2a3347; box-shadow:0 8px 24px rgba(0,0,0,0.45);" />
</a>
<br>
<small><em>Live institutional terminal capture (v2.11.0): Real-time screener with 1-click watchlist quick-add, high-of-day momentum tape, TradingView cloud watchlist selector, interactive topbar 🚫 Banned / Closing-Only filter, catalyst news wire, and BamSEC SEC filings intelligence.</em></small>
<small><em>Live institutional terminal capture (v2.12.0): Real-time screener with 1-click watchlist quick-add, high-of-day momentum tape, TradingView cloud watchlist selector, dual in-app audio & Telegram alert toggles, interactive topbar 🚫 Banned / Closing-Only filter, catalyst news wire, and BamSEC SEC filings intelligence.</em></small>
</p>

<table width="100%">
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.11.2
2.12.0
2 changes: 1 addition & 1 deletion app/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def save_config(self, cfg: dict):
bot_token=ac.get("telegram_bot_token", ""),
chat_id=ac.get("telegram_chat_id", ""),
enabled=bool(ac.get("telegram_enabled", True)),
paused=is_paused
paused=False
)
a.sounds.muted = is_paused
if "volume" in ac:
Expand Down
2 changes: 1 addition & 1 deletion app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def __init__(self) -> None:
bot_token=ac.get("telegram_bot_token", ""),
chat_id=ac.get("telegram_chat_id", ""),
enabled=bool(ac.get("telegram_enabled", True)),
paused=is_paused
paused=False
)
self.sounds = SoundPlayer(volume=int(ac.get("volume", 80)))
self.sounds.muted = is_paused
Expand Down
2 changes: 1 addition & 1 deletion app/screener.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ def _poll_screen(self, screen: dict, c: dict, active: bool) -> None:
for t in alert_syms:
if t in by_t:
row_data = by_t[t]
if self.telegram and c["alerts"].get("telegram_enabled", True) and not is_paused:
if self.telegram and c["alerts"].get("telegram_enabled", True):
cached = self.news.cached(t)
fresh = NewsService.recent(cached, c["news"]["recency_hours"]) if cached else []
latest_title = fresh[0]["title"] if fresh else ""
Expand Down
2 changes: 1 addition & 1 deletion app/tape.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ def tick(self) -> None:
self.sounds.play(c["alerts"]["sound_tape"])

# Send Telegram push alert for matching tape momentum events
tg_on = c["alerts"].get("telegram_enabled", True) and c["alerts"].get("telegram_tape_enabled", True) and not is_paused
tg_on = c["alerts"].get("telegram_enabled", True) and c["alerts"].get("telegram_tape_enabled", True)
if self.telegram and tg_on:
tg_cd = float(c["alerts"].get("telegram_tape_cooldown_sec", 60))
for ev in unbanned_events:
Expand Down
Binary file modified assets/hero.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/social_preview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ All official releases are produced deterministically through GitHub Actions:

## Release History

- [v2.12.0 Release Notes](releases/v2.12.0.md) — Introduced Dual Independent Alert Controls Architecture with dedicated topbar Telegram alert toggle icon (Telegram paper airplane + bell) decoupled from in-app audio chimes for instant desk/mobile alert switching (Resolves #65).
- [v2.11.2 Release Notes](releases/v2.11.2.md) — Refactored documentation feature showcase tables in `README.md` and `docs/SPEC.md` to prominent 68/32 image-first HTML tables for instant visual clarity, and added dedicated cross-platform `make env`, `make env-win`, `make env-linux`, `make env-mac`, and `build.ps1 -Task env` targets (Resolves #63).
- [v2.11.1 Release Notes](releases/v2.11.1.md) — Added toggleable opt-out capability for BamSEC SEC filings in Settings (opt-in by default), with complete DOM element unmounting, background scraper and network call suppression, and instant reactive live update on save (Resolves #61).
- [v2.11.0 Release Notes](releases/v2.11.0.md) — Integrated real-time BamSEC (by AlphaSense) SEC EDGAR filings intelligence into the News pane with both Collapsible Accordion Drawer and Sub-Tabs layouts, color-coded badges for material news, offerings & dilution, ownership, and financials, one-click browser launching, and F11 full-screen showcase protocol (Resolves #57).
Expand Down
19 changes: 14 additions & 5 deletions docs/SPEC.md
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ Optional tape sound (default off — the tape is noisy).
- **Rich Message Format**: Includes Symbol, Strategy name, Session, Price, Change %, Volume, Float, Relative Volume (daily + 5m%), Short Borrow Status (`HTB` / `ETB` / `NO BORROW` / `N/A`), 52w range position, and a direct TradingView chart link.
- **Per-Symbol Cooldown**: A per-ticker cooldown (default 60s, configurable in Settings) prevents rapid duplicate push notifications when a runner repeatedly prints new HODs in seconds.

## 9. Sounds & Alert Controls
## 9. Sounds & Dual Alert Controls Architecture
- **System Sounds**: Lists all `.wav` files in `C:\Windows\Media` (Windows Notify, Ding, chimes, Alarm01–10, etc.).
- **Separate Sound Pickers**: **New screener symbol**, **New news**, **Tape event**; ▶ test button each.
- **Async Throttled Playback**: Played async via `winsound.PlaySound(path, SND_FILENAME | SND_ASYNC)`; throttled to 1 per 1.5 s.
Expand All @@ -509,10 +509,19 @@ Optional tape sound (default off — the tape is noisy).
- Clicking or dragging across the triangle instantly adjusts the volume.
- Per-process waveform audio volume synchronized seamlessly via Windows WinMM `waveOutSetVolume` without external dependencies.
- Clicking the speaker icon quickly toggles mute / restores prior volume level.
- **Unified Alert Pause (The Bell Button)**:
- Single master toggle for active alerts vs. paused alerts.
- Clicking the bell button **both mutes audio chimes AND suspends sending push notifications to Telegram** (for both Screener new symbols and Tape momentum alerts).
- Visual status feedback: when active, shows normal green-tinted bell; when paused, shows slashed bell (`bellOff`) with pulsing red warning indicator.
- **Dual Independent Alert Toggles**:
- **In-App Audio Alerts Bell (`#btn-mute`)**:
- Dedicated audio alert toggle button in the topbar.
- Clicking toggles local workstation waveform audio chimes on or off (`alerts.mute`).
- Visual feedback: Vibrant green bell (`#38efb0`) when active; red-tinted slashed bell (`#ff6b7e`) with pulsing glow (`pausePulse`) when muted.
- Decoupled from Telegram: muting local audio does NOT silence mobile/desktop Telegram push notifications.
- **Telegram Push Alerts Bell (`#btn-telegram`)**:
- Dedicated Telegram alert toggle button in the topbar adjacent to the audio bell.
- Custom icon featuring the iconic Telegram paper airplane combined with a bell badge.
- Clicking toggles Telegram push notification dispatch on or off (`alerts.telegram_enabled`).
- Visual feedback: Vibrant Telegram Blue (`#29b6f6`) when active; red-tinted slashed Telegram+bell (`#ff6b7e`) with pulsing glow (`pausePulse`) when paused.
- Directly synchronized with Settings &rarr; Alerts &rarr; *Enable Telegram Alerts*.
- Designed specifically for active desk workflows: traders sitting in front of the terminal can silence mobile Telegram notifications with 1 click while preserving local audio alert chimes.

## 10. Settings & Integrations
TradingView `sessionid`/`sessionid_sign` & real-time connection status · poll intervals · re-entry window · alert volume (0%–100%) · unified pause alerts toggle · news recency & provider · sounds · tape universe & strategy thresholds · interactive Strategy Builder (`+ Add Strategy`, triggers, family, deletion) · Backup / Import & Export tab (Full config backup `.json`, Strategies `.json` export/import, factory reset) · Alpaca keys for short borrow locates · Telegram Bot Token, Chat ID, and independent toggles for Screener alerts and Tape momentum alerts (with per-symbol cooldown) · customizable keyboard shortcuts & hotkeys with interactive re-binding and institutional defaults · always-on-top · font size.
Expand Down
Binary file modified docs/img/terminal.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
54 changes: 54 additions & 0 deletions docs/releases/v2.12.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# NewsAlerts v2.12.0 — Release Notes

**Release Date:** October 2026
**Type:** Minor Release (`MINOR` — Dual Independent In-App Audio & Telegram Topbar Alert Controls)
**Single Source of Truth:** `VERSION` (`2.12.0`)

---

## 🚀 Overview

NewsAlerts **v2.12.0** introduces a **Dual Independent Alert Controls Architecture** with dedicated topbar toggles:
1. **Dedicated Topbar Telegram Alert Toggle (`#btn-telegram`)**: Adds an institutional topbar icon combining the iconic Telegram paper airplane with an alert bell badge. Traders can now mute or resume Telegram mobile & desktop push notifications with a single click directly from the header without opening Settings.
2. **Decoupled In-App Audio Bell (`#btn-mute`)**: Decouples the primary audio bell toggle so it strictly governs local PC waveform audio alert chimes (`alerts.mute`). When active momentum day traders are operating directly in front of the workstation, they can silence noisy Telegram phone alerts with 1 click while preserving essential zero-latency PC audio chimes.
3. **Synchronized State & Hotkeys**: Bidirectional synchronization connects the topbar Telegram button directly with Settings &rarr; Alerts &rarr; *Enable Telegram Alerts*. Supports customizable hotkeys for both local audio mute and Telegram push notification toggling.

---

## 🌟 Key Changes & Improvements

### 1. Dedicated Topbar Telegram Alerts Toggle (Issue #65)
- Added `#btn-telegram` immediately adjacent to the audio bell in the topbar header.
- **Custom Vector Icon**: Custom high-DPI SVG combining the Telegram paper airplane pointing northeast with a docked alert bell badge.
- **Institutional Status Feedback**:
- **Active State**: Rendered in Telegram Blue (`#29b6f6`) with soft border glow and interactive hover states.
- **Paused State**: Switches to a slashed vector strike (`tgBellOff`) with red-tinted background (`rgba(246, 70, 93, 0.14)`), red border (`#ff6b7e`), and pulsing alert warning glow (`pausePulse`).
- **One-Click Instant Execution**: Toggling updates `alerts.telegram_enabled` in real-time, persists to `config.json`, and reflects immediately across the terminal UI.

### 2. Fully Decoupled Alert Engine
- **In-App Audio Chimes**: Governed exclusively by `alerts.mute`. Muting local sound chimes no longer suppresses Telegram push alerts if Telegram is enabled.
- **Telegram Push Notifications**: Governed exclusively by `alerts.telegram_enabled` (and tape-specific filters/cooldowns). Silencing Telegram at your desk leaves local workstation audio bells fully functional.
- Updated backend dispatch in `app/screener.py`, `app/tape.py`, `app/api.py`, and `app/main.py`.

### 3. Keyboard Shortcut & Hotkey Integration
- Default `m` hotkey preserved for rapid In-App Audio Mute.
- Added `toggle_telegram` hotkey action in keyboard shortcuts configuration, allowing traders to map any preferred key combination to instant Telegram toggling.

### 4. Startup Alert State Synchronization (Bug Fix)
- Resolved an issue where closing the app with Alerts muted resulted in the topbar alert button displaying as active upon re-opening.
- Both `#btn-mute` and `#btn-telegram` now immediately synchronize their icons, titles, and `.paused` CSS classes against persisted configuration during `init()`.

---

## 🎯 Closed Issues

- **Resolves #65**: [feat(alerts): add dedicated telegram alerts toggle button in topbar](https://github.com/mlgitdev/NewsAlerts/issues/65)

---

## 🧪 Verification & Test Suite

- Added comprehensive unit tests in `tests/test_alert_controls.py` verifying independent audio and Telegram alert states.
- Verified all 66 unit tests pass (`make test` / `python -m unittest discover tests`).
- Verified Python syntax compilation across `app`, `run_app.py`, and `tests`.
- Zero secrets committed.
13 changes: 7 additions & 6 deletions docs/wiki/Audio-Alerts-&-Volume-Controls.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@ Auditory alerting allows momentum traders to keep their eyes on charting softwar

---

## 🔔 Master Bell Toggle (The Bell)
## 🔔 In-App Audio Alerts Bell (`#btn-mute`)

- Located in the top-right header of the terminal (bell icon).
- **Hotkey**: Press `M` to toggle mute.
- **Unified Control**: Clicking the bell immediately:
1. Mutes all audible chimes and bells.
2. Pauses outgoing Telegram alert dispatching.
- The bell icon dynamically displays an amber strikethrough badge when muted.
- **Hotkey**: Press `M` to toggle in-app audio mute.
- **Dedicated Audio Control**: Clicking the bell immediately mutes or resumes local workstation audio chimes without affecting outgoing Telegram push alerts.
- **Visual Feedback**:
- **Active**: Vibrant green bell (`#38efb0`).
- **Muted**: Red-tinted slashed bell (`#ff6b7e`) with pulsing alert indicator (`pausePulse`).
- Paired alongside the dedicated **Telegram Push Alerts Bell** (`#btn-telegram`), giving traders independent controls for desk vs. mobile alerting.

---

Expand Down
2 changes: 1 addition & 1 deletion docs/wiki/Home.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Built on a native, ultra-responsive architecture (`pywebview` + Vanilla ES6+/CSS
<img src="https://raw.githubusercontent.com/mlgitdev/NewsAlerts/main/docs/img/terminal.png" alt="NewsAlerts Real-Time Momentum Terminal" width="100%" style="border-radius:10px; border:1px solid #2a3347; box-shadow:0 10px 30px rgba(0,0,0,0.5);" />
</a>
<br>
<small><em>Live institutional terminal capture (v2.10.2): Real-time screener with 1-click watchlist quick-add, high-of-day momentum tape, TradingView cloud watchlist selector, interactive topbar 🚫 Banned / Closing-Only filter, and catalyst news wire.</em></small>
<small><em>Live institutional terminal capture (v2.12.0): Real-time screener with 1-click watchlist quick-add, high-of-day momentum tape, TradingView cloud watchlist selector, dual in-app audio & Telegram alert toggles, interactive topbar 🚫 Banned / Closing-Only filter, and catalyst news wire.</em></small>
</p>

---
Expand Down
3 changes: 2 additions & 1 deletion docs/wiki/Keyboard-Shortcuts-&-Hotkeys.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ NewsAlerts is built for rapid keyboard-driven workflow. Use these hotkeys to nav

| Shortcut | Action | Description |
| :---: | :--- | :--- |
| **`M`** | **Master Mute** | Instantly toggles audio bell chimes and Telegram alert dispatching. |
| **`M`** | **Mute In-App Audio** | Instantly toggles local terminal audio alert chimes on or off. |
| **Configurable** | **Toggle Telegram Alerts** | Toggles mobile & desktop Telegram push notifications on or off. |
| **`T`** | **Pop-Out Tape** | Opens the detached, floating running tape window. |
| **`Space`** | **Pause / Resume** | Pauses or resumes real-time tape and screener stream updates. |
| **`S`** | **Open Settings** | Launches the modal settings window for feeds, audio, and strategies. |
Expand Down
12 changes: 12 additions & 0 deletions docs/wiki/Telegram-Push-Notifications.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,18 @@ NewsAlerts includes a dedicated **Asynchronous Telegram Worker Queue** that disp

---

## 📲 Dedicated Topbar Telegram Alert Toggle (`#btn-telegram`)

Starting in **v2.12.0**, traders have a dedicated 1-click Telegram alert toggle button in the topbar header:
- **Icon**: High-precision vector emblem combining the iconic Telegram paper airplane with a docked alert bell badge.
- **Visual Feedback**:
- **Active State** (Telegram Blue `#29b6f6`): Telegram notifications are dispatched in real-time.
- **Paused State** (Red-tinted `#ff6b7e` slashed emblem with `pausePulse` glow): Telegram alerts are suppressed.
- **Desk Workflow Independence**: When sitting directly in front of the terminal, click `#btn-telegram` to silence redundant mobile phone alerts while keeping local PC audio chimes active.
- **Bidirectional Sync**: Automatically stays synchronized with Settings &rarr; Alerts &rarr; *Enable Telegram Alerts*.

---

## 📲 Alert Payload Anatomy

Every Telegram alert dispatched by NewsAlerts is formatted for immediate trading comprehension:
Expand Down
2 changes: 1 addition & 1 deletion docs/wiki/_Footer.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
<p align="center">
<small>
<b>NewsAlerts v2.11.2</b> · Institutional Trading Terminal · Maintained by <a href="https://github.com/mlgitdev">@mlgitdev</a> · <a href="https://github.com/mlgitdev/NewsAlerts">GitHub Repository</a> · <a href="Home">Wiki Home</a>
<b>NewsAlerts v2.12.0</b> · Institutional Trading Terminal · Maintained by <a href="https://github.com/mlgitdev">@mlgitdev</a> · <a href="https://github.com/mlgitdev/NewsAlerts">GitHub Repository</a> · <a href="Home">Wiki Home</a>

</small>
</p>
Loading
Loading