OPEN-SOURCE SCRIPT
업데이트됨 Apex Matrix V4 Strategy: Martingale & Dynamic Exit

This script is published for educational and analytical purposes. It demonstrates a complex, multi-layered algorithmic trading system designed to identify liquidity sweeps and leverage traps in the cryptocurrency market.
█ WARNING — MARTINGALE RISK DISCLOSURE
This strategy explicitly utilizes a Martingale position-sizing system. If a trade moves against the entry (adverse excursion), the algorithm will aggressively double the allocated margin on the next valid signal to pull the average entry price closer to the current market price. Martingale systems carry extreme inherent risk and can lead to rapid and total liquidation of capital during sustained, unidirectional trends. Do not use this system with real funds without fully understanding the mathematical risk of ruin.
█ WHAT THIS SCRIPT DOES
This strategy executes mean-reversion trades by identifying areas where retail leverage is trapped, using a combination of price action (Swing Failure Patterns) and multi-exchange Open Interest aggregation.
█ HOW IT FINDS SETUPS (THE 4 PILLARS)
1 — Macro Flow (USDT.D Proxy): Evaluates Tether Dominance to ensure fiat is flowing into or out of the crypto market, providing macro trend alignment.
2 — Synthetic Leverage (Aggregated OI): Sums the Open Interest from Binance, Bybit, and OKX. It looks for "flushed" OI to confirm safe bottoms and "spiking" OI to identify overheated tops.
3 — Topological Sweeps (SFP): The trigger only arms when price pierces a 20-period high/low boundary and immediately closes back inside the range, trapping breakout traders.
4 — TDA Cluster Collapse: Requires a 2-standard-deviation volume anomaly or extreme candle body absorption (Effort vs. Result) to validate institutional presence.
█ HOW IT MANAGES RISK (ASYMMETRIC EXITS & RATCHETS)
• Logical Stop: Evaluates a 2% stop loss strictly on the candle close to avoid getting stopped out by manipulative, high-leverage exchange wicks.
• Catastrophe Stop: A hidden 4% wick-based hard stop to protect against flash crashes.
• Dual-Tier Ratchet: The millisecond price wicks to +1% profit, the stop is hard-locked at break-even. At +1.5%, the stop is pulled up to +1.5% and locked.
• 10% Max Take Profit: A hard limit order is placed at 10% for absolute profit capping.
• Dynamic Trailing: Closes early if price loses short-term momentum (crosses 5 EMA).
Some results as of releasing this indicator (5000USD portfolio $50 margin with 100x leverage simulated, 0.05% commision as default Binance taker fee):
Symbol 1m, 3m, 5m, 15m, 30m, 1h, Total
BTC, 152.96, 131.37, 161.78, 455.3, 26.36, 295.6, 1223.37
BTCP, 412.33, 39.28, 34.07,, 398.53, 147.33, 280.25, 1311.79
ETH, 282.95, -101.47, -126.71, 372.93, 682.07, 888.3, 1998.07
ETHP 467.5, 101.64, -233.13, 350.69, -1098.64, 792.2, 380.26
XRP, 241.35, 214.84, 378.16, -232.94, 800.46, 2113.84, 3515.71
XRPP , 260.39, 269.6, 346.76, -451.94, 954.07, 2164.21, 3543.09
SOL , 66.2, -111.94, 142.32, 204.16, 435.25, 658.54, 1394.53
SOLP , 228.78, 580.46, -104.32, 384.45, 805.72, 508.05, 2403.14
Total , 743.46, 132.8, 555.55, 799.45, 1944.14, 3956.28, 8131.68
TotalP 1369, 990.98, 43.38, 681.73, 808.48, 3744.71, 7638.28
█ WARNING — MARTINGALE RISK DISCLOSURE
This strategy explicitly utilizes a Martingale position-sizing system. If a trade moves against the entry (adverse excursion), the algorithm will aggressively double the allocated margin on the next valid signal to pull the average entry price closer to the current market price. Martingale systems carry extreme inherent risk and can lead to rapid and total liquidation of capital during sustained, unidirectional trends. Do not use this system with real funds without fully understanding the mathematical risk of ruin.
█ WHAT THIS SCRIPT DOES
This strategy executes mean-reversion trades by identifying areas where retail leverage is trapped, using a combination of price action (Swing Failure Patterns) and multi-exchange Open Interest aggregation.
█ HOW IT FINDS SETUPS (THE 4 PILLARS)
1 — Macro Flow (USDT.D Proxy): Evaluates Tether Dominance to ensure fiat is flowing into or out of the crypto market, providing macro trend alignment.
2 — Synthetic Leverage (Aggregated OI): Sums the Open Interest from Binance, Bybit, and OKX. It looks for "flushed" OI to confirm safe bottoms and "spiking" OI to identify overheated tops.
3 — Topological Sweeps (SFP): The trigger only arms when price pierces a 20-period high/low boundary and immediately closes back inside the range, trapping breakout traders.
4 — TDA Cluster Collapse: Requires a 2-standard-deviation volume anomaly or extreme candle body absorption (Effort vs. Result) to validate institutional presence.
█ HOW IT MANAGES RISK (ASYMMETRIC EXITS & RATCHETS)
• Logical Stop: Evaluates a 2% stop loss strictly on the candle close to avoid getting stopped out by manipulative, high-leverage exchange wicks.
• Catastrophe Stop: A hidden 4% wick-based hard stop to protect against flash crashes.
• Dual-Tier Ratchet: The millisecond price wicks to +1% profit, the stop is hard-locked at break-even. At +1.5%, the stop is pulled up to +1.5% and locked.
• 10% Max Take Profit: A hard limit order is placed at 10% for absolute profit capping.
• Dynamic Trailing: Closes early if price loses short-term momentum (crosses 5 EMA).
Some results as of releasing this indicator (5000USD portfolio $50 margin with 100x leverage simulated, 0.05% commision as default Binance taker fee):
Symbol 1m, 3m, 5m, 15m, 30m, 1h, Total
BTC, 152.96, 131.37, 161.78, 455.3, 26.36, 295.6, 1223.37
BTCP, 412.33, 39.28, 34.07,, 398.53, 147.33, 280.25, 1311.79
ETH, 282.95, -101.47, -126.71, 372.93, 682.07, 888.3, 1998.07
ETHP 467.5, 101.64, -233.13, 350.69, -1098.64, 792.2, 380.26
XRP, 241.35, 214.84, 378.16, -232.94, 800.46, 2113.84, 3515.71
XRPP , 260.39, 269.6, 346.76, -451.94, 954.07, 2164.21, 3543.09
SOL , 66.2, -111.94, 142.32, 204.16, 435.25, 658.54, 1394.53
SOLP , 228.78, 580.46, -104.32, 384.45, 805.72, 508.05, 2403.14
Total , 743.46, 132.8, 555.55, 799.45, 1944.14, 3956.28, 8131.68
TotalP 1369, 990.98, 43.38, 681.73, 808.48, 3744.71, 7638.28
릴리즈 노트
Added an HMM regime detector. It can potentially drastically reduce drawdowns while keeping similar profits, usually on higher timeframes. It opens the door to higher leverage strategies, the risk is still greater, it does not guarantee you success on higher leverage than without it or at all.오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.