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.
開源腳本
秉持TradingView一貫精神,這個腳本的創作者將其設為開源,以便交易者檢視並驗證其功能。向作者致敬!您可以免費使用此腳本,但請注意,重新發佈代碼需遵守我們的社群規範。
免責聲明
這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。
開源腳本
秉持TradingView一貫精神,這個腳本的創作者將其設為開源,以便交易者檢視並驗證其功能。向作者致敬!您可以免費使用此腳本,但請注意,重新發佈代碼需遵守我們的社群規範。
免責聲明
這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。