Salta ai contenuti

/set-alert

Cosa fa. Crea allarmi con livelli di entrata/uscita calcolati dall’AI.

Quando usarlo. Per farti avvisare ai prezzi giusti senza calcolarli a mano.

Argomenti. TICKER [BUY|SELL|ALL]

Esempio. /set-alert AAPL ALL

Cosa restituisce. Gli allarmi proposti/creati con i livelli e la motivazione.

Quando lanci /set-alert, Dexter non esegue codice fisso: invia all’AI la prompt qui sotto — il segnaposto {arg} viene sostituito con ciò che scrivi dopo il comando — e l’agente la esegue chiamando da sé gli strumenti necessari. Vedi Come funzionano i comandi per le convenzioni comuni (chiamate in parallelo, anti-allucinazione, fasi, widget di chiusura).

Strumenti che può usare: resolve_ticker, get_crypto_snapshot, memory_search, get_stock_prices, get_stock_prices_intraday, get_technical_indicators, get_stock_performance, portfolio_get, get_future_profile, get_fund_profile, get_crypto_prices, get_crypto_prices_intraday, get_crypto_technical_indicators, get_key_ratios, get_company_news, render_price_chart.

Flusso/visualizzazione: apre con un grafico annotato dei prezzi (render_price_chart).

È la prompt esatta inviata all’AI quando usi il comando (sostituendo {arg}).

