Add v2 features: shorts scanner, portfolio hedge, agentic API#138
Open
UrbanLegendsAV wants to merge 3 commits intomsitarzewski:mainfrom
Open
Add v2 features: shorts scanner, portfolio hedge, agentic API#138UrbanLegendsAV wants to merge 3 commits intomsitarzewski:mainfrom
UrbanLegendsAV wants to merge 3 commits intomsitarzewski:mainfrom
Conversation
Full implementation of TarsierAlpha v2 per Grok spec: Backend (Node/Express + MongoDB): - Shorts scanner: gap_fill_short, overbought_short, catalyst_short (score 0-100, beta 80+ cap) - Longs scanner: gap_fill, oversold_bounce (existing logic extended) - Technical indicators: RSI, Bollinger Bands, gap detection, volume ratio - Paper trade service: Polygon mid + 0.5% slippage, no real broker - Portfolio Hedge Mode: industry → correlated put basket (trucking/retail/oil/tech/airlines/banking/healthcare/housing) - P&L routes: longs vs shorts split, win rate, drawdown, avg hold time - Public anonymized weekly P&L endpoint - Agentic API: GET /api/agent/scans, GET /api/agent/pnl, POST /api/agent/paper-trade - WebSocket /ws/alerts: real-time scan push, side subscription, heartbeat - Telegram alerts: high ping (longs), low horn (shorts), weekly P&L broadcast - OpenAPI spec + Swagger UI at /api/docs - Firebase auth middleware + AgentKey middleware Frontend (Next.js 14 + Tailwind + Recharts): - Scanner tabs: Longs | Shorts (BETA) | Hedge - Shorts beta opt-in banner with risk disclosure - ScanCard: score, Greeks, entry zone, leverage, theta_burn/margin_alert badges - Paper Trade Modal: qty selector, slippage note, confirm/success states - Hedge Mode: industry/exposure/risk-tolerance form → basket table → Paper Hedge button - P&L Dashboard: longs vs shorts stats, public weekly leaderboard, open trades table - WebSocket hook: auto-reconnect, audio cues (880Hz longs, 220Hz shorts) - Firebase auth hook: Google sign-in, token sync - PWA manifest, dark theme, Tailwind brand colors https://claude.ai/code/session_01TVcb1QbqkBpUkJ58aMPMo2
- scoring_additions.py: score_short(), score_short_for_hedge(), build_risk_note() - options_selector_additions.py: find_best_put(), select_put_options_for_candidate() - scanner_shorts.py: Phase 6 shorts pipeline, admin-gated beta - hedge.py: Industry→PUT basket generator (10 industries, 3 risk levels) - agent_routes.py: /api/agent/scans, /api/agent/pnl, /api/agent/paper-trade - app_additions.py: Routes for hedge, shorts toggle, agent blueprint - market_regime_additions.py: allow_shorts/allow_hedge flags - migrations.sql: New columns (side, badges, leverage, risk_note, hedge_group_id) - templates: hedge.html, shorts_beta_banner.html, shorts_tab.html - INTEGRATION.md: Step-by-step apply guide https://claude.ai/code/session_01TVcb1QbqkBpUkJ58aMPMo2
Author
|
added more to my own project |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
This PR introduces three major feature sets to TarsierAlpha v2:
1. Shorts Scanner (
scanner_shorts.py,scoring_additions.py)shorts_enableduser flag2. Portfolio Hedge Mode (
hedge.py,templates/hedge.html)3. Agentic API Layer (
agent_routes.py,openapi.yaml)/api/agent/scans,/api/agent/pnlPOST /api/agent/paper-tradeSupporting Changes
side(long/short),badges,leverage,hedge_group_id,shorts_foundsave_option_candidate()to acceptoption_typeparameter (was hardcoded 'call')allow_shortsandallow_hedgeflags based on VIX levelsINTEGRATION.mdwith step-by-step setup instructionsTest Plan
https://claude.ai/code/session_01TVcb1QbqkBpUkJ58aMPMo2