{"id":"633e6afd-769a-4843-b0a7-67f781f2dc0d","authorId":"08398a34-26f5-4992-82de-0cfba0302908","title":"I Asked an AI Agent to Find a Tradable Candlestick Pattern. It Refused to Pretend Three Trades Were Proof.","slug":"i-asked-an-ai-agent-to-find-a-tradable-candlestick-pattern-it-refused-to-pretend-three-trades-were-proof","excerpt":"A native RLXBT agent searched for a BTC 1h Morning Star, froze the pattern before evaluation, beat a directional baseline—and still refused to call three trades a validated strategy.","content":"# I Asked an AI Agent to Find a Tradable Candlestick Pattern. It Refused to Pretend Three Trades Were Proof.\n\n**Verdict:** marginal / needs more data · **Asset/TF:** BTC 1h · **Sample:** 4,379 strictly post-selection bars, 2025-06-11 to 2025-12-11\n\n## Hypothesis\n\nCandlestick-pattern tools usually answer the easiest question: “does this chart look like a Morning Star?” The harder and more useful question is: “when this geometry appeared before, after costs and without leaking the discovery sample into the test, did it produce a repeatable edge?”\n\nI asked an agent connected to the native RLXBT macOS app to search for a bullish three-candle Morning Star, freeze the discovered pattern, validate it on data that became available only after selection, archive the complete experiment, and make the same frozen pattern usable as a live signal.\n\nThe interesting result was not a new buy signal. It was a research workflow that knew when **not** to promote one.\n\n## Strategy\n\nRLXBT represents the three candles as scale-free geometry: signed body, upper and lower wick, relative range, gaps, and cumulative close path. This makes the query comparable across different price levels instead of matching absolute BTC prices.\n\nThe exact pattern and gate were frozen before evaluation:\n\n```json\n{\n  \"pattern_id\": \"morning_star_btc_1h\",\n  \"candles\": [\n    { \"open\": 104.0, \"high\": 104.5, \"low\": 98.5, \"close\": 99.0 },\n    { \"open\": 98.6, \"high\": 99.5, \"low\": 97.5, \"close\": 98.8 },\n    { \"open\": 99.2, \"high\": 104.0, \"low\": 98.9, \"close\": 103.5 }\n  ],\n  \"entry_rules\": [\n    {\n      \"condition\": \"candlestick_similarity_b4121b6f3ec7 >= 0.84678770\",\n      \"direction\": 1,\n      \"signal\": \"pattern_long\"\n    }\n  ],\n  \"exit_rules\": [],\n  \"max_hold_bars\": 24,\n  \"position_size\": 1.0,\n  \"commission\": 0.0005,\n  \"slippage\": 0.0002\n}\n```\n\nThe feature was causal: every value before `feature_available_from_timestamp` was forced to `NaN`. The threshold was not swept on the reserved tail.\n\n## Backtest\n\n| Metric | Value |\n|---|---:|\n| Strictly post-availability bars | 4,379 |\n| Total return | +4.162% |\n| Sharpe | 1.942 |\n| Max drawdown | 1.987% |\n| Trades / win rate | 3 / 100% |\n| Directional long baseline | -16.846% |\n| Commission / slippage | 5 bps / 2 bps |\n\nAt first glance this looks excellent: positive return, high Sharpe, shallow drawdown, and a large advantage over simply staying long during the same period.\n\nBut there were only three trades. A 100% win rate over three observations is not robust evidence; it is a reason to collect more data.\n\n## Robustness (the proof — do not skip)\n\n- **Temporal holdout:** passed structurally. All 4,379 evaluated bars occur after the pattern-selection availability boundary; 39,403 earlier bars were physically excluded from performance.\n- **Frozen gate:** passed. The similarity threshold, direction, holding period, and costs were fixed before the reserved tail was evaluated.\n- **Directional baseline:** passed. The pattern experiment beat the same-direction baseline on return and Sharpe.\n- **Walk-Forward:** not statistically available with only three trades; no WFE is reported.\n- **Monte-Carlo:** not statistically available with only three trades; no risk-of-ruin estimate is reported.\n- **Sensitivity:** no post-OOS parameter sweep was allowed.\n- **Final verdict:** `needs_more_data`. The candidate is archived for continued research, not authorized for live trading.\n\nThis distinction matters. “Out-of-sample” describes where evidence came from; it does not guarantee that there is enough evidence.\n\n## Research trail\n\nThe agent used RLXBT through MCP:\n\n`get_ai_instructions → search_candlestick_patterns → run_pattern_experiment → get_report → save_pattern_signal → evaluate_signal`\n\nHere is what each stage contributed:\n\n1. `search_candlestick_patterns` compared one-to-ten-candle OHLC combinations using scale-free geometry and empirical forward outcomes.\n2. `run_pattern_experiment` materialized one frozen rolling similarity feature, excluded all pre-availability rows, applied realistic costs, compared a directional baseline, attempted robustness checks, and archived the result automatically.\n3. `get_report` returned the complete reproducibility packet: dataset fingerprint, candles, feature method, availability boundary, threshold, costs, strategy, baseline, metrics, warnings, and verdict.\n4. `save_pattern_signal` stored the frozen candidate in the Pattern Library.\n5. `evaluate_signal` made the same definition usable on new closed candles. RLXBT computes similarity and returns `matched: true/false`; the calling execution system still owns position state, risk limits, and orders.\n\nThe report was then reopened after restarting the application. RLXBT restored the causal feature and reproduced return, Sharpe, and trade count with zero drift.\n\n## Why this changes agentic backtesting\n\nAn agent should not merely generate strategy JSON. It should leave behind an auditable research object.\n\nFor pattern research that object includes:\n\n- the exact drawing or candle combination;\n- a scale-independent similarity definition;\n- the timestamp when the selected idea first became available;\n- a frozen gate and direction;\n- realistic costs and holding rules;\n- a baseline;\n- robustness evidence—or an explicit record that evidence is insufficient;\n- a report ID that the user can reopen in the native dashboard;\n- a live evaluator that uses the same frozen specification.\n\nThat closes a gap found in many backtesting workflows: the visual idea, historical test, research report, and live signal are often four different implementations. In RLXBT they can be one reproducible object.\n\n## Reproduce\n\nLoad hourly BTC OHLCV data in the RLXBT macOS app, connect an MCP-compatible agent to:\n\n`http://127.0.0.1:8142/api/mcp/sse`\n\nAsk the agent to search for a three-candle Morning Star, freeze its similarity threshold and availability boundary, use non-zero commission and slippage, run `run_pattern_experiment`, and inspect the archived Report rather than judging the chart alone.\n\nThe reusable lesson is simple: **pattern discovery should produce a testable hypothesis, not an automatic trade.**\n","coverImage":null,"status":"published","publishedAt":"2026-08-03T13:32:01.480Z","backtestResults":{"bars":4379,"asset":"BTC","costs":{"slippage":0.0002,"commission":0.0005},"metrics":{"sharpe":1.941958384839847,"trades":3,"win_rate":100,"max_drawdown":1.98686423432949,"total_return":4.161652197796488},"verdict":"marginal","baseline":{"sharpe":-0.6860978941832839,"return_pct":-16.84649555248565},"strategy":{"exit_rules":[],"entry_rules":[{"signal":"pattern_long","condition":"candlestick_similarity_b4121b6f3ec7 >= 0.84678770","direction":1}]},"report_id":"rpt_1785759615140_0","timeframe":"1h","robustness":{"sensitivity_top_param":"not evaluated: insufficient trades","walk_forward_efficiency":null,"monte_carlo_risk_of_ruin":null},"tools_used":["get_ai_instructions","search_candlestick_patterns","run_pattern_experiment","get_report","save_pattern_signal","evaluate_signal"],"research_verdict":"needs_more_data","robustness_complete":false,"feature_available_from_timestamp":1749650400},"researchManifest":null,"viewCount":77,"likeCount":0,"metaTitle":null,"metaDescription":null,"createdAt":"2026-08-03T13:32:01.481Z","updatedAt":"2026-09-11T11:29:25.507Z","author":{"id":"08398a34-26f5-4992-82de-0cfba0302908","name":"Serg","picture":"https://lh3.googleusercontent.com/a/ACg8ocKJfy0qxMGacsuTCbRKqF2-Ahj7AqOXwzIJU2wBJye6JmKsh8A=s96-c"},"tags":[{"id":"1efea171-0bd7-4b21-91fd-91945ee771ab","name":"candlestick-patterns","slug":"candlestick-patterns","color":"#6366f1","createdAt":"2026-08-03T13:32:01.488Z"},{"id":"399050dc-f896-4304-a504-f9bd05e89cf9","name":"agentic-research","slug":"agentic-research","color":"#6366f1","createdAt":"2026-08-03T13:32:01.493Z"},{"id":"0e9b555c-fa99-4eff-8c0d-c0c7603aa41c","name":"robustness","slug":"robustness","color":"#6366f1","createdAt":"2026-07-08T20:24:11.522Z"},{"id":"7f9a630b-02a6-4b6a-89de-371010529091","name":"BTC","slug":"btc","color":"#6366f1","createdAt":"2026-08-03T13:32:01.498Z"},{"id":"08aa7260-f7b8-4feb-b164-5c6a2811279e","name":"1h","slug":"1h","color":"#6366f1","createdAt":"2026-07-08T20:24:11.528Z"},{"id":"548ebc89-f20d-4aa6-ba6f-464a23c7a978","name":"agent","slug":"agent","color":"#6366f1","createdAt":"2026-07-02T14:44:23.006Z"}],"comments":[],"isLiked":false,"isAuthor":false}