← 返回 Skills 市场
tgparkk

KIS Trading (한국투자증권)

作者 tgparkk · GitHub ↗ · v1.0.0
cross-platform ⚠ suspicious
783
总下载
0
收藏
1
当前安装
1
版本数
在 OpenClaw 中安装
/install kis-trading
功能描述
한국투자증권(KIS) Open API를 이용한 국내 주식 트레이딩. 잔고 조회, 시세 확인, 매수/매도 주문, 매매 내역, 시장 개황 등. | Korean stock trading via KIS (Korea Investment & Securities) Open API. Balance, quotes, buy/sell orders, trade history, market overview.
使用说明 (SKILL.md)

KIS 주식 트레이딩

한국투자증권 Open API를 통한 국내 주식 매매 스킬.

Korean stock trading skill using KIS (Korea Investment & Securities) Open API. Supports balance inquiry, real-time quotes, buy/sell orders, trade history, and market overview for stocks listed on KRX (KOSPI/KOSDAQ).

설정

config 파일(~/.kis-trading/config.ini)에 아래 값을 설정:

[KIS]
APP_KEY = your_app_key
APP_SECRET = your_app_secret
ACCOUNT_NO = 12345678-01
BASE_URL = https://openapi.koreainvestment.com:9443
# 모의투자: https://openapivts.koreainvestment.com:29443

설정 확인:

python3 scripts/setup.py --config ~/.kis-trading/config.ini --check

잔고 조회

"잔고 보여줘", "계좌 잔고", "예수금", "매수 가능 금액"

python3 scripts/balance.py --config ~/.kis-trading/config.ini

보유 종목

"보유 종목", "내 주식", "수익률"

python3 scripts/holdings.py --config ~/.kis-trading/config.ini

종목 시세

"삼성전자 현재가", "005930 시세", "카카오 주가"

python3 scripts/quote.py --config ~/.kis-trading/config.ini --code 005930
python3 scripts/quote.py --config ~/.kis-trading/config.ini --name 삼성전자

매수/매도 주문

"삼성전자 10주 매수", "카카오 5주 매도"

⚠️ 주문은 반드시 사용자에게 확인을 받은 후 실행할 것!

# 시장가 매수
python3 scripts/order.py --config ~/.kis-trading/config.ini --side buy --code 005930 --qty 10 --market

# 지정가 매수
python3 scripts/order.py --config ~/.kis-trading/config.ini --side buy --code 005930 --qty 10 --price 70000

# 매도
python3 scripts/order.py --config ~/.kis-trading/config.ini --side sell --code 005930 --qty 10 --market

주문 전 반드시:

  1. 종목명, 수량, 가격을 사용자에게 보여주고 확인 요청
  2. --dry-run 으로 주문 내용 미리 확인 가능
  3. 확인 후 실제 주문 실행

매매 내역

"매매 내역", "오늘 체결 내역", "주문 내역"

python3 scripts/history.py --config ~/.kis-trading/config.ini
python3 scripts/history.py --config ~/.kis-trading/config.ini --start 20240101 --end 20240131

시장 개황

"시장 개황", "거래량 상위", "코스피 지수"

python3 scripts/market.py --config ~/.kis-trading/config.ini --action index
python3 scripts/market.py --config ~/.kis-trading/config.ini --action volume-rank

주의사항

  • 실전 투자 시 반드시 BASE_URL을 실전 URL로 설정
  • 모의투자와 실전투자의 TR ID가 다를 수 있음
  • API 호출은 초당 20건 제한 (자동 제어됨)
  • 주문은 절대 사용자 확인 없이 실행하지 말 것
