Serve live recommendation context on trade setup APIs and alerts
Stored TradeSetup rows are point-in-time snapshots from the RR scan, so
the ticker page could show stale confidence/reasoning/composite (e.g.
sentiment=neutral in the setup card while the sentiment panel showed
bullish). Overlay current score/sentiment context onto the API payload
for GET /trades and GET /trades/{symbol}, gate and format Telegram
qualified-setup alerts on the same live values, and apply the
min_confidence/recommended_action filters after the overlay so they
judge what the caller actually sees. Stored setups stay frozen for
outcome analysis and backtests.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -34,6 +34,7 @@ async def list_trade_setups(
|
||||
direction=direction,
|
||||
min_confidence=min_confidence,
|
||||
recommended_action=recommended_action,
|
||||
live_recommendation=True,
|
||||
)
|
||||
|
||||
data = []
|
||||
@@ -92,7 +93,12 @@ async def get_ticker_trade_setups(
|
||||
_user=Depends(require_access),
|
||||
db: AsyncSession = Depends(get_db),
|
||||
) -> APIEnvelope:
|
||||
rows = await get_trade_setups(db, symbol=symbol)
|
||||
rows = await get_trade_setups(
|
||||
db,
|
||||
symbol=symbol,
|
||||
live_recommendation=True,
|
||||
recompute_scores=True,
|
||||
)
|
||||
data = []
|
||||
for row in rows:
|
||||
summary = RecommendationSummaryResponse(
|
||||
|
||||
Reference in New Issue
Block a user