gold-copper-trading
黄金和铜的实时行情查询与模拟交易(对接 openctp 模拟交易所)
How do I install this agent skill?
npx skills add https://github.com/meo9rhsan3492-cell/cn-stock-sim --skill stock-tradingIs this agent skill safe to install?
- Gen Agent Trust Hubpass
The skill provides a simulated environment for A-share, gold, and copper trading, utilizing real-time market data from Sina Finance and simulation connectivity via OpenCTP. It adheres to security best practices by using environment variables for credentials and is intended for demonstration and training purposes.
- Socketwarn
1 alert: gptAnomaly
- Snykpass
Risk: LOW · No issues
What does this agent skill do?
黄金铜交易技能
连接 openctp 模拟交易所,提供黄金和铜的实时行情查询、模拟买卖和持仓管理功能。 使用真实行情数据,模拟资金交易,不涉及真实账户和资金。
可用命令
获取黄金实时价格
python3 {baseDir}/scripts/get_price.py --symbol gold
返回黄金主力合约的最新价格、涨跌幅等信息(JSON格式)。
获取铜实时价格
python3 {baseDir}/scripts/get_price.py --symbol copper
返回铜主力合约的最新价格(JSON格式)。
获取铜金价比
python3 {baseDir}/scripts/get_price.py --ratio
返回铜价÷金价的比值,与阈值90的关系,以及方向建议。
买入黄金
python3 {baseDir}/scripts/trade.py --action buy --asset gold --amount 数量
买入指定克数的黄金。amount 单位为克。 ⚠️ 重要:调用此命令前,必须先告知用户交易计划并等待用户确认。
卖出黄金
python3 {baseDir}/scripts/trade.py --action sell --asset gold --amount 数量
买入铜
python3 {baseDir}/scripts/trade.py --action buy --asset copper --amount 数量
amount 单位为吨。 ⚠️ 重要:调用此命令前,必须先告知用户交易计划并等待用户确认。
卖出铜
python3 {baseDir}/scripts/trade.py --action sell --asset copper --amount 数量
查看持仓和损益
python3 {baseDir}/scripts/portfolio.py
返回当前现金、黄金持仓、铜持仓、总资产、浮动盈亏。
查看交易记录
python3 {baseDir}/scripts/portfolio.py --history
重置账户(回到初始状态)
python3 {baseDir}/scripts/portfolio.py --reset
将账户重置为初始状态:1亿元现金,无持仓。录制视频前使用。
How can the creator link this skill?
Add the canonical catalog link to the repository README so users can inspect current installs and available audits. The publishing guide covers the complete discovery path.
<a href="https://skillzs.dev/skills/meo9rhsan3492-cell/cn-stock-sim/stock-trading">View gold-copper-trading on skillZs</a>