{"id":107015,"plugin_id":"plugin_asdk_app_6aedef59f1108191bf9c15562066e8e5","kind":"skill","collection_source":"plugin_package","comparison_source":null,"observed_at":"2026-11-20T00:12:43.073Z","digest":"0680457c1e433b79651c59e716cb7b6c78cfd486a67863079b2549cc4fb7cb03","against":null,"payload":{"description":"Backtest a trading idea on historical candles with cubrik and read the result honestly. Use when the user asks to backtest, test, simulate or \"check if this would have worked\" — an indicator rule (RSI, EMA crossover, MACD, Bollinger, SuperTrend), a smart-money setup (sweep, order block, fair value gap, break of structure), a breakout, or a regular buy (DCA). Writes the rules in cubrik's rule format, runs run_backtest, follows it with get_backtest until it finishes, and reports return, drawdown, win rate and trades with the assumptions — never as a promise.","included_files":[{"relative_path":"agents/openai.yaml","size_in_bytes":500},{"relative_path":"references/rules.md","size_in_bytes":4046}],"name":"cubrik-backtesting","skill_md_contents":"---\nname: cubrik-backtesting\ndescription: Backtest a trading idea on historical candles with cubrik and read the result honestly. Use when the user asks to backtest, test, simulate or \"check if this would have worked\" — an indicator rule (RSI, EMA crossover, MACD, Bollinger, SuperTrend), a smart-money setup (sweep, order block, fair value gap, break of structure), a breakout, or a regular buy (DCA). Writes the rules in cubrik's rule format, runs run_backtest, follows it with get_backtest until it finishes, and reports return, drawdown, win rate and trades with the assumptions — never as a promise.\n---\n\nA backtest runs the idea's rules over stored candles and simulates every trade. It changes nothing\non any account and costs no credits. The result is only as good as the rules match the idea, so\nthe work is in writing the rules right, then in reading the numbers without overselling them.\n\n## 1. Pin the plan down\n\nAsk in ONE message only for what is missing: the market(s), the timeframe (1m, 5m, 15m, 1h, 4h,\n1D), the entry, the exit (stop %, target % or none, signal exits, a maximum time in trade), the\nrisk per trade and the leverage. A regular buy (DCA) needs only the pair, how often and the amount.\n\nDefaults you may use without asking: 12 months of history, a 10,000 starting balance (leave\n`starting_balance` out unless the user named one).\n\n## 2. Write the rules\n\n`run_backtest` takes the rules as structured data — its schema describes every operand. The\nmistakes that make a backtest silently wrong are in `references/rules.md`; read it the first time\nyou write rules in a conversation. The four that matter most:\n\n1. **A sequence needs `within`.** \"A sweep, then a reclaim\" is two conditions; the earlier one\n   carries `within: 10`–`30` bars, or both must be true on the same bar and it never trades.\n2. **Compare like with like.** An oscillator against a number or another oscillator; a price\n   against a price. \"RSI above the price\" is refused.\n3. **No fixed target is `takeProfitPct: null`**, never a far target standing in for it.\n4. **A regular buy is `accumulate: { amount }`**, long, leverage 1, on the spot pair (BTC/USDT, not\n   BTC/USDT:USDT). Without it the \"daily buy\" is one trade held for the whole window.\n\nUse the perpetual spelling (SOL/USDT:USDT) whenever the plan uses leverage. If unsure a market\nexists, call `list_instruments` rather than assuming it does not.\n\n## 3. Run it and follow it\n\nCall `run_backtest`. It returns a `backtest_id` (and a `batch` of ids, one per symbol, when there\nare several) and runs in the background. Call `get_backtest` with the id a few seconds later; while\n`status` is `queued` or `running`, wait and ask again. In apps that show cubrik's screens, the\nbacktest card follows the run by itself and draws the equity curve when it is done.\n\nIf the answer is `too_many_backtests`, the account already has runs going: say so and read those\ninstead of starting more.\n\n## 4. Report it honestly\n\nLead with the four figures, then what they mean:\n\n- **Return** and **maximum drawdown** together — a return means nothing without the fall it took.\n- **Win rate** and **number of trades** — under ~30 trades is little evidence; say so.\n- **Profit factor** when present (gross profit ÷ gross loss; above 1.3 is worth a look).\n- **Month by month**: was it one lucky month? Compare with the market's own move (`pricePct`).\n- The **assumptions** listed in `methodology` (fees, fills, what is not simulated).\n\nThen, if they want it live, hand over to the skill `cubrik-agent-builder` with the same rules in words.\n\n## Rules\n\n- Always say the figures are simulated on historical candles and are not a forecast.\n- Never state a return, win rate or drawdown that did not come back from `get_backtest`.\n- Do not tune parameters until the past looks good and present that as an edge: if the user\n  optimises, say plainly that a rule fitted to the past tends to do worse on new data.\n- A failed backtest has a reason (`failure`): `timeframe_unavailable` means that market keeps no\n  history on that timeframe (try 1h or longer); `no_candles` and `not_enough_history` mean the\n  stored history is missing or too short. Say which; do not estimate a result.\n"},"changes":[],"summary":"First saved snapshot. No earlier version is available for comparison.","summary_kind":"deterministic","summary_metadata":{}}