
Strategy
- 12 installs
- 610 repo stars
- Updated June 26, 2026
- alsk1992/cloddsbot
Strategy is a Claude Code skill for the clodds bot that builds and manages custom trading strategies from natural language or templates.
About
Strategy is a clodds skill that lets developers create custom trading strategies from natural language or templates and deploy them to live trading. It supports entry/exit conditions, risk limits, dry-run testing, backtesting, and validation before going live. It matters for defining and running automated trading logic without hand-coding each rule.
- Builds trading strategies from natural language or templates
- Seven built-in templates (momentum, mean-reversion, arbitrage, breakout, pairs, news-reactive, volume-spike)
- Dry-run and backtest before deploying to live trading with risk limits
Strategy by the numbers
- 12 all-time installs (skills.sh)
- Ranked #781 of 1,106 Finance & Trading skills by installs in the Skillselion catalog
- Data as of Aug 5, 2026 (Skillselion catalog sync)
strategy capabilities & compatibility
- Capabilities
- strategy builder · backtesting · automated trading
- Use cases
- trading
- Pricing
- Free
What strategy says it does
Create custom trading strategies using natural language or templates, then deploy to live trading.
Always dry-run first
npx skills add https://github.com/alsk1992/cloddsbot --skill strategyAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 12 |
|---|---|
| repo stars | ★ 610 |
| Last updated | June 26, 2026 |
| Repository | alsk1992/cloddsbot ↗ |
What it does
Create a trading strategy from natural language or a template, backtest it, then deploy it live with risk limits.
Who is it for?
Defining automated trading strategies via natural language or templates with dry-run and backtest gates.
Skip if: Discretionary manual trading or non-trading automation.
When should I use this skill?
You want to build, validate, and deploy an automated trading strategy.
What you get
A validated, backtested strategy runs live with configured entry/exit conditions and risk limits.
- custom strategy
- backtest result
- live deployment
By the numbers
- 7 built-in templates
- 7 condition types (price, volume24h, spread, profit, loss, holdTime, priceChange)
Files
Strategy - Complete API Reference
Create custom trading strategies using natural language or templates, then deploy to live trading.
---
Chat Commands
Create Strategy
/strategy create "Buy when price drops 5% in 1 hour"
/strategy create momentum --lookback 14 --threshold 2%
/strategy from-template mean-reversionManage Strategies
/strategies List all strategies
/strategy <name> View strategy details
/strategy edit <name> Modify strategy
/strategy delete <name> Remove strategyActivate/Deactivate
/strategy activate <name> Start running strategy
/strategy deactivate <name> Stop strategy
/strategy pause <name> Pause temporarily
/strategy resume <name> Resume paused strategyTest & Validate
/strategy test <name> --dry-run Test without real trades
/strategy backtest <name> Run backtest
/strategy validate <name> Check for errors---
TypeScript API Reference
Create Strategy Builder
import { createStrategyBuilder } from 'clodds/strategy';
const builder = createStrategyBuilder({
// Validation
requireDryRun: true,
validateParameters: true,
// Storage
storage: 'sqlite',
dbPath: './strategies.db',
});Natural Language Strategy
// Create from natural language
const strategy = await builder.fromNaturalLanguage({
description: `
Buy YES on any market when:
- Price drops more than 5% in the last hour
- Volume is above average
- Spread is less than 2%
Sell when:
- Price recovers 3% from entry
- Or after 24 hours (timeout)
Risk: Max 5% of portfolio per trade
`,
name: 'dip-buyer',
});
console.log(`Created: ${strategy.name}`);
console.log(`Conditions: ${strategy.conditions.length}`);Template-Based Strategy
// Momentum strategy
const momentum = await builder.fromTemplate('momentum', {
lookbackPeriod: 14,
entryThreshold: 0.02,
exitThreshold: 0.01,
stopLoss: 0.05,
takeProfit: 0.10,
maxPositionPct: 10,
});
// Mean reversion strategy
const meanReversion = await builder.fromTemplate('mean-reversion', {
lookbackPeriod: 20,
deviationThreshold: 2, // Standard deviations
exitOnMean: true,
stopLoss: 0.08,
});
// Arbitrage strategy
const arbitrage = await builder.fromTemplate('arbitrage', {
minSpread: 0.02,
platforms: ['polymarket', 'kalshi'],
maxSlippage: 0.01,
});
// Breakout strategy
const breakout = await builder.fromTemplate('breakout', {
rangePeriod: '7d',
breakoutThreshold: 0.05,
confirmationVolume: 1.5, // 1.5x average volume
});Custom Strategy Code
// Full custom strategy
const custom = await builder.create({
name: 'my-custom-strategy',
description: 'Buy low-priced markets with high volume',
// Entry conditions (all must be true)
entryConditions: [
{ type: 'price', operator: '<', value: 0.30 },
{ type: 'volume24h', operator: '>', value: 50000 },
{ type: 'spread', operator: '<', value: 0.02 },
],
// Exit conditions (any triggers exit)
exitConditions: [
{ type: 'profit', operator: '>=', value: 0.15 },
{ type: 'loss', operator: '>=', value: 0.10 },
{ type: 'holdTime', operator: '>=', value: '48h' },
],
// Risk management
risk: {
maxPositionPct: 5,
stopLoss: 0.10,
takeProfit: 0.20,
maxConcurrentPositions: 5,
},
// Execution
execution: {
orderType: 'limit',
limitBuffer: 0.005,
retries: 3,
},
});Validate Strategy
const validation = await builder.validate(strategy);
if (validation.valid) {
console.log('✅ Strategy is valid');
} else {
console.log('❌ Validation errors:');
for (const error of validation.errors) {
console.log(` - ${error}`);
}
}
// Warnings (not blocking)
for (const warning of validation.warnings) {
console.log(`⚠️ ${warning}`);
}Activate Strategy
// Start with dry-run first (required)
await builder.activate(strategy.name, {
dryRun: true,
notifyOnTrade: true,
});
// After validation, go live
await builder.activate(strategy.name, {
dryRun: false,
capital: 5000, // Allocate $5000
});Monitor Strategy
const status = await builder.getStatus(strategy.name);
console.log(`Status: ${status.status}`); // 'active' | 'paused' | 'stopped'
console.log(`Trades: ${status.trades}`);
console.log(`P&L: $${status.pnl}`);
console.log(`Win Rate: ${status.winRate}%`);
console.log(`Active Positions: ${status.activePositions}`);
console.log(`Last Signal: ${status.lastSignal}`);List Strategies
const strategies = await builder.list();
for (const s of strategies) {
console.log(`${s.name}: ${s.status}`);
console.log(` Type: ${s.template || 'custom'}`);
console.log(` P&L: $${s.pnl}`);
console.log(` Trades: ${s.trades}`);
}---
Built-in Templates
| Template | Description |
|---|---|
momentum | Follow price trends |
mean-reversion | Buy dips, sell rallies |
arbitrage | Cross-platform spreads |
breakout | Range breakout entries |
pairs | Correlated market pairs |
news-reactive | React to news events |
volume-spike | Trade on volume surges |
---
Condition Types
| Type | Description | Example |
|---|---|---|
price | Current price | < 0.30 |
volume24h | 24h volume | > 50000 |
spread | Bid-ask spread | < 0.02 |
profit | Unrealized profit | >= 0.15 |
loss | Unrealized loss | >= 0.10 |
holdTime | Time in position | >= 48h |
priceChange | Price change % | < -0.05 (5% drop) |
---
Best Practices
1. Always dry-run first — Test before real money 2. Start small — Low capital until proven 3. Set stop-losses — Protect against bad trades 4. Monitor actively — Check strategy performance 5. Iterate — Improve based on results
/**
* Strategy CLI Skill
*
* Commands:
* /strategy list - List strategy templates
* /strategy create <name> <template> - Create strategy
* /strategy start <name> - Start a bot
* /strategy stop <name> - Stop a bot
* /strategy status - Bot status
*/
import type { StrategyTemplate } from '../../../trading/builder';
async function execute(args: string): Promise<string> {
const parts = args.trim().split(/\s+/);
const cmd = parts[0]?.toLowerCase() || 'help';
try {
const { createStrategyBuilder } = await import('../../../trading/builder');
const { initDatabase } = await import('../../../db/index');
const db = await initDatabase();
const builder = createStrategyBuilder(db);
switch (cmd) {
case 'list': {
const templates = builder.listTemplates();
let output = '**Available Strategy Templates**\n\n';
for (let i = 0; i < templates.length; i++) {
output += `${i + 1}. **${templates[i].name}** - ${templates[i].description}\n`;
}
output += '\nUse `/strategy create <name> <template>` to create one.';
return output;
}
case 'create': {
const name = parts[1];
const template = parts[2] as StrategyTemplate;
if (!name || !template) return 'Usage: /strategy create <name> <template>';
const validTemplates: StrategyTemplate[] = ['mean_reversion', 'momentum', 'arbitrage', 'price_threshold', 'volume_spike', 'custom'];
if (!validTemplates.includes(template)) {
return `Invalid template: ${template}\nAvailable: ${validTemplates.join(', ')}`;
}
const params = builder.getTemplateParams(template);
const definition = {
name,
template,
platforms: ['polymarket' as const],
entry: [{ type: 'price_below' as const, value: 0.5 }],
exit: [{ type: 'take_profit' as const, value: 10 }, { type: 'stop_loss' as const, value: 5 }],
risk: { maxPositionSize: 100, stopLossPct: 5, takeProfitPct: 10 },
dryRun: true,
};
const validation = builder.validate(definition);
if (!validation.valid) {
return `Validation errors:\n${validation.errors.map(e => `- ${e}`).join('\n')}`;
}
const id = builder.saveDefinition('cli', definition);
let output = `Strategy "${name}" created (ID: ${id})\n`;
output += `Template: ${template}\n`;
output += `Dry-run: enabled (test before going live)\n\n`;
output += `**Default Parameters**\n`;
for (const [key, val] of Object.entries(params)) {
output += ` ${key}: ${val.default} (${val.description})\n`;
}
return output;
}
case 'start': {
if (!parts[1]) return 'Usage: /strategy start <name>';
const defs = builder.loadDefinitions('cli');
const match = defs.find(d => d.definition.name === parts[1]);
if (!match) return `Strategy "${parts[1]}" not found. Use \`/strategy status\` to list saved strategies.`;
const strategy = builder.createStrategy(match.definition);
return `Bot "${parts[1]}" started in ${match.definition.dryRun ? 'dry-run' : 'LIVE'} mode.\nStrategy ID: ${match.id}`;
}
case 'stop': {
if (!parts[1]) return 'Usage: /strategy stop <name>';
return `Bot "${parts[1]}" stopped.`;
}
case 'status': {
const defs = builder.loadDefinitions('cli');
if (defs.length === 0) return 'No saved strategies. Create one with `/strategy create`.';
let output = '**Saved Strategies**\n\n';
for (const d of defs) {
output += `- **${d.definition.name}** (${d.definition.template}) - created ${d.createdAt.toLocaleDateString()}\n`;
}
return output;
}
case 'backtest': {
if (!parts[1]) return 'Usage: /strategy backtest <name> [--days 30]';
const defs = builder.loadDefinitions('cli');
const match = defs.find(d => d.definition.name === parts[1]);
if (!match) return `Strategy "${parts[1]}" not found.`;
return `Backtesting "${parts[1]}" (${match.definition.template} template)...\n\nBacktest requires historical data. Use the backtest engine API for full results.`;
}
case 'delete': {
if (!parts[1]) return 'Usage: /strategy delete <name>';
const defs = builder.loadDefinitions('cli');
const match = defs.find(d => d.definition.name === parts[1]);
if (!match) return `Strategy "${parts[1]}" not found.`;
builder.deleteDefinition('cli', match.id);
return `Strategy "${parts[1]}" deleted.`;
}
default:
return helpText();
}
} catch (error) {
return `Strategy error: ${error instanceof Error ? error.message : String(error)}`;
}
}
function helpText(): string {
return `**Strategy Commands**
/strategy list - List templates
/strategy create <name> <template> - Create strategy
/strategy start <name> - Start bot
/strategy stop <name> - Stop bot
/strategy status - Saved strategies
/strategy backtest <name> - Backtest strategy
/strategy delete <name> - Delete strategy
Templates: mean_reversion, momentum, arbitrage, price_threshold, volume_spike, custom`;
}
export default {
name: 'strategy',
description: 'Trading bot strategy builder with templates and backtesting',
commands: ['/strategy', '/strat'],
handle: execute,
};
Related skills
FAQ
How are strategies created?
From natural-language descriptions, from built-in templates, or from full custom entry/exit condition code.
Can I test before risking money?
Yes, dry-run is required first, and backtesting and validation run before going live.