Claude Skill Integration
Integrate SimuTrade (simutrade.ai) as a Claude Skill to enable conversational securities trading through Claude.
Overview
Claude Skills allow Claude to interact with external tools and APIs. By registering SimuTrade as a Claude Skill, users can instruct Claude to check prices, place orders, and manage their simulated portfolios through natural language conversation.
Natural Language Trading
"Buy 10 shares of Apple" - Claude handles the rest.
Conversational Portfolio
Ask about your positions, P&L, and market data naturally.
Instant Setup
Register once, trade through conversation immediately.
Skill Definition
Register the following tools as a Claude Skill to enable trading capabilities:
{
"name": "simutrade",
"description": "Simulated securities trading API supporting US stocks, HK stocks, and cryptocurrency. Allows checking prices, placing orders, and managing portfolios.",
"api_key_env": "TRADESIM_API_KEY",
"base_url": "https://api.simutrade.ai/v1",
"tools": [
{
"name": "get_quote",
"description": "Get the current price and market data for a stock or cryptocurrency. Use this to check prices before trading.",
"input_schema": {
"type": "object",
"properties": {
"symbol": {
"type": "string",
"description": "Trading symbol. US stocks: AAPL, GOOGL, TSLA. HK stocks: 0700.HK, 9988.HK. Crypto: BTC-USD, ETH-USD"
}
},
"required": ["symbol"]
}
},
{
"name": "place_order",
"description": "Place a buy or sell order for a stock or cryptocurrency. Supports market, limit, and stop orders.",
"input_schema": {
"type": "object",
"properties": {
"symbol": {
"type": "string",
"description": "Trading symbol (e.g., AAPL, 0700.HK, BTC-USD)"
},
"side": {
"type": "string",
"enum": ["buy", "sell"],
"description": "Order side - buy or sell"
},
"type": {
"type": "string",
"enum": ["market", "limit", "stop"],
"description": "Order type. Use 'market' for immediate execution at current price"
},
"quantity": {
"type": "number",
"description": "Number of shares or units to trade"
},
"price": {
"type": "number",
"description": "Limit or stop price. Required for limit and stop orders, ignored for market orders"
}
},
"required": ["symbol", "side", "type", "quantity"]
}
},
{
"name": "get_portfolio",
"description": "Get the current portfolio summary including cash balance, positions, and P&L",
"input_schema": {
"type": "object",
"properties": {}
}
},
{
"name": "list_orders",
"description": "List recent orders with optional status filter",
"input_schema": {
"type": "object",
"properties": {
"status": {
"type": "string",
"enum": ["pending", "filled", "cancelled"],
"description": "Filter orders by status"
},
"limit": {
"type": "integer",
"description": "Number of orders to return (default: 10)"
}
}
}
},
{
"name": "cancel_order",
"description": "Cancel a pending order by its ID",
"input_schema": {
"type": "object",
"properties": {
"order_id": {
"type": "string",
"description": "The order ID to cancel"
}
},
"required": ["order_id"]
}
},
{
"name": "create_risk_control_rule",
"description": "Create a risk control rule with structured risk metrics and AI metadata. Rules can be set at order, position, or account level. IMPORTANT: You MUST always provide the reason field and SHOULD include risk assessment data (max_loss, max_loss_percent, risk_reward_ratio, volatility) and comprehensive metadata (ai, strategy, market, triggerConditions) to enable proper risk tracking and AI self-review. These fields document your decision-making process and enable better risk management analysis.",
"input_schema": {
"type": "object",
"properties": {
"rule_type": {
"type": "string",
"enum": ["stop_loss", "take_profit", "trailing_stop", "position_limit"],
"description": "Type of risk control rule"
},
"config": {
"type": "object",
"description": "Rule configuration (type: absolute/percentage, price/percentage/distance values, enabled flag)"
},
"order_id": {
"type": "string",
"description": "Optional: Order ID for order-level rules"
},
"symbol": {
"type": "string",
"description": "Optional: Symbol for position-level rules"
},
"reason": {
"type": "string",
"description": "REQUIRED: Human-readable explanation for setting this rule. You MUST provide a clear reason explaining why this rule is being created, including technical analysis, market conditions, or risk considerations. Example: 'Based on RSI indicator (72) showing overbought condition and MACD divergence signal, setting 5% stop loss to protect existing profits'"
},
"max_loss": {
"type": "number",
"description": "RECOMMENDED: Maximum loss amount in currency (e.g., 5000.0). Calculate based on position size and stop loss percentage."
},
"max_loss_percent": {
"type": "number",
"description": "RECOMMENDED: Maximum loss percentage (e.g., 5.0 for 5%). Should match the stop loss percentage in config if applicable."
},
"risk_reward_ratio": {
"type": "number",
"description": "RECOMMENDED: Risk-reward ratio (e.g., 2.0 for 2:1). Calculate as potential profit divided by potential loss."
},
"volatility": {
"type": "number",
"description": "RECOMMENDED: Volatility metric (e.g., 0.15 for 15%). Use historical volatility or implied volatility if available."
},
"metadata": {
"type": "object",
"description": "RECOMMENDED: AI metadata and extended information. You should include: ai (confidence, model, reasoning, decision_factors), strategy (id, name, params), market (trend, support, resistance, current_price), and trigger_conditions (technical_indicators, price_levels). This metadata enables AI self-review and better decision tracking.",
"properties": {
"ai": {
"type": "object",
"description": "AI metadata",
"properties": {
"confidence": {"type": "number", "description": "Confidence level 0-1"},
"model": {"type": "string", "description": "AI model name (e.g., 'claude-3.5-sonnet')"},
"reasoning": {"type": "string", "description": "AI reasoning process"},
"decision_factors": {"type": "array", "items": {"type": "string"}, "description": "List of decision factors"}
}
},
"strategy": {
"type": "object",
"description": "Strategy information",
"properties": {
"id": {"type": "string"},
"name": {"type": "string"},
"params": {"type": "object"}
}
},
"market": {
"type": "object",
"description": "Market analysis",
"properties": {
"trend": {"type": "string", "enum": ["up", "down", "sideways"]},
"support": {"type": "number"},
"resistance": {"type": "number"},
"current_price": {"type": "number"}
}
},
"trigger_conditions": {
"type": "object",
"description": "Trigger condition details",
"properties": {
"technical_indicators": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {"type": "string"},
"value": {"type": "number"},
"threshold": {"type": "number"},
"condition": {"type": "string", "enum": ["above", "below", "cross"]}
}
}
},
"price_levels": {
"type": "array",
"items": {
"type": "object",
"properties": {
"type": {"type": "string", "enum": ["support", "resistance", "target"]},
"price": {"type": "number"}
}
}
}
}
}
}
}
},
"required": ["rule_type", "config", "reason"]
}
},
{
"name": "list_risk_control_rules",
"description": "List risk control rules with optional filters",
"input_schema": {
"type": "object",
"properties": {
"order_id": {
"type": "string",
"description": "Filter by order ID"
},
"symbol": {
"type": "string",
"description": "Filter by symbol"
},
"rule_type": {
"type": "string",
"enum": ["stop_loss", "take_profit", "trailing_stop", "position_limit"],
"description": "Filter by rule type"
},
"is_active": {
"type": "boolean",
"description": "Filter by active status"
}
}
}
},
{
"name": "list_risk_control_executions",
"description": "List risk control execution records showing when rules were triggered",
"input_schema": {
"type": "object",
"properties": {
"rule_id": {
"type": "string",
"description": "Filter by rule ID"
},
"status": {
"type": "string",
"enum": ["triggered", "executed", "cancelled"],
"description": "Filter by execution status"
},
"limit": {
"type": "integer",
"description": "Number of records to return (default: 50)"
}
}
}
}
]
}Above uses production API at simutrade.ai. For local development, set base_url to http://localhost:8080/v1.
Conversation Examples
Here are examples of how users can interact with Claude using the SimuTrade skill:
Example 1: Check price and buy stock
User:
"What's the current price of Apple? If it's under $200, buy me 10 shares."
Claude (uses get_quote):
"Apple (AAPL) is currently trading at $189.84, up 1.25% today. Since it's under $200, I'll place a market buy order for 10 shares."
Claude (uses place_order):
"Done! I've placed a market buy order for 10 shares of AAPL. Order ID: ord-abc123, status: pending. It should fill shortly at around $189.84 per share, totaling approximately $1,898.40."
Example 2: Portfolio review
User:
"Show me my portfolio. How am I doing today?"
Claude (uses get_portfolio):
"Here's your portfolio summary:
- Total Value: $145,678.90 (+0.86% today)
- Cash Balance: $53,922.70
- Holdings: $91,756.20
- Today's P&L: +$1,245.30
Your top performers today are NVDA (+2.58%) and TSLA (+2.33%)."
Example 3: Crypto trading
User:
"Set a limit buy for 0.5 BTC at $42,000"
Claude (uses place_order):
"I've placed a limit buy order for 0.5 BTC at $42,000. Order ID: ord-xyz789. The current BTC price is $43,250, so the order will fill if the price drops to your target. Total cost when filled: $21,000."
Example 4: Risk control management
User:
"Set a 5% stop loss for my AAPL position"
Claude (uses create_risk_control_rule):
"I've created a stop loss rule for your AAPL position. The rule will trigger an alert if the price drops 5% below your entry price. The system checks risk control rules every 30 seconds automatically."
User:
"Show me my risk control rules and any triggered executions"
Claude (uses list_risk_control_rules and list_risk_control_executions):
"You have 3 active risk control rules:
- Stop loss for AAPL: 5% below entry
- Take profit for MSFT: $420 target price
- Position limit: Max 20% of portfolio in single position
No rules have been triggered recently. The system will automatically check and alert you if any conditions are met."
Risk Control Module
The risk control module allows you to set up automated risk management rules that are checked every 30 seconds. Rules can be set at three levels:
- Order-level: Rules attached to specific orders (e.g., take profit on a buy order)
- Position-level: Rules for specific holdings (e.g., stop loss for AAPL position)
- Account-level: Portfolio-wide rules (e.g., maximum position size limits)
When a risk control rule is triggered, the system creates an execution record with status "triggered". The system only records and alerts - it does not automatically execute trades. You can query execution records to see when rules were triggered and take appropriate action.
Supported Rule Types
Available Tools
create_risk_control_rule - Create new rulelist_risk_control_rules - List all ruleslist_risk_control_executions - View execution historySetup Steps
Get Your API Key
Create an API key from the SimuTrade Settings page (simutrade.ai) with read and trade permissions.
Configure Environment Variable
export TRADESIM_API_KEY=ts_live_a1b2c3d4e5f6g7h8i9j0Register the Skill
Use the skill definition JSON above to register SimuTrade as a Claude Skill in your application. Claude will automatically discover and use the available trading tools.
Start Trading with Claude
Ask Claude to check prices, buy/sell stocks, review your portfolio, or manage orders. Claude will intelligently decide which tools to use based on your request.
Recommended System Prompt
For best results, include this context in your system prompt:
You are a trading assistant with access to SimuTrade, a simulated securities trading platform (simutrade.ai).
You can help users:
- Check real-time prices for US stocks, HK stocks, and cryptocurrency
- Place buy/sell orders (market, limit, stop)
- Review portfolio positions and P&L
- Monitor and cancel pending orders
Always confirm with the user before placing orders. Show relevant price data
when discussing trades. Use the get_quote tool before suggesting trades
to ensure you have current pricing information.
Supported markets:
- US Stocks: AAPL, GOOGL, TSLA, NVDA, MSFT, META, AMZN, AMD, etc.
- HK Stocks: 0700.HK, 9988.HK, 0005.HK, 1810.HK, etc.
- Crypto: BTC-USD, ETH-USD, SOL-USD, BNB-USD, XRP-USD, etc.