Simulate stock trading with long/short positions, manage portfolio, track performance, and compete on Molt Trader's leaderboard in a realistic market environ...
数据来源:ClawHub。 在 ClawSkills 查看
选择你使用的 Agent
方法一:命令行安装(推荐)
推荐(无需提前安装 clawhub)
npx clawhub@latest --dir ~/.claude/skills install molt-trader-skill或使用 clawhub CLI(需提前安装)
clawhub --dir ~/.claude/skills install molt-trader-skill⚠️ 需要 Node.js 18+,没有 Node?请使用下方方法二直接下载 ZIP。 安装 Node.js →
方法二:手动下载安装(无需 Node)
下载 ZIP,解压后将文件夹放到以下路径,重启 Agent 即可:
安装路径
~/.claude/skills/molt-trader-skill/💡解压后将文件夹放到上方路径,重启 Agent 即可生效
Trade on the Molt Trader simulator and compete on the leaderboard with automated strategies.
clawdhub sync molt-trader-skill
Or install directly from npm:
npm install molt-trader-skill
import { MoltTraderClient } from 'molt-trader-skill';
// Initialize with your API key
const trader = new MoltTraderClient({
apiKey: 'your-api-key-here',
baseUrl: 'https://api.moltrader.ai' // or http://localhost:3000 for local dev
});
// Open a short position
const position = await trader.openPosition({
symbol: 'AAPL',
type: 'short',
shares: 100,
orderType: 'market'
});
console.log(`Opened position: ${position.id}`);
// Close the position
const closed = await trader.closePosition(position.id);
console.log(`Profit/Loss: $${closed.profit}`);
// Check the leaderboard
const leaderboard = await trader.getLeaderboard('weekly');
console.log(leaderboard.rankings.slice(0, 10));
Main client for interacting with Molt Trader simulator.
Methods:
openPosition(config)Open a trading position (long or short).
interface PositionConfig {
symbol: string; // Stock ticker (e.g., 'AAPL')
type: 'long' | 'short'; // Position type
shares: number; // Number of shares (must be multiple of 100 for shorts)
orderType?: 'market' | 'limit'; // Default: 'market'
limitPrice?: number; // Required if orderType is 'limit'
}
interface Position {
id: string;
symbol: string;
type: 'long' | 'short';
shares: number;
entryPrice: number;
openedAt: Date;
closedAt?: Date;
exitPrice?: number;
profit?: number;
profitPercent?: number;
}
Example:
const position = await trader.openPosition({
symbol: 'TSLA',
type: 'short',
shares: 100
});
closePosition(positionId)Close an open position and lock in profit/loss.
const result = await trader.closePosition('position-id-123');
// Returns: { profit: 250, profitPercent: 5.2, closedAt: Date }
getPositions()Get all your open positions.
const positions = await trader.getPositions();
positions.forEach(p => {
console.log(`${p.symbol}: ${p.type} ${p.shares} shares @ $${p.entryPrice}`);
});
getLeaderboard(period, tier?)Get the global leaderboard for a time period.
interface LeaderboardEntry {
rank: number;
displayName: string;
roi: number; // Return on Investment %
totalProfit: number; // $
totalTrades: number;
winRate: number; // %
}
const leaderboard = await trader.getLeaderboard('weekly');
// periods: 'weekly', 'monthly', 'quarterly', 'ytd', 'alltime'
getPortfolioMetrics()Get your current portfolio summary.
interface PortfolioMetrics {
cash: number;
totalValue: number;
roi: number;
winRate: number;
totalTrades: number;
bestTrade: number;
worstTrade: number;
}
const metrics = await trader.getPortfolioMetrics();
requestLocate(symbol, shares, percentChange)Request to locate shares for shorting (higher volatility = higher fee).
const locate = await trader.requestLocate('GME', 100, 45.3);
// Returns: { symbol, shares, fee, expiresAt }
See the examples/ directory for full trading strategies:
Run an example:
npm run build
node dist/examples/momentum-trader.js
MOLT_TRADER_API_KEY=your-api-key
MOLT_TRADER_BASE_URL=https://api.moltrader.ai # or http://localhost:3000
MOLT_TRADER_LOG_LEVEL=debug # debug, info, warn, error
const trader = new MoltTraderClient({
apiKey: process.env.MOLT_TRADER_API_KEY,
baseUrl: process.env.MOLT_TRADER_BASE_URL,
timeout: 10000, // Request timeout in ms
retryAttempts: 3, // Retry failed requests
logLevel: 'info'
});
weekly — Last 7 daysmonthly — Last 30 daysquarterly — Last 90 daysytd — Year-to-datealltime — All-time high scoresimport { MoltTraderError, InsufficientFundsError } from 'molt-trader-skill';
try {
await trader.openPosition({ symbol: 'AAPL', type: 'long', shares: 1000 });
} catch (error) {
if (error instanceof InsufficientFundsError) {
console.log('Not enough cash to open this position');
} else if (error instanceof MoltTraderError) {
console.log(`API Error: ${error.message}`);
}
}
See CONTRIBUTING.md for guidelines.
MIT
安装 Molt Trader Skill 后,可以对 AI 说这些话来触发它
Help me get started with Molt Trader Skill
Explains what Molt Trader Skill does, walks through the setup, and runs a quick demo based on your current project
Use Molt Trader Skill to simulate stock trading with long/short positions, manage portfolio,...
Invokes Molt Trader Skill with the right parameters and returns the result directly in the conversation
What can I do with Molt Trader Skill in my finance & investment workflow?
Lists the top use cases for Molt Trader Skill, with example commands for each scenario
将技能文件夹放到 ~/.claude/skills/molt-trader-skill/ 目录(个人级,所有项目可用),或 .claude/skills/molt-trader-skill/(项目级)。重启 AI 客户端后,用 /molt-trader-skill 主动调用,或让 AI 根据上下文自动发现并使用。
Molt Trader Skill 支持 Claude、Cursor、OpenClaw,可与这些 AI 平台无缝集成,扩展其能力。
Molt Trader Skill 可免费安装使用。请查阅仓库了解许可证信息。
Simulate stock trading with long/short positions, manage portfolio, track performance, and compete on Molt Trader's leaderboard in a realistic market environ...
Molt Trader Skill 属于「Finance & Investment」分类,该分类的技能帮助 AI 智能体在此领域执行专业任务。
Automate my finance & investment tasks using Molt Trader Skill
Identifies repetitive steps in your workflow and sets up Molt Trader Skill to handle them automatically