Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add agents/yuhao-corn/manufacturing-agents/tradergit clone --depth 1 https://github.com/YUHAO-corn/manufacturing-agentsWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/agents/yuhao-corn/manufacturing-agents/trader)<a href="https://agentmods.dev/agents/yuhao-corn/manufacturing-agents/trader"><img src="https://agentmods.dev/badge/agents/yuhao-corn/manufacturing-agents/trader.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00000 | $0.04581 |
| Opus 5 | $0.00000 | $0.02291 |
| Sonnet 5 | $0.00000 | $0.00916 |
| Haiku 4.5 | $0.00000 | $0.00458 |
Grade A, and why
trader scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
This is a copy
100% identical to risk-management — 862 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.
How it starts
The opening of the file, as written. The whole thing — 546 lines — stays where its author put it; the contents beside it link to each section on GitHub.
交易员智能体
概述
交易员智能体是 TradingAgents 框架的核心决策组件,负责综合分析师报告和研究员辩论结果,制定最终的交易决策。交易员智能体具备专业的交易知识和风险意识,能够在复杂的市场环境中做出明智的投资决策。
交易员架构
基础交易员类
class Trader:
"""交易员智能体 - 负责最终交易决策"""
def __init__(self, llm, config):
self.llm = llm
self.config = config
self.trading_style = config.get("trading_style", "balanced")
self.risk_tolerance = config.get("risk_tolerance", "medium")
self.memory = TradingMemory()
self.position_manager = PositionManager()
def make_decision(self, analysis_data: Dict) -> Dict:
"""制定交易决策"""
# 1. 综合分析所有输入
comprehensive_analysis = self.synthesize_analysis(analysis_data)
# 2. 评估市场条件
market_assessment = self.assess_market_conditions(analysis_data)
# 3. 制定交易策略
trading_strategy = self.develop_trading_strategy(
comprehensive_analysis, market_assessment
)
# 4. 确定仓位大小
position_size = self.calculate_position_size(trading_strategy)
# 5. 设置风险管理参数
risk_parameters = self.set_risk_parameters(trading_strategy)
# 6. 生成最终决策
final_decision = self.generate_final_decision(
trading_strategy, position_size, risk_parameters
)
# 7. 更新交易记忆
self.memory.update_decision(final_decision)
return final_decision
核心功能模块
1. 分析综合模块
def synthesize_analysis(self, analysis_data: Dict) -> Dict:
"""综合分析所有输入数据"""
# 提取各类分析结果
analyst_reports = analysis_data.get("analyst_reports", {})
research_consensus = analysis_data.get("research_consensus", {})
market_data = analysis_data.get("market_data", {})
# 分析师报告权重
analyst_weights = self.config.get("analyst_weights", {
"fundamentals": 0.3,
"technical": 0.3,
"news": 0.2,
"social": 0.2
})
# 计算加权分析评分
weighted_scores = {}
total_score = 0
for analyst_type, weight in analyst_weights.items():
if analyst_type in analyst_reports:
score = analyst_reports[analyst_type].get("overall_score", 0.5)
weighted_scores[analyst_type] = score * weight
total_score += weighted_scores[analyst_type]
# 研究员共识影响
consensus_impact = self._assess_consensus_impact(research_consensus)
# 综合评估
synthesis = {
"analyst_scores": weighted_scores,
"total_analyst_score": total_score,
"consensus_impact": consensus_impact,
"adjusted_score": self._adjust_score_with_consensus(total_score, consensus_impact),
"confidence_level": self._calculate_overall_confidence(analyst_reports, research_consensus),
"key_factors": self._extract_key_factors(analyst_reports, research_consensus)
}
return synthesis
def _assess_consensus_impact(self, research_consensus: Dict) -> Dict:
"""评估研究员共识的影响"""
consensus_strength = research_consensus.get("consensus_level", 0.5)
recommendation = research_consensus.get("recommendation", "neutral")
# 共识强度影响权重
if consensus_strength > 0.8:
impact_weight = 0.3 # 高共识,高影响
elif consensus_strength > 0.6:
impact_weight = 0.2 # 中等共识,中等影响
else:
impact_weight = 0.1 # 低共识,低影响
# 推荐方向影响
direction_impact = {
"谨慎乐观": 0.15,
"谨慎悲观": -0.15,
"中性观望": 0.0
}.get(recommendation, 0.0)
return {
"strength": consensus_strength,
"weight": impact_weight,
"direction": direction_impact,
"net_impact": direction_impact * impact_weight
}
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 4d ago First seen · 546 lines · 0 tokens per session scan A e53f85cb3651
trader is an agent published in the GitHub repository YUHAO-corn/manufacturing-agents (171 stars, last pushed 5mo ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 4,581 tokens. A static security scan graded it A with 0 findings. It is 100% identical to risk-management, differing in 862 lines, and is treated as a copy.
Other agents, from other repositories
cfo
Agent ID: cfo Role: Financial analysis, cost management, budgeting Structure: Modern Enterprise.
risk-analyst
Quantitative risk assessment across 5 FA-specific dimensions -- market/volatility, concentration, FX/currency, tax/account routing, fundamental/balance-sheet. Each scored 1-5. Produces overall risk score + mitigation actions. Adapted from TauricResearch/TradingAgents riskmgmt (aggressive/conservative/neutral…
portfolio-manager
Final synthesis judge -- receives all analyst + persona + technical + risk agent outputs, produces a decisive 5-level conviction rating (Buy/Overweight/Hold/Underweight/Sell) with account-routing, position-size guidance, and tax-aware action plan. Adapted from TauricResearch/TradingAgents portfoliomanager. Use after…
technical-analyst
Technical analysis -- price action, MA20/50/200 trend stack, RSI, MACD, Bollinger Bands, ATR, support/resistance levels. Uses Yahoo Finance MCP historical data. Adapted from TauricResearch/TradingAgents marketanalyst.
fundamentals-analyst
Deep financial statement analyst -- pulls 4+ years of income/balance/cashflow, computes trends, flags quality-of-earnings issues, outputs structured health card.
macro-analyst
Macro environment analyst -- snapshots rates/FX/commodities/indices/VIX, assesses cycle position, maps impact to a specific ticker or sector.