Skip to content

Commit 95ecff2

Browse files
committed
docs: freeze hierarchical intrabar replay plan
1 parent f838432 commit 95ecff2

1 file changed

Lines changed: 128 additions & 0 deletions

File tree

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
# Regime Trend v1 — Frozen Hierarchical Intrabar Replay Plan
2+
3+
Status: **Frozen before lower-timeframe replay results are viewed**
4+
5+
Purpose: resolve the OHLC path ambiguity inside each 4-hour strategy candle and test whether an immediately executable profit target is reached before the active stop.
6+
7+
The existing 4-hour strategy remains the signal generator. Lower-timeframe candles are used only to reconstruct event order and execution.
8+
9+
## 1. Core correction
10+
11+
A 4-hour candle containing both a favorable high and an adverse low does not reveal which event occurred first.
12+
13+
Therefore 4-hour OHLC data alone may not be used to conclude that:
14+
15+
- a target was reached before a stop,
16+
- a stop was reached before a target,
17+
- a favorable excursion was realizable,
18+
- waiting for the 4-hour close was necessary.
19+
20+
## 2. Data boundary
21+
22+
Use only:
23+
24+
- Development: 2019-01-01 through 2022-12-31 UTC
25+
- Validation/research: 2023-01-01 through 2024-12-31 UTC
26+
27+
The final holdout beginning 2025-01-01 remains closed.
28+
29+
## 3. Hierarchical resolution
30+
31+
### Stage 1: 1-hour replay
32+
33+
Download and hash-complete Binance Spot 1-hour candles for BTCUSDT, ETHUSDT and BNBUSDT through 2024-12-31.
34+
35+
Replay every frozen 4-hour baseline trade using the 1-hour candles contained inside its active lifetime.
36+
37+
### Stage 2: selective 15-minute replay
38+
39+
When the same 1-hour candle contains both the active stop and the tested target, classify the event as `AMBIGUOUS_SAME_1H`.
40+
41+
Only these ambiguous 1-hour windows may be refined with 15-minute candles.
42+
43+
If the same 15-minute candle still contains both levels, retain `AMBIGUOUS_SAME_15M`. Do not invent an intrabar path.
44+
45+
## 4. Frozen immediate-exit targets
46+
47+
Test only full-position immediate target exits at:
48+
49+
- +0.50 frozen entry ATR,
50+
- +1.00 frozen entry ATR,
51+
- +1.50 frozen entry ATR,
52+
- +2.00 frozen entry ATR.
53+
54+
The target is measured from the baseline entry fill.
55+
56+
A target exit occurs immediately when the lower-timeframe price first reaches the target. It does not wait for a 4-hour close.
57+
58+
No additional target may be introduced after viewing the replay results.
59+
60+
## 5. Baseline stop schedule
61+
62+
The original initial stop and 4-hour trailing-stop updates remain unchanged.
63+
64+
- The initial stop is active immediately from entry.
65+
- A trailing-stop update calculated from a completed 4-hour candle becomes active only at the next 4-hour candle open.
66+
- A pending trend exit remains an exit at the next 4-hour open.
67+
68+
Lower-timeframe replay must not use future 4-hour closes to update a stop early.
69+
70+
## 6. One-hour event ordering
71+
72+
For each active 1-hour candle:
73+
74+
1. Check opening gaps.
75+
2. If open is at or below the active stop, the stop occurs first.
76+
3. Else if open is at or above the target, the target occurs first.
77+
4. If the candle range reaches both stop and target, classify `AMBIGUOUS_SAME_1H`.
78+
5. If only the target is reached, classify `TARGET_FIRST`.
79+
6. If only the stop is reached, classify `STOP_FIRST`.
80+
7. Otherwise continue to the next 1-hour candle.
81+
82+
If no lower-timeframe target or stop occurs before the original baseline exit, retain `BASELINE_EXIT`.
83+
84+
Any missing lower-timeframe interval inside the required replay window produces `DATA_GAP` rather than a guessed result.
85+
86+
## 7. Execution costs
87+
88+
Use the frozen baseline costs:
89+
90+
- commission: 0.10% per side,
91+
- adverse slippage: 0.05% per side.
92+
93+
A target touch uses the target reference with adverse sell slippage. A stop touch uses the active stop reference with adverse sell slippage. A gap through a stop uses the lower-timeframe candle open with adverse slippage.
94+
95+
## 8. Required reports
96+
97+
For each partition, symbol and target report:
98+
99+
- baseline trade count,
100+
- `TARGET_FIRST` count,
101+
- `STOP_FIRST` count,
102+
- `AMBIGUOUS_SAME_1H` count,
103+
- `BASELINE_EXIT` count,
104+
- `DATA_GAP` count,
105+
- target-first count among baseline winners,
106+
- target-first count among baseline losers,
107+
- stop-first count among baseline winners,
108+
- stop-first count among baseline losers,
109+
- lower-bound total net PnL, treating same-hour ambiguity as stop-first,
110+
- upper-bound total net PnL, treating same-hour ambiguity as target-first,
111+
- profit-factor bounds,
112+
- win-rate bounds,
113+
- results by symbol and by calendar quarter.
114+
115+
Also report the exact 1-hour timestamps requiring selective 15-minute refinement.
116+
117+
## 9. Interpretation discipline
118+
119+
The completed-bar profit-protection matrix is a separate test and must not be used as evidence against immediate intrabar targets.
120+
121+
An immediate target candidate may advance only when:
122+
123+
- its lower-bound result improves both development and validation/research,
124+
- the improvement is not carried by one symbol or one quarter,
125+
- ambiguity is low enough or resolved by selective 15-minute replay,
126+
- doubled execution costs do not remove the improvement.
127+
128+
This stage does not authorize live trading, Pine implementation or final-holdout access.

0 commit comments

Comments
 (0)