내 전략 코드 백테스트
meritz_backtest_codeBacktest customer Python trading strategies in an isolated sandbox using demo or Meritz market data, then return a Claude report with simulated fills, fees, and slippage.
Instructions
고객 Python 코드를 격리 실행 환경에서 백테스트하고 Claude 보고서를 표시합니다.
단일파일 def on_bar(ctx): → {'action':'buy'|'sell'|'hold','quantity':선택정수,'reason':선택문자열}. ctx에는 bar, history(현재까지), portfolio(cash/shares), index가 있습니다. 실제 코드만 받고 경로나 키는 받지 않습니다. 파일은 사용자가 선택해 읽은 내용을 전달하세요. source를 반드시 선택하세요. meritz는 symbol·startDate·endDate를 모두 지정해야 고객 계좌키로 시세를 조회합니다. demo는 합성 시세이며 symbol·startDate·endDate·account 값을 함께 지정할 수 없습니다. 표준 라이브러리만 지원. 파일·네트워크·자식프로세스 접근 차단, 최대20초, 메모리는 20ms 간격 감시(하드 상한 아님), 단일종목 일봉 다음봉 시가 가상체결. macOS 에서 소스로 실행할 때만 지원하며 단일 실행 파일(.mcpb·바이너리)에서는 거부됩니다. 실패시 격리 없는 실행이나 합성 시세로 대체하지 않습니다.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"code": "<code>",
"source": "<source>"
},
"name": "meritz_backtest_code"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | ||
| feeBps | No | ||
| source | Yes | ||
| symbol | No | ||
| account | No | ||
| endDate | No | ||
| startDate | No | ||
| initialCash | No | ||
| slippageBps | No |