OPEN-SOURCE SCRIPT
Ineficient market

The setup
The 1-2-3 pattern (price-structure reversal, in the Joe Ross / Zeiierman lineage) marks three alternating pivots: an extreme, a pullback, and a second extreme that fails to exceed the first — a Higher-Low for longs, a Lower-High for shorts. Entry fires on confirmation of the 3rd pivot (no waiting for a breakout, which cuts lag). On top of that sits a volatility gate: signals only trigger when relative volatility is compressed (ATR% ≤ its own moving average). Trades resolve on a small fixed TP, a wide SL, and a time-stop.
The inefficiency
This isn't about "predicting direction" — direction is free and doesn't pay. The edge is a short-term overreaction at structure pivots: after price prints a failed extreme, it tends to give back a small, fast fraction of the move. In compressed volatility that give-back is more reliable and less noisy. The edge is statistical and regime-conditional — not a silver bullet.
Why the exit looks "wrong" (and why that's the whole point)
The counterintuitive part: small TP + wide SL + no trailing, no break-even, no touching the trade. We tested active management extensively (move to BE, trailing, tight stops at the "normal MAE") and every version destroys the edge — because 1–3% adverse excursion is normal even on winners, and any tight stop sits exactly where noise wanders. Holding through that swing is what captures the reversion. It's fire-and-forget by design, not by laziness.
How we found it (the differentiator)
This wasn't reverse-engineered from a pretty chart. It survived:
- Random-matched placebo — the same exit engine fired on random bars vs. the real signal, proving the edge lives in the signal, not the short TP.
- Path-dependent backtesting — simulating the exact order of intra-trade events, not aggregate stats (which mislead).
- Conditional MAE analysis — measuring how win probability decays as a trade digs, which set the wide SL and killed the temptation of tight stops.
Inputs: prd (pivot lookback) · ATR ratio max (volatility gate) · TP % · SL % · time-stop · direction (long/short).
Disclaimer: For research/education, not financial advice. Past performance does not guarantee future results. The edge is conditional on regime and costs — test with your own commission/slippage before any live use.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.