feat(market): verified market-data snapshot to ground numeric claims
The market analyst could confabulate exact figures — citing a Bollinger band or a "historically validated bounce" the data doesn't support (#830). Add a deterministic get_verified_market_snapshot tool (latest OHLCV row, common indicators, recent closes) the analyst must consult and treat as the source of truth for any exact price/indicator claim, and instruct it not to assert historical validation or support bounces without tool-backed dates and prices. #830
This commit is contained in:
5 files changed
+232
-1
No files matched your search
@@ -23,6 +23,9 @@ from tradingagents.agents.utils.news_data_tools import (
|
||||
get_insider_transactions,
|
||||
get_global_news
|
||||
)
|
||||
from tradingagents.agents.utils.market_data_validation_tools import (
|
||||
get_verified_market_snapshot
|
||||
)
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
from typing import Annotated
|
||||
|
||||
from langchain_core.tools import tool
|
||||
|
||||
from tradingagents.dataflows.market_data_validator import build_verified_market_snapshot
|
||||
|
||||
|
||||
@tool
|
||||
def get_verified_market_snapshot(
|
||||
symbol: Annotated[str, "ticker symbol of the company"],
|
||||
curr_date: Annotated[str, "the current trading date, YYYY-mm-dd"],
|
||||
look_back_days: Annotated[
|
||||
int, "number of recent trading rows to include for sanity-checking"
|
||||
] = 30,
|
||||
) -> str:
|
||||
"""Deterministic verification snapshot for exact market-data claims.
|
||||
|
||||
Returns the latest OHLCV row on or before curr_date, common technical
|
||||
indicators, and recent closes. Call this before making exact claims about
|
||||
price levels, Bollinger bands, RSI, MACD, moving averages, support /
|
||||
resistance, or historical comparisons, and treat it as the source of truth.
|
||||
"""
|
||||
return build_verified_market_snapshot(symbol, curr_date, look_back_days)
|
||||
Reference in new issue
Block a user