var - backtest related and spy runbook
This commit is contained in:
40
workflows/backtest-strategy/_config/risk-params.md
Normal file
40
workflows/backtest-strategy/_config/risk-params.md
Normal file
@@ -0,0 +1,40 @@
|
||||
# Risk Parameters (stable defaults — edit sparingly, diffs matter)
|
||||
# Stage 03 reads this file; the strategy spec may override individual values.
|
||||
|
||||
# Data window (v1)
|
||||
window:
|
||||
start: 2026-02-27 # ~6 months back; stage 01 narrows to contract reality
|
||||
end: 2026-08-27
|
||||
|
||||
# Costs
|
||||
costs:
|
||||
slippage_model: mid_half_spread # each fill at mid ± half observed spread
|
||||
min_tick: 0.01 # options tick floor
|
||||
commissions_per_contract: 0.0 # 0 by default; operator may set
|
||||
|
||||
# Sessions
|
||||
session:
|
||||
default: RTH # 09:30–16:00 ET
|
||||
hard_exit_et: "15:45" # house rule: flat before the close
|
||||
extended_allowed: false # only if strategy spec explicitly enables
|
||||
|
||||
# Sizing
|
||||
sizing:
|
||||
mode: fixed_contract
|
||||
contracts: 1
|
||||
|
||||
# Exits (defaults; spec overrides)
|
||||
exits:
|
||||
breakeven_after_t1: false
|
||||
|
||||
# Cache
|
||||
cache:
|
||||
path: shared/data/backtest_cache.sqlite3
|
||||
key: (contract, timespan, window) # cache-first; never re-pull existing rows
|
||||
max_rows_per_table: 5000000
|
||||
|
||||
# Validation
|
||||
validation:
|
||||
no_lookahead: true
|
||||
low_n_threshold: 30 # reports must flag results below this trade count
|
||||
split: none # optional in-sample/out-of-sample date split
|
||||
@@ -0,0 +1,49 @@
|
||||
# Strategy Spec Template
|
||||
# Fill one copy per strategy: _config/strategy-spec-<name>.md
|
||||
# The frozen spec (stage 00 output) is the single source of truth for the engine.
|
||||
|
||||
# Name
|
||||
name: <short-slug>
|
||||
|
||||
# Underlying & structure
|
||||
underlying: <SPY>
|
||||
structure: <single_leg | credit_spread | debit_spread>
|
||||
# For spreads, list legs explicitly:
|
||||
legs:
|
||||
- role: short
|
||||
type: put
|
||||
selection: <e.g., ~30-delta proxy: strike nearest 0.5% OTM of spot>
|
||||
- role: long
|
||||
type: put
|
||||
selection: <e.g., $5 wide below short strike>
|
||||
expiration: <e.g., same-day (0DTE) — nearest daily expiry>
|
||||
|
||||
# Session
|
||||
session: <RTH (default) | extended>
|
||||
entry_window: <e.g., 09:45–11:00 ET>
|
||||
hard_exit: <e.g., 15:45 ET>
|
||||
|
||||
# Entry rules (plain English, bar-level. NO look-ahead allowed.)
|
||||
entry:
|
||||
- <rule 1 — e.g., price pulls back to rising VWAP>
|
||||
- <rule 2 — optional confirmation>
|
||||
all_required: true # every rule must hold on the entry bar
|
||||
|
||||
# Exit rules
|
||||
exits:
|
||||
stop: <underlying level or premium % — define precisely>
|
||||
targets:
|
||||
- t1: <profit % of credit or premium>
|
||||
scale_out: <fraction, e.g., 50%>
|
||||
- t2: <...>
|
||||
scale_out: <...>
|
||||
breakeven_after_t1: false
|
||||
time_exit: 15:45 ET
|
||||
|
||||
# Sizing & costs
|
||||
sizing:
|
||||
mode: fixed_contract # v1 default: 1 contract
|
||||
contracts: 1
|
||||
costs:
|
||||
slippage: mid_half_spread # conservative default; see risk-params.md
|
||||
commissions: 0 # set if the operator wants them modeled
|
||||
Reference in New Issue
Block a user