소스 정보
- 저장소
- alsk1992/CloddsBot
- 최근 소스 활동
- 2026년 2월 10일 15:14
- 감지된 SKILL.md 언어
- 영어
- 스타
- 716
- 포크
- 155
설치 방법
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
소스 파일 검토
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
메뉴
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
직접 명령은 검토 Prompt를 거치지 않습니다. 실행하기 전에 소스를 확인하세요.
npx skills add https://github.com/alsk1992/CloddsBot --skill backtest명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
SKILL.md 표시 중
| name | backtest |
| description | Test trading strategies on historical data with Monte Carlo simulation |
| emoji | 📈 |
Validate trading strategies using historical data, walk-forward analysis, and Monte Carlo simulation.
/backtest momentum --from 2024-01-01 --to 2024-12-31
/backtest mean-reversion --market "Trump 2028" --days 90
/backtest my-strategy --capital 10000
/backtest stats momentum Show strategy metrics
/backtest compare momentum arb Compare two strategies
/backtest monte-carlo momentum Run Monte Carlo simulation
/backtest results Show recent results
/backtest stats Alias for results
/backtest results <id> --detailed Detailed breakdown
/backtest export Export last results as CSV
import { createBacktestEngine } from 'clodds/backtest';
const backtest = createBacktestEngine({
// Data source
dataSource: 'polymarket', // or custom data provider
// Capital
initialCapital: 10000,
// Fees (Polymarket: 0% on most markets; Kalshi: ~1.2% avg)
fees: {
maker: 0, // 0% maker fee (Polymarket most markets)
taker: 0, // 0% taker fee (Polymarket most markets)
// For 15-min crypto markets or Kalshi, use: taker: 0.012
},
// Slippage model
slippageModel: 'realistic', // 'none' | 'fixed' | 'realistic'
slippageBps: 10,
});
const result = await backtest.run({
strategy: 'momentum',
startDate: '2024-01-01',
endDate: '2024-12-31',
parameters: {
lookbackPeriod: 14,
entryThreshold: 0.02,
exitThreshold: 0.01,
},
});
console.log(`Total Return: ${result.totalReturn}%`);
console.log(`Sharpe Ratio: ${result.sharpeRatio}`);
console.log(`Max Drawdown: ${result.maxDrawdown}%`);
console.log(`Win Rate: ${result.winRate}%`);
console.log(`Profit Factor: ${result.profitFactor}`);
// Out-of-sample validation
const wf = await backtest.walkForward({
strategy: 'momentum',
startDate: '2023-01-01',
endDate: '2024-12-31',
// Train/test split
trainPeriod: '6M',
testPeriod: '1M',
step: '1M',
// Optimization
optimize: ['lookbackPeriod', 'entryThreshold'],
optimizationMetric: 'sharpe',
});
console.log(`In-Sample Sharpe: ${wf.inSampleSharpe}`);
console.log(`Out-of-Sample Sharpe: ${wf.outOfSampleSharpe}`);
console.log(`Overfitting Ratio: ${wf.overfitRatio}`);
// Stress test with randomization
const mc = await backtest.monteCarlo({
strategy: 'momentum',
trades: historicalTrades,
// Simulation settings
simulations: 10000,
confidenceLevel: 0.95,
// Randomization
shuffleTrades: true,
randomizeReturns: true,
});
console.log(`Expected Return: ${mc.expectedReturn}%`);
console.log(`95% VaR: ${mc.valueAtRisk}%`);
console.log(`Worst Case: ${mc.worstCase}%`);
console.log(`Best Case: ${mc.bestCase}%`);
console.log(`Probability of Profit: ${mc.probProfit}%`);
const metrics = await backtest.getMetrics(result);
console.log('=== Performance ===');
console.log(`Total Return: ${metrics.totalReturn}%`);
console.log(`CAGR: ${metrics.cagr}%`);
console.log(`Volatility: ${metrics.volatility}%`);
console.log('=== Risk ===');
console.log(`Sharpe Ratio: ${metrics.sharpeRatio}`);
console.log(`Sortino Ratio: ${metrics.sortinoRatio}`);
console.log(`Max Drawdown: ${metrics.maxDrawdown}%`);
console.log(`Max Drawdown Duration: ${metrics.maxDrawdownDuration} days`);
console.log('=== Trading ===');
console.log(`Total Trades: ${metrics.totalTrades}`);
console.log(`Win Rate: ${metrics.winRate}%`);
console.();
.();
.();
.();
// Define custom strategy
const myStrategy = {
name: 'my-strategy',
onData: async (data, context) => {
const price = data.price;
const sma = data.indicators.sma(20);
if (price < sma * 0.95 && !context.hasPosition) {
return { action: 'buy', size: context.availableCapital * 0.1 };
}
if (price > sma * 1.05 && context.hasPosition) {
return { action: 'sell', size: 'all' };
}
return { action: 'hold' };
},
};
const result = await backtest.run({
strategy: myStrategy,
startDate: '2024-01-01',
endDate: '2024-12-31',
});
| Strategy | Description |
|---|---|
momentum | Follow price trends |
mean-reversion | Buy dips, sell rallies |
arbitrage | Cross-platform price differences |
breakout | Enter on range breakouts |
pairs | Correlated market pairs |
| Metric | Good Value | Description |
|---|---|---|
| Sharpe Ratio | > 1.0 | Risk-adjusted return |
| Sortino Ratio | > 1.5 | Downside-adjusted return |
| Max Drawdown | < 20% | Worst peak-to-trough |
| Win Rate | > 50% | Winning trades % |
| Profit Factor | > 1.5 | Gross profit / gross loss |
| Expectancy | > 0 | Expected $ per trade |
SOC 직업 분류 기준