User wants intelligent alert levels for "{arg}".
--- STEP 1: PARSE ---
Extract TICKER and optional side (BUY / SELL / ALL, default ALL).
If ticker is ambiguous (company name), call resolve_ticker.
--- STEP 1.5: ASSET TYPE + MEMORY ---
Determine asset type — in order:
- IS_FUTURE: ticker ends with "=F" (GC=F, CL=F, ES=F, ZN=F, etc.)
- IS_FOREX: ticker ends with "=X" (EURUSD=X, GBPUSD=X, etc.)
- IS_FUND: known mutual fund tickers (VFIAX, FXAIX, VTSAX, VBTLX, FZROX, PRGFX, VTIAX, VEIRX)
- IS_INDEX: ticker starts with "^" (^GSPC, ^IXIC, ^DJI, etc.) — alert possible but no portfolio tracking
- IS_CRYPTO: obvious crypto symbols (BTC, ETH, SOL, BNB, XRP, ADA, DOGE, AVAX, DOT, MATIC, LINK, LTC, etc.)
or if uncertain: call get_crypto_snapshot(symbol=TICKER) — if it returns price data → IS_CRYPTO=true
- IS_STOCK: everything else (stocks, ETFs)
In parallel: memory_search query: "risk tolerance alert preferences investment goals {TICKER}"
--- STEP 2: GATHER DATA (all in parallel) ---
IF IS_FUTURE or IS_FOREX or IS_INDEX:
• get_stock_prices → interval="week", 1 year
• get_stock_prices_intraday → interval="1h", limit=24
• get_technical_indicators → limit=5 (RSI, MACD, SMA20, SMA50)
• get_stock_performance → price, 1D/1W/1M, 52w high/low
• portfolio_get → check if user holds it
• If IS_FUTURE: also get_future_profile (category, expiry, underlying — for context in notes)
IF IS_FUND:
• get_stock_performance → price, 1D/1W/1M, 52w high/low
• get_fund_profile → NAV, expense_ratio, returns
• get_technical_indicators → limit=5
• portfolio_get
IF IS_CRYPTO:
• get_crypto_prices → interval="day", 1 year
• get_crypto_prices_intraday → interval="1h", limit=48
• get_crypto_technical_indicators(symbol=TICKER)
• get_crypto_snapshot → price, 24h/7d/30d changes, rank, volume
• portfolio_get → check if user holds it
IF IS_STOCK:
• get_stock_prices → interval="week", 1 year
• get_stock_prices_intraday → interval="1h", limit=24 (last ~3 trading sessions hourly)
• get_technical_indicators → limit=5 (RSI, MACD, SMA20, SMA50)
• get_stock_performance → price, 1D/1W/1M, 52w high/low
• get_key_ratios → P/E, P/B, EV/EBITDA, target, sector
• get_company_news → latest 5 headlines
• portfolio_get → check if user holds the ticker
--- STEP 3: ANALYZE ---
IF IS_FUTURE or IS_FOREX or IS_INDEX:
- 2-3 supports from 1-year weekly price lows (cluster ±2%)
- 2-3 resistances from weekly highs
- Intraday precision: from 1h bars, recent session low/high as tighter S/R reference
- Position vs SMA20/50, % distance from 52w high/low
- RSI: oversold <35, overbought >65
- MACD vs signal: bullish/bearish
- If in portfolio: avg cost, P&L %
Note: no analyst targets, no P/E — skip those entirely.
For IS_FUTURE: mention contract expiry from get_future_profile in alert notes if relevant.
IF IS_FUND:
- Supports/resistances from weekly price history and NAV level
- RSI and SMA for momentum context
- If in portfolio: avg cost, P&L %
Note: no analyst targets for mutual funds — skip P/E.
IF IS_STOCK:
- 2-3 supports from 1-year weekly lows (cluster ±2%)
- 2-3 resistances from weekly highs + analyst targets
- Intraday precision: from the 1h bars, extract recent session low/high as tighter S/R reference.
Prefer intraday lows for BUY alerts and intraday highs for SELL alerts when they fall within weekly S/R zones.
- Position vs SMA20/50, % distance from 52w high/low
- RSI: oversold <35, overbought >65, neutral 35-65
- MACD vs signal: bullish/bearish
- News sentiment + upside/downside target vs price
- If in portfolio: avg cost, P&L %. For SELL-side: take-profit at +15%, +25%, +40% from cost. If in loss: stop-loss at -10% from cost.
IF IS_CRYPTO:
- 2-3 supports from daily lows (cluster ±3% — wider bands for crypto volatility)
- 2-3 resistances from daily highs + round numbers
- Intraday precision: from 1h bars, recent session low/high as tighter S/R reference
- Position vs SMA20/50, % distance from 52w high/low
- RSI: oversold <30, overbought >70 (tighter thresholds for crypto)
- MACD vs signal: bullish/bearish
- If in portfolio: avg cost, P&L %
Note: no fundamental ratios for crypto — skip P/E, analyst targets.
--- STEP 4: CREATE ALERTS ---
notify_once=false for all (re-arming). Notes concise and actionable.
Skip alerts where condition is already active now.
Skip BUY-side if side=SELL. Skip SELL-side if side=BUY.
Adapt thresholds to actual levels from analysis, not generic defaults.
IF IS_FUTURE or IS_FOREX or IS_INDEX (3-5 alerts):
BUY-SIDE (if BUY or ALL):
• PRICE_BELOW at strongest support. Note: "Key support level"
• RSI_BELOW at 35. Note: "RSI oversold — potential bounce"
• NEAR_52W_LOW at 5%. Note: "Near yearly low"
• MACD_CROSS_ABOVE (if MACD below signal). Note: "MACD reversing — momentum shift"
SELL-SIDE (if SELL or ALL):
• PRICE_ABOVE at strongest resistance. Note: "Key resistance — monitor for pullback"
• RSI_ABOVE at 70. Note: "Overbought — watch for exhaustion"
• NEAR_52W_HIGH at 3%. Note: "Near yearly high — distribution zone"
• PCT_1W_DOWN at 5%. Note: "Weekly drop >5% — reassess thesis"
Note: no analyst-target-based alerts for these asset types.
IF IS_FUND (3-4 alerts):
BUY-SIDE (if BUY or ALL):
• PRICE_BELOW at support from weekly history or below NAV. Note: "Below NAV support — potential entry"
• RSI_BELOW at 35. Note: "RSI oversold — reversion signal"
• NEAR_52W_LOW at 5%. Note: "Near yearly low"
SELL-SIDE (if SELL or ALL):
• PRICE_ABOVE at resistance. Note: "Key resistance — consider partial profit"
• RSI_ABOVE at 70. Note: "Overbought"
• NEAR_52W_HIGH at 3%. Note: "Near yearly high"
Note: no analyst-target-based alerts for mutual funds.
IF IS_STOCK (4-6 alerts):
BUY-SIDE (if BUY or ALL):
• PRICE_BELOW at strongest support. Note: "Key support — consider entry, stop below [support -3%]"
• RSI_BELOW at 35 (30 if historically volatile). Note: "RSI oversold — bounce signal. Verify volume."
• NEAR_52W_LOW at 5%. Note: "Near yearly low — high long-interest zone."
• SMA50_CROSS_ABOVE (if price below SMA50). Note: "SMA50 recovery — possible reversal."
• MACD_CROSS_ABOVE (if MACD below signal). Note: "MACD reversing — momentum improving."
SELL-SIDE (if SELL or ALL):
• PRICE_ABOVE at strongest resistance or target (whichever lower). Note: "Resistance / target — consider partial profit."
• RSI_ABOVE at 70. Note: "Overbought — watch for weakness."
• NEAR_52W_HIGH at 3%. Note: "Near yearly high — distribution zone."
• PCT_1W_DOWN at 5%. Note: "Weekly drop >5% — reassess thesis."
IF IS_CRYPTO (4-5 alerts):
BUY-SIDE (if BUY or ALL):
• PRICE_BELOW at strongest support. Note: "Key support — watch for bounce"
• RSI_BELOW at 30. Note: "RSI deeply oversold — historically strong bounce signal for crypto"
• NEAR_52W_LOW at 10%. Note: "Near yearly low — potential accumulation zone"
• MACD_CROSS_ABOVE (if MACD below signal). Note: "MACD reversing — momentum shift"
SELL-SIDE (if SELL or ALL):
• PRICE_ABOVE at strongest resistance. Note: "Resistance zone — consider partial profit"
• RSI_ABOVE at 75. Note: "Overbought — watch for exhaustion"
• NEAR_52W_HIGH at 5%. Note: "Near yearly high — distribution zone"
• PCT_1W_DOWN at 8%. Note: "Weekly drop >8% — reassess position"
--- STEP 4.5: VISUAL ---
Call render_price_chart for the ticker over ~6 months (interval="day"), annotating the alert
levels you just created: BUY-side as kind="support", SELL-side as kind="resistance" (label each
with its condition, e.g. "Support 142 — buy zone"). Set assetType="crypto" if IS_CRYPTO,
otherwise leave it "stock". This shows the user where the alerts sit on the chart.
--- STEP 5: SUMMARY ---
In user's language:
• Current price + technical state (RSI, MACD, vs SMA)
• List of created alerts: condition, level, rationale (1 line each)
• Outlook 1-2 sentences