"Vibe-Trading: Your Personal Trading Agent"
Python ai-agentalgorithmic-tradingbacktestingfintechllmmcpmulti-agentpythonquantitative-financetrading
Updated grounding fix
William Liaoaf9bd5082161
diff --git a/agent/src/agent/grounding.py b/agent/src/agent/grounding.pyindex 7566c6ae8..f365c5f8a 100644--- a/agent/src/agent/grounding.py+++ b/agent/src/agent/grounding.py@@ -240,11 +240,11 @@ _LABELLED_SCORE_RE = re.compile(# unambiguous indicator names are listed: generic words such as "momentum" or# "volatility" sit too close to price prose to mask safely._INDICATOR_VALUE_RE = re.compile(- r"\b(?:rsi|macd|atr|adx|cci|obv|kdj|boll|dif|dea|vix|iv|"- r"sharpe|sortino|beta)\b"+ r"(?:\b(?:rsi|macd|atr|adx|cci|obv|kdj|boll|dif|dea|vix|iv|"+ r"sharpe|sortino|beta|sma|ema|wma)\d{0,4}\b|布林(?:带|线)?)"r"(?:\s*\([^)]{0,20}\))?"r"\s*(?:is|at|of|reads?|=|为|是)?\s*[::]?\s*"- r"[-+]?\d[\d,]*(?:\.\d+)?",+ r"[-+]?\d[\d,]*(?:\.\d+)?(?:\s*/\s*[-+]?\d[\d,]*(?:\.\d+)?)*",re.IGNORECASE,)# A trading plan quotes levels it does not claim to have observed. In the@@ -268,15 +268,15 @@ _INDICATOR_VALUE_RE = re.compile(_PROSPECTIVE_LEVEL_RE = re.compile(r"(?:"# (a) comparison operator immediately before the number- r"(?:>=|<=|≥|≤|>|<|大于|小于|不低于|不高于|高于|低于)\s*\$?\s*[-+]?\d[\d,]*(?:\.\d+)?"+ r"(?:>=|<=|≥|≤|>|<|大于|小于|不低于|不高于|高于|低于)\s*(?:C\$|\$)?\s*[-+]?\d[\d,]*(?:\.\d+)?"r"|"# (b) a level marker introducing the numberr"(?:目标位|目标区|目标价|止损位?|止盈位?|触发价|触发位|触发点|上看|下看|"r"target\s+(?:price|level|zone)|trigger|stop[-\s]?loss|take[-\s]?profit)"- r"\s*(?:为|是|至|到|on|at|of|=)?\s*[::]?\s*\$?\s*[-+]?\d[\d,]*(?:\.\d+)?"+ r"\s*(?:为|是|至|到|on|at|of|=)?\s*[::]?\s*(?:C\$|\$)?\s*[-+]?\d[\d,]*(?:\.\d+)?"r"|"# (c) the number followed by a level marker- r"\$?[-+]?\d[\d,]*(?:\.\d+)?\s*(?:一线|附近)?\s*(?:成为?|作为|是)?\s*"+ r"(?:C\$|\$)?[-+]?\d[\d,]*(?:\.\d+)?\s*(?:一线|附近)?\s*(?:成为?|作为|是)?\s*"r"(?:目标区|目标位|止损位|止盈位)"r"|"# (d) a conditional opener before the number, digits fencing the reachdiff --git a/agent/tests/test_agent_grounding.py b/agent/tests/test_agent_grounding.pyindex 52428ad20..07e200c79 100644--- a/agent/tests/test_agent_grounding.py+++ b/agent/tests/test_agent_grounding.py@@ -1304,6 +1304,17 @@ _PLAN_LEVELS_FROM_983 = ["目标价 $3.50","目标价 $3.50 两档挂单","触发价 $4.00",+ # The CAD `C$` prefix must not break the mask either (DCBO.TO run: a+ # "收盘 < C$26.00" hard stop was read as a price claim).+ "收盘 < C$26.00 全清",+ "收盘低于 C$26.00",+ "目标价 C$26.00",+ # TA readings on their own scale are masked (布林/SMA/RSI in the DCBO.TO+ # draft: "布林 30.98/26.64/22.29", "SMA200 35.78" were read as claims).+ "布林 30.98/26.64/22.29(收盘站上上轨)",+ "布林带 30.98/26.64/22.29",+ "SMA200 35.78(价格在其下)",+ "RSI 46.7",]@@ -1376,6 +1387,11 @@ _ASSERTIONS_THAT_MUST_STAY_CHECKED = [# A decimal at line start is not a list marker ("3.50" has a digit after# the period).("3.50 支撑位", [3.5]),+ # A real low (低) is NOT an indicator/level mask: it stays checked and, in+ # a multi-symbol session, needs its canonical symbol named explicitly.+ ("低 19.87(2026-04-13)", [19.87]),+ # `C$`/`$` alone (no operator/marker) is not prospective: stays checked.+ ("C$26.00 收盘", [26.0]),]