백테스트 비용과 비활성 설정 필드 해석 | Stratmill
코드 Machine Learning for Trading
요약
이 설정 노트는 백테스트 식별 정보에 포함되는 설정과 모의 거래 비용에 실제로 영향을 주는 설정을 구분합니다. 설명된 사례 연구에서 등록된 모든 실행은 벡터화된 만기 청산 경로를 사용합니다. 설정된 체결 가격, 수수료율, 슬리피지율 필드는 이 경로에 전달되지 않으며, 호가 기준 체결은 벡터화 실행에서 생성하지 않는 이벤트 기반 브로커에 속합니다. 이 설정을 제거하면 기존 실행의 해시 식별 정보가 바뀌므로 설정에 그대로 남아 있습니다.
실제 비용은 설정 파일에서 별도로 읽습니다. 옵션 진입 및 청산 스프레드, 리밸런싱마다 추정한 헤지 스프레드, 계약당 또는 주당 수수료가 여기에 포함됩니다. 이 노트에 따르면 비용이 부과되었는데도 명시된 모집단 전체에서 기록된 총 슬리피지 필드는 null입니다. 해당 경로가 비용 총액을 기록하지 않기 때문입니다. 이는 유용한 감사 교훈입니다. 설정값이나 누락된 비용 지표만으로 백테스트에서 실제 지불한 비용을 알 수는 없습니다. 이 결과는 지정된 구현에 적용되며, 실행기나 비용 처리 흐름이 바뀌면 다시 확인해야 합니다.
핵심 아이디어
- 실행 경로에서 사용하지 않더라도 설정 필드는 실행의 해시 식별 정보에 영향을 줄 수 있습니다.
- 여기에 설명된 벡터화된 만기 청산 경로는 설정된 비율 기반 수수료 및 슬리피지 필드를 사용하지 않습니다.
- 실제 모의 비용은 별도로 설정된 옵션, 헤지, 청산 비용 항목에서 발생합니다.
- 총 슬리피지 필드가 null이라고 해서 비용이 부과되지 않았다는 뜻은 아닙니다.
- 비용을 해석하려면 해당 실행기와 데이터 흐름을 추적해야 합니다.
태그
전문
# base.yaml ```yaml # Three fields below are inert on the path this case study runs: `execution.execution_price`, # `commission.rate` and `slippage.rate`. Every registered backtest here is `ret_to_expiry`, # which `case_studies/utils/backtest_runner.py` routes to `_run_htm_daily_mtm`, and that call # is not passed `cost_spec` - the only thing that carries these rates into a run. The # `quote_side` fill is read by the event-driven broker, which a `rebalance.mode: vectorized` # case study never constructs. They still reach the registered `backtest_config` and so the # hashed identity, which is why they stay: removing them would re-key 879 backtests to delete # values nothing reads. # # The costs this case study actually pays come from `_htm_backtest.py`, which reads # `config/setup.yaml::costs.components` directly - per-leg entry spread from the real option # quotes, `hedge_spread.estimate_bps_of_notional` on every hedge rebalance, # `commission.option_per_contract` and `commission.equity_per_share`, plus an exit spread on # liquidation. Verified 2026-09-12; `total_slippage` is NULL on all 879 rows because the # vectorized path records no cost totals, not because nothing was charged. account: allow_short_selling: true execution: execution_price: quote_side mark_price: price execution_mode: next_bar commission: model: percentage rate: 0.0005 slippage: model: percentage rate: 0.0002 calendar: calendar: NYSE timezone: UTC data_frequency: daily feed: timestamp_col: timestamp entity_col: symbol price_col: instr_mid close_col: close bid_col: instr_bid ask_col: instr_ask mid_col: instr_mid metadata: case_study: sp500_options ```
출처의 라이선스에 따라 출처를 표시하고 전문을 공개합니다. 라이선스: MIT
이 요약은 원문을 바탕으로 Stratmill의 리서치 에이전트가 작성했으며, 원문을 복사한 것이 아닙니다.