安全使用建议
This skill appears to implement the KIS trading API as advertised, but review and test before using with real money. - Verify the config file format and names: the code expects [KIS] APP_KEY, APP_SECRET, ACCOUNT_NO and BASE_URL in ~/.kis-trading/config.ini. SKILL.md metadata keys (KIS_...) do not match the code and should be corrected. - Use the demo BASE_URL (openapivts...) and a mock/demo account first to confirm behavior. - Be aware credentials (APP_SECRET) are stored in a local config file and an access token is cached under ~/.kis-trading/token.json. Ensure those files have appropriate filesystem permissions and only put minimal-scoped credentials in them. - The SKILL.md asks the agent to confirm orders, but the code does not enforce interactive confirmation in non-interactive invocations. If you allow the agent to invoke skills autonomously, it could place orders programmatically. Restrict autonomous invocation or require explicit human confirmation in your agent policy before executing order commands. - If you cannot audit or host the skill yourself, consider using a trusted, reviewed integration from your broker or run these scripts locally under your direct control. If you install, first exercise only read-only endpoints (balance/quote/history) and validate all behaviors in demo mode.
功能分析
Type: OpenClaw Skill Name: kis-trading Version: 1.0.0 The OpenClaw AgentSkills bundle for KIS stock trading appears benign. All Python scripts interact with the legitimate Korea Investment & Securities (KIS) Open API for its stated purpose (balance, quotes, orders, history). Sensitive API keys and tokens are handled appropriately, with the token cached locally with restricted file permissions. Crucially, the SKILL.md explicitly and repeatedly instructs the AI agent to obtain user confirmation before executing any trade orders, demonstrating a strong commitment to user safety rather than malicious prompt injection. No evidence of data exfiltration, malicious execution, persistence, or obfuscation was found.
能力评估
Purpose & Capability
Name/description align with shipped Python scripts: balance, holdings, quote, market, history, order and setup. Requested binary (python3) and dependency (requests) are appropriate for the stated purpose. The implementation uses a local config (~/ .kis-trading/config.ini) rather than environment variables, which is coherent for a CLI-style trading tool.
Instruction Scope
SKILL.md and scripts limit network activity to KIS endpoints and explain required commands. However, the safety instruction to 'always confirm with the user before placing orders' is only a human-guidance comment — nothing in the code enforces an interactive confirmation when run programmatically. An automated agent with permission to run the skill could call scripts (e.g., scripts/order.py) and place real trades. Scripts also read/write files under the user's home directory (~/.kis-trading), which contain sensitive credentials and cached tokens.
Install Mechanism
There is no install spec (instruction-only skill with included scripts). SKILL.md lists pip ['requests'] as a dependency; the code uses only requests for HTTP. No external downloads, package installs from unknown URLs, or archive extraction are present. Risk from install mechanism is low.
Credentials
The skill uses a config file for APP_KEY / APP_SECRET / ACCOUNT_NO and caches an access token to ~/.kis-trading/token.json. This is proportionate to trading functionality. Two small inconsistencies: SKILL.md metadata lists config_keys named KIS_APP_KEY / KIS_APP_SECRET / KIS_ACCOUNT_NO / KIS_BASE_URL while the code expects APP_KEY / APP_SECRET / ACCOUNT_NO and reads BASE_URL from the config; registry metadata also lists no required env vars. Storing secrets in a plaintext config file and caching tokens to disk are expected here but are sensitive and worth being explicit about.
Persistence & Privilege
The skill does not request always:true and does not modify other skills. It does persist an OAuth token to ~/.kis-trading/token.json (attempting to set file mode 600). That persistence is reasonable for usability, but when combined with the skill's ability to place live orders and the platform's normal autonomous-invocation capability, it increases blast radius if the skill or agent is compromised.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install kis-trading
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /kis-trading 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release: KIS API integration for Korean stock trading
元数据
Slug kis-trading
版本 1.0.0
许可证
累计安装 1
当前安装数 1
历史版本数 1
常见问题

KIS Trading (한국투자증권) 是什么?

한국투자증권(KIS) Open API를 이용한 국내 주식 트레이딩. 잔고 조회, 시세 확인, 매수/매도 주문, 매매 내역, 시장 개황 등. | Korean stock trading via KIS (Korea Investment & Securities) Open API. Balance, quotes, buy/sell orders, trade history, market overview. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 783 次。

如何安装 KIS Trading (한국투자증권)?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install kis-trading」即可一键安装,无需额外配置。

KIS Trading (한국투자증권) 是免费的吗?

是的,KIS Trading (한국투자증권) 完全免费(开源免费),可自由下载、安装和使用。

KIS Trading (한국투자증권) 支持哪些平台?

KIS Trading (한국투자증권) 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 KIS Trading (한국투자증권)?

由 tgparkk(@tgparkk)开发并维护,当前版本 v1.0.0。

💬 留言讨论