OPEN-SOURCE SCRIPT
Dual MA Crossover + Volatility Filter

Overview
The Dual MA Crossover + Volatility Filter is a comprehensive, trend-following framework designed primarily for futures and high-liquidity assets. Unlike standard moving average strategies that suffer during "choppy" or sideways markets, this system employs a multi-layered filtering process to ensure trades are only taken when momentum, volatility, and timing are in alignment.
Core Logic
The strategy triggers a signal when a Fast Moving Average crosses a Slow Moving Average. However, the signal must pass through three distinct "gates" before an order is executed:
Volatility Expansion Filter (ATR): Compares a short-term ATR against a longer-term baseline. Entries are only permitted when current volatility is higher than the baseline, signaling that a "breakout" or strong trend is likely beginning.
Momentum Filter (RSI): Confirmation of the trend's strength. Longs are only taken if RSI is above a user-defined threshold (default 50), ensuring we are not buying a "dead cat bounce."
Session Time Filter: Specifically designed for intraday traders. It allows users to skip the initial market "noise" (e.g., the first 30 minutes of the NY open) before allowing entries.
Key Features
Dynamic Risk Management: Automatically calculates position size based on a fixed percentage of account equity and the current ATR-based stop distance.
Smart Exit Logic: * Initial Stop: Set at a multiple of ATR from entry.
Breakeven Trigger: Moves the stop to entry price once the trade reaches a user-defined "R" (Risk) multiple.
Trailing Stop: Activates a trailing ATR-stop only after the breakeven trigger is hit, protecting profits during extended trends.
Time Stop: Closes the position if the market fails to make a new High (long) or Low (short) within a specific number of bars.
Futures Optimized: Includes built-in point value calculations for major contracts like ES, NQ, RTY, CL, and GC.
How to Use
Select MA Type: Choose between EMA, SMA, WMA, or HMA based on your preference for speed vs. lag.
Adjust Volatility Filter: If the strategy is too selective, increase the ATR Comparison Length.
Risk Settings: Set your Risk Percent per Trade (e.g., 1.0% for conservative trading).
Time Filter: On intraday charts (1m, 5m, 15m), set the Bars to Skip to avoid the opening volatility.
Disclaimer
This script is for educational and backtesting purposes only. Past performance does not guarantee future results. Trading futures and equities involves significant risk of loss
The Dual MA Crossover + Volatility Filter is a comprehensive, trend-following framework designed primarily for futures and high-liquidity assets. Unlike standard moving average strategies that suffer during "choppy" or sideways markets, this system employs a multi-layered filtering process to ensure trades are only taken when momentum, volatility, and timing are in alignment.
Core Logic
The strategy triggers a signal when a Fast Moving Average crosses a Slow Moving Average. However, the signal must pass through three distinct "gates" before an order is executed:
Volatility Expansion Filter (ATR): Compares a short-term ATR against a longer-term baseline. Entries are only permitted when current volatility is higher than the baseline, signaling that a "breakout" or strong trend is likely beginning.
Momentum Filter (RSI): Confirmation of the trend's strength. Longs are only taken if RSI is above a user-defined threshold (default 50), ensuring we are not buying a "dead cat bounce."
Session Time Filter: Specifically designed for intraday traders. It allows users to skip the initial market "noise" (e.g., the first 30 minutes of the NY open) before allowing entries.
Key Features
Dynamic Risk Management: Automatically calculates position size based on a fixed percentage of account equity and the current ATR-based stop distance.
Smart Exit Logic: * Initial Stop: Set at a multiple of ATR from entry.
Breakeven Trigger: Moves the stop to entry price once the trade reaches a user-defined "R" (Risk) multiple.
Trailing Stop: Activates a trailing ATR-stop only after the breakeven trigger is hit, protecting profits during extended trends.
Time Stop: Closes the position if the market fails to make a new High (long) or Low (short) within a specific number of bars.
Futures Optimized: Includes built-in point value calculations for major contracts like ES, NQ, RTY, CL, and GC.
How to Use
Select MA Type: Choose between EMA, SMA, WMA, or HMA based on your preference for speed vs. lag.
Adjust Volatility Filter: If the strategy is too selective, increase the ATR Comparison Length.
Risk Settings: Set your Risk Percent per Trade (e.g., 1.0% for conservative trading).
Time Filter: On intraday charts (1m, 5m, 15m), set the Bars to Skip to avoid the opening volatility.
Disclaimer
This script is for educational and backtesting purposes only. Past performance does not guarantee future results. Trading futures and equities involves significant risk of loss
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
dany
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
dany
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.