stock-trading
Original:🇨🇳 Chinese
Translated
6 scriptsChecked / no sensitive code detected
Real-time A-share stock quote query and simulated trading, using real Shanghai and Shenzhen market data
4installs
Added on
NPX Install
npx skill4agent add meo9rhsan3492-cell/cn-stock-sim stock-tradingTags
Translated version includes tags in frontmatterSKILL.md Content (Chinese)
View Translation Comparison →A-share Intelligent Trading Skill
Connect to Sina Finance's real-time quote API to provide real-time price query, simulated trading, and position management for A-share stocks.
Market data is real data from the Shanghai and Shenzhen Stock Exchanges, and trading is conducted on a simulated platform with no involvement of real accounts or funds.
Available Commands
Query Real-time Stock Price
bash
python3 {baseDir}/scripts/get_price.py --code 600519Supports stock codes from both Shanghai and Shenzhen markets. Examples: 600519 (Kweichow Moutai), 000858 (Wuliangye), 300750 (CATL)
Returns: Stock name, latest price, price change percentage, trading volume, five levels of bid and ask, etc. (in JSON format)
Batch Query Multiple Stocks
bash
python3 {baseDir}/scripts/get_price.py --code 600519,000858,000001Separate multiple stock codes with commas to query multiple stocks at once.
Query Market Indices
bash
python3 {baseDir}/scripts/get_price.py --index sh000001Supports: sh000001 (Shanghai Composite Index), sz399001 (Shenzhen Component Index), sz399006 (ChiNext Index)
Buy Stocks
bash
python3 {baseDir}/scripts/trade.py --action buy --code 600519 --shares 100Buy a specified number of shares. Shares must be in multiples of 100 (the minimum trading unit for A-shares is 1 lot = 100 shares).
⚠️ Important: You must inform the user of the trading plan and wait for confirmation before calling this command.
Sell Stocks
bash
python3 {baseDir}/scripts/trade.py --action sell --code 600519 --shares 100View Positions and Profit/Loss
bash
python3 {baseDir}/scripts/portfolio.pyView Trading History
bash
python3 {baseDir}/scripts/portfolio.py --historyReset Account
bash
python3 {baseDir}/scripts/portfolio.py --resetReset to initial state: 1 million yuan in cash, no positions. Use before recording videos.