DeribitEthWeeklyPutWriteTrendGatedOnly
假設
Deribit ETH 每週現金擔保 OTM 賣出賣權——僅趨勢閘門控制、固定約 25-Delta、NO長回顧窗口 IV 閘門(單腳位 VRP 收割;直接修復導致 ETH-每週同系策略被放棄的 4 筆交易回顧窗口瓶頸)
假設
一個SINGLE-LEG、完全以現金擔保的每週PUT-WRITING計畫,標的為 Deribit ETH 選擇權——流動性第二高的加密貨幣選擇權標的物,重用該工廠已通過 Sharpe-12.2 晉升的 Deribit-BTC-每週賣出賣權策略的 EXACT 執行路徑(透過 greeks 選擇履約價、每週現金結算)。此策略刻意設計來FIX唯一一個、經反覆診斷確認導致 ETH-每週同系策略在 8 次疊代中被放棄的原因:其 IV-rank + IV>RV 雙重閘門需要約 560 天的滾動回顧窗口,導致交易數僅剩 4 筆 / metrics_reliable=false——一個開發者始終無法解決的結構性死路。此版本徹底DROPS了長回顧窗口的 IV 閘門,並保留ONLY趨勢過濾器(該閘門已在晉升的 BTC 獲勝策略中證實具有關鍵作用),每個符合條件的週次固定寫出約 25-delta 的 OTM ETH 賣權。由於不再依賴多年期的 IV 百分位數,它在可取得的 Deribit ETH 每週歷史資料中約每年觸發 40-52 次→這是一個具統計可靠性的交易數量,徹底消除了 4 筆交易的瓶頸。它填補了最未被充分涵蓋的交易場所(選擇權:5.5% Deribit + 0.1% Binance,對比 ≥15% 的目標),並將選擇權投資組合從僅限 BTC 擴展為第二個不相關波動率標的物,達成多樣化。它NOT屬於多腳位結構(L2)、NOT屬於資料受限儲存格(每週 ETH 鏈與 greeks 已被編目,並透過 BTC 同系策略證實可執行)、NOT具方向性。刻意2參數(賣權 delta、趨勢過濾器長度)以抵抗過度擬合。
假設
疊代 3 僅透過設定變更修復了 Layer-3 的實際時間逾時問題;策略CODE本身未變更(它已通過 Layers 1-2,每根 K 棒的運算量透過增量式累計和 SMA 達到 O(1),且沒有每根 K 棒的 min()/sorted()/歷史掃描)。診斷:疊代 2 已正確將主要標的與腳位解析移至 1-DAY,但 STILL 仍然逾時,這證明瓶頸並非 K 棒數量所致。查閱 src/data/option_chain.py 後發現:discover_deribit_chain 會針對 EACH 每週到期日的每個候選履約價發出一次網路 fetch_ohlcv 探測,而 Layer-3 沙盒橫跨 lookback_days(expand_rolling_options / 管線預設值 365)。因此展開成本會隨每週到期日數量 = lookback_days 而增長,與時間範圍無關。iter-2 的設定帶有 lookback_days ~730(約 104 個到期日,使探測次數加倍),導致超出 300 秒的預算。將 lookback_days 還原為 365(約 52 個到期日)可將到期日探測與腳位下載量減半,與已驗證通過的 ETH/BTC 每週賣出賣權同系策略通過 Layer 3 時的確切規模一致,同時仍涵蓋約 52 個符合條件的週次,使交易數量維持具統計可靠性(趨勢閘門過濾後約 30-52 次寫出),遠高於 4 筆交易的死路門檻。其餘一切皆維持不變且已驗證有效:直接繼承 RollingOptionsStrategy(Layer-1 可識別;4 抽象掛鉤確實存在)、無冒煙測試路徑(真實選擇權腳位透過展開的排程進行交易,滿足 options_no_option_trades)、_enter_leg 中單一的純價格趨勢閘門、1-DAY ETH-PERPETUAL 主要標的 + 1-DAY 腳位解析(與已通過的 ETH 賣出賣權同系策略所使用的解析方式相同)、現金擔保部位規模(risk_frac 0.8,槓桿 1.0,符合選擇權交易場所上限規定),以及 2 個參數的設計(賣權偏移量 + sma_window)。
假設
backtest_failed: RuntimeError: rolling_options 展開失敗 (ConnectError: );拒絕在期權排程為空的情況下執行
Traceback (most recent call last):
File "/opt/strategy-factory/.venv/lib/python3.12/site-packages/httpx/_transports/default.py", line 101, in map_httpcore_exceptions
yield
File "/opt/strategy-factory/.venv/lib/python3.12/site-packages/httpx/_transports/default.py", line 394, in handle_async_request
resp = await self._pool.handle_async_request(req)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/strategy-factory/.venv/lib/python3.12/site-packages/httpcore/_async/connection_pool.py", line 256, in handle_async_request
raise exc from None
File "/opt/strategy-factory/.venv/lib/python3.12/site-packages/httpcore/_async/connection_pool.py", line 236, in handle_async_request
response = await connection.handle_async_request(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/strategy-factory/.venv/lib/python3.12/site-packages/httpcore/_async/connection.py", line 101, in handle_async_request
raise exc
File "/opt/strategy-factory/.venv/lib/python3.12/site-packages/httpcore/_async/connection.py", line 78, in handle_async_request
stream = await self._connect(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/strategy-factory/.venv/lib/python3.12/site-packages/httpcore/_async/connection.py", line 156, in _connect
stream = await stream.start_tls(**kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/strategy-factory/.venv/lib/python3.12/site-packages/httpcore/_backends/anyio.py", line 67, in start_tls
with map_exceptions(exc_map):
File "/usr/lib/python3.12/contextlib.py", line 158, in __exit__
self.gen.throw(value)
File "/opt/strategy-factory/.venv/lib/python3.12/site-packages/httpcore/_exceptions.py", line 14, in map_exceptions
raise to_exc(exc) from exc
httpcore.ConnectError
上述例外是造成以下例外的直接原因:
Traceback (most recent call last):
File "/opt/strategy-factory/src/agents/backtest_agent.py", line 49, in expand_rolling_options_into_config
extra_i, extra_bt, sched = await expand_rolling_options(collector, spec, start, end)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/strategy-factory/src/data/option_chain.py", line 242, in expand_rolling_options
contracts = await discover_deribit_chain(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/strategy-factory/src/data/option_chain.py", line 143, in discover_deribit_chain
perp_bars = await collector.fetch_ohlcv(perp, start_ms, end_ms, "1D")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/strategy-factory/src/data/collectors/deribit_collector.py", line 169, in fetch_ohlcv
result = await self._get("/public/get_tradingview_chart_data", {
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/strategy-factory/src/data/collectors/deribit_collector.py", line 86, in _get
response = await self._client.get(f"{DERIBIT_API_URL}{endpoint}", params=params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/strategy-factory/.venv/lib/python3.12/site-packages/httpx/_client.py", line 1768, in get
return await self.request(
^^^^^^^^^^^^^^^^^^^
File "/opt/strategy-factory/.venv/lib/python3.12/site-packages/httpx/_client.py", line 1540, in request
return await self.send(request, auth=auth, follow_redirects=follow_redirects)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/strategy-factory/.venv/lib/python3.12/site-packages/httpx/_client.py", line 1629, in send
response = await self._send_handling_auth(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/strategy-factory/.venv/lib/python3.12/site-packages/httpx/_client.py", line 1657, in _send_handling_auth
response = await self._send_handling_redirects(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/strategy-factory/.venv/lib/python3.12/site-packages/httpx/_client.py", line 1694, in _send_handling_redirects
response = await self._send_single_request(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/strategy-factory/.venv/lib/python3.12/site-packages/httpx/_client.py", line 1730, in _send_single_request
response = await transport.handle_async_request(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/strategy-factory/.venv/lib/python3.12/site-packages/httpx/_transports/default.py", line 393, in handle_async_request
with map_httpcore_exceptions():
File "/usr/lib/python3.12/contextlib.py", line 158, in __exit__
self.gen.throw(value)
File "/opt/strategy-factory/.venv/lib/python3.12/site-packages/httpx/_transports/default.py", line 118, in map_httpcore_exceptions
raise mapped_exc(message) from exc
httpx.ConnectError
上述例外是造成以下例外的直接原因:
Traceback (most recent call last):
File "/opt/strategy-factory/src/agents/backtest_agent.py", line 184, in _run_backtest
config = await self._maybe_expand_rolling_options(config, catalog_path)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/strategy-factory/src/agents/backtest_agent.py", line 427, in _maybe_expand_rolling_options
config = await expand_rolling_options_into_config(config, catalog_path, self._logger)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/strategy-factory/src/agents/backtest_agent.py", line 59, in expand_rolling_options_into_config
raise RuntimeError(
RuntimeError: rolling_options 展開失敗 (ConnectError: );拒絕在期權排程為空的情況下執行
實作
單腳位、現金擔保的每週 OTM 賣出賣權策略,標的為 ETH Deribit 歐式選擇權,僅以趨勢閘門控制。框架每週會解析 Deribit ETH 每週賣權鏈的歷史資料(透過 -6% 價內外幅度目標鎖定約 25-delta 的 OTM 履約價)並進行展期;該策略SELLS一張距到期約 7 天的賣權,並於結算前約 24 小時平倉。ONLY 閘門是純價格趨勢過濾器:僅當 ETH 現貨價格高於其約 50 天的 SMA(日線)時才寫出賣權,遇到確認的下跌趨勢則觀望不進場。由於不使用多年期的 IV 百分位數窗口,此策略在每個符合條件的週次都會交易(在 365 天的窗口內約每年 52 次),達成具統計可靠性的交易數量,直接消除了導致 IV-閘門控制的 ETH-每週同系策略被放棄的 4 筆交易回顧窗口瓶頸。主要標的 = ETH-PERPETUAL.DERIBIT,以 1-DAY K 棒計算(僅作為展期時鐘,從未實際交易)。現金擔保部位規模(risk_frac 0.8),無槓桿,2 個調校參數(賣權偏移量、sma_window)。
驗證結果
CLEAN RESTART 2026-09-04 — 此次執行的判定歷史與學習紀錄已被移除,並從驗證階段重新開始。它先前的放棄源自於流程管線本身,而非市場:Layer-2 測試套件錯誤綁定了 @staticmethod 輔助函式(已修復)、QA 曾在未優化的冒煙測試上發出最終績效判定(已移除——QA 現在僅判定正確性)、以及沙盒逾時是由回測槽位資源匱乏所致(已修復)。假設與策略程式碼皆未變更。請就程式碼本身的優劣進行驗證;績效將由後續的完整回測與優化器決定。
驗證結果
不需要。
驗證結果
Layer-1 將 self._win.append() 標記為無界成長,但 on_bar 每根 K 棒都會修剪該 deque(while len > sma_window: popleft()),因此成長幅度被限制在 sma_window 以內。此為誤報。
Iteration History
驗證失敗(Layer 3 — 沙盒回測):冒煙測試超過 300 秒的實際時間限制。這幾乎總是意味著每根 K 棒的運算量會隨歷史資料量增長——例如重新掃描完整的資金費率/輔助序列,或是在每根 K 棒中於 calculate_signal()/on_bar() 內重建串列並呼叫 min()/sorted()。請在 __init__ 中預先計算排序好的時間戳陣列 ONCE,並使用 bisect,或以時間戳作為鍵值快取查詢結果,使每根 K 棒的成本為 O(log n) 而非 O(n)。
Iteration History
RuntimeError: rolling_options 展開失敗(ConnectError: );拒絕在選擇權排程為空的情況下執行
追蹤紀錄(最近一次呼叫在最後):
File "/opt/strategy-factory/.venv/lib/python3.12/site-packages/httpx/_transports/default.py", line 101, in map_httpcore_exceptions
yield
File "/opt/strategy-factory/.venv/lib/python3.12/site-packages/httpx/_transports/default.py", line 394, in handle_async_request
resp = await self._pool.handle_async_request(req)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/strategy-factory/.venv/lib/python3.12/site-packages/httpcore/_async/connection_pool.py", line 256, in handle_async_request
raise exc from None
File "/opt/strategy-factory/.venv/lib/python3.12/site-packages/httpcore/_async/connection_pool.py", line 236, in handle_async_request
response = await connection.handle_async_request(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/strategy-factory/.venv/lib/python3.12/site-packages/httpcore/_async/connection.py", line 101, in handle_async_request
raise exc
File "/opt/strategy-factory/.venv/lib/python3.12/site-packages/httpcore/_async/connection.py", line 78, in handle_async_request
stream = await self._connect(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/strategy-factory/.venv/lib/python3.12/site-packages/httpcore/_async/connection.py", line 156, in _connect
stream = await stream.start_tls(**kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/strategy-factory/.venv/lib/python3.12/site-packages/httpcore/_backends/anyio.py", line 67, in start_tls
with map_exceptions(exc_map):
File "/usr/lib/python3.12/contextlib.py", line 158, in __exit__
self.gen.throw(value)
File "/opt/strategy-factory/.venv/lib/python3.12/site-packages/httpcore/_exceptions.py", line 14, in map_exceptions
raise to_exc(exc) from exc
httpcore.ConnectError
上述例外是下列例外的直接原因:
追蹤紀錄(最近一次呼叫在最後):
File "/opt/strategy-factory/src/agents/backtest_agent.py", line 49, in expand_rolling_options_into_config
extra_i, extra_bt, sched = await expand_rolling_options(collector, spec, start, end)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/strategy-factory/src/data/option_chain.py", line 242, in expand_rolling_options
contracts = await discover_deribit_chain(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/strategy-factory/src/data/option_chain.py", line 143, in discover_deribit_chain
perp_bars = await collector.fetch_ohlcv(perp, start_ms, end_ms, "1D")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/strategy-factory/src/data/collectors/deribit_collector.py", line 169, in fetch_ohlcv
result = await self._get("/public/get_tradingview_chart_data", {
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/strategy-factory/src/data/collectors/deribit_collector.py", line 86, in _get
response = await self._client.get(f"{DERIBIT_API_URL}{endpoint}", params=params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/strategy-factory/.venv/lib/python3.12/site-packages/httpx/_client.py", line 1768, in get
return await self.request(
^^^^^^^^^^^^^^^^^^^
File "/opt/strategy-factory/.venv/lib/python3.12/site-packages/httpx/_client.py", line 1540, in request
return await self.send(request, auth=auth, follow_redirects=follow_redirects)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/strategy-factory/.venv/lib/python3.12/site-packages/httpx/_client.py", line 1629, in send
response = await self._send_handling_auth(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/strategy-factory/.venv/lib/python3.12/site-packages/httpx/_client.py", line 1657, in _send_handling_auth
response = await self._send_handling_redirects(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/strategy-factory/.venv/lib/python3.12/site-packages/httpx/_client.py", line 1694, in _send_handling_redirects
response = await self._send_single_request(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/strategy-factory/.venv/lib/python3.12/site-packages/httpx/_client.py", line 1730, in _send_single_request
response = await transport.handle_async_request(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/strategy-factory/.venv/lib/python3.12/site-packages/httpx/_transports/default.py", line 393, in handle_async_request
with map_httpcore_exceptions():
File "/usr/lib/python3.12/contextlib.py", line 158, in __exit__
self.gen.throw(value)
File "/opt/strategy-factory/.venv/lib/python3.12/site-packages/httpx/_transports/default.py", line 118, in map_httpcore_exceptions
raise mapped_exc(message) from exc
httpx.ConnectError
上述例外是下列例外的直接原因:
追蹤紀錄(最近一次呼叫在最後):
File "/opt/strategy-factory/src/agents/backtest_agent.py", line 184, in _run_backtest
config = await self._maybe_expand_rolling_options(config, catalog_path)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/strategy-factory/src/agents/backtest_agent.py", line 427, in _maybe_expand_rolling_options
config = await expand_rolling_options_into_config(config, catalog_path, self._logger)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/strategy-factory/src/agents/backtest_agent.py", line 59, in expand_rolling_options_into_config
raise RuntimeError(
RuntimeError: rolling_options 展開失敗(ConnectError: );拒絕在選擇權排程為空的情況下執行
放棄原因
backtest_failed: RuntimeError: rolling_options 展開失敗 (ConnectError: );拒絕在期權排程為空的情況下執行
Traceback (most recent call last):
File "/opt/strategy-factory/.venv/lib/python3.12/site-packages/httpx/_transports/default.py", line 101, in map_httpcore_exceptions
yield
File "/opt/strategy-factory/.venv/lib/python3.12/site-packages/httpx/_transports/default.py", line 394, in handle_async_request
resp = await self._pool.handle_async_request(req)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/strategy-factory/.venv/lib/python3.12/site-packages/httpcore/_async/connection_pool.py", line 256, in handle_async_request
raise exc from None
File "/opt/strategy-factory/.venv/lib/python3.12/site-packages/httpcore/_async/connection_pool.py", line 236, in handle_async_request
response = await connection.handle_async_request(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/strategy-factory/.venv/lib/python3.12/site-packages/httpcore/_async/connection.py", line 101, in handle_async_request
raise exc
File "/opt/strategy-factory/.venv/lib/python3.12/site-packages/httpcore/_async/connection.py", line 78, in handle_async_request
stream = await self._connect(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/strategy-factory/.venv/lib/python3.12/site-packages/httpcore/_async/connection.py", line 156, in _connect
stream = await stream.start_tls(**kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/strategy-factory/.venv/lib/python3.12/site-packages/httpcore/_backends/anyio.py", line 67, in start_tls
with map_exceptions(exc_map):
File "/usr/lib/python3.12/contextlib.py", line 158, in __exit__
self.gen.throw(value)
File "/opt/strategy-factory/.venv/lib/python3.12/site-packages/httpcore/_exceptions.py", line 14, in map_exceptions
raise to_exc(exc) from exc
httpcore.ConnectError
上述例外是造成以下例外的直接原因:
Traceback (most recent call last):
File "/opt/strategy-factory/src/agents/backtest_agent.py", line 49, in expand_rolling_options_into_config
extra_i, extra_bt, sched = await expand_rolling_options(collector, spec, start, end)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/strategy-factory/src/data/option_chain.py", line 242, in expand_rolling_options
contracts = await discover_deribit_chain(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/strategy-factory/src/data/option_chain.py", line 143, in discover_deribit_chain
perp_bars = await collector.fetch_ohlcv(perp, start_ms, end_ms, "1D")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/strategy-factory/src/data/collectors/deribit_collector.py", line 169, in fetch_ohlcv
result = await self._get("/public/get_tradingview_chart_data", {
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/strategy-factory/src/data/collectors/deribit_collector.py", line 86, in _get
response = await self._client.get(f"{DERIBIT_API_URL}{endpoint}", params=params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/strategy-factory/.venv/lib/python3.12/site-packages/httpx/_client.py", line 1768, in get
return await self.request(
^^^^^^^^^^^^^^^^^^^
File "/opt/strategy-factory/.venv/lib/python3.12/site-packages/httpx/_client.py", line 1540, in request
return await self.send(request, auth=auth, follow_redirects=follow_redirects)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/strategy-factory/.venv/lib/python3.12/site-packages/httpx/_client.py", line 1629, in send
response = await self._send_handling_auth(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/strategy-factory/.venv/lib/python3.12/site-packages/httpx/_client.py", line 1657, in _send_handling_auth
response = await self._send_handling_redirects(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/strategy-factory/.venv/lib/python3.12/site-packages/httpx/_client.py", line 1694, in _send_handling_redirects
response = await self._send_single_request(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/strategy-factory/.venv/lib/python3.12/site-packages/httpx/_client.py", line 1730, in _send_single_request
response = await transport.handle_async_request(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/strategy-factory/.venv/lib/python3.12/site-packages/httpx/_transports/default.py", line 393, in handle_async_request
with map_httpcore_exceptions():
File "/usr/lib/python3.12/contextlib.py", line 158, in __exit__
self.gen.throw(value)
File "/opt/strategy-factory/.venv/lib/python3.12/site-packages/httpx/_transports/default.py", line 118, in map_httpcore_exceptions
raise mapped_exc(message) from exc
httpx.ConnectError
上述例外是造成以下例外的直接原因:
Traceback (most recent call last):
File "/opt/strategy-factory/src/agents/backtest_agent.py", line 184, in _run_backtest
config = await self._maybe_expand_rolling_options(config, catalog_path)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/strategy-factory/src/agents/backtest_agent.py", line 427, in _maybe_expand_rolling_options
config = await expand_rolling_options_into_config(config, catalog_path, self._logger)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/strategy-factory/src/agents/backtest_agent.py", line 59, in expand_rolling_options_into_config
raise RuntimeError(
RuntimeError: rolling_options 展開失敗 (ConnectError: );拒絕在期權排程為空的情況下執行
Stratmill 是一款研究與模擬交易工具,並非財務建議或經紀商服務。回測與模擬交易結果均為假設性質。交易涉及虧損風險。