OPEN-SOURCE SCRIPT

Strategy: HMA 50 + Supertrend Sniper

327
HMA 50 + Supertrend Confluence Strategy (Trend Following with Noise Filtering)

Description:
Introduction and Concept This strategy is designed to solve a common problem in trend-following trading: Lag vs. False Signals. Standard Moving Averages often lag too much, while price action indicators can generate false signals during choppy markets. This script combines the speed of the Hull Moving Average (HMA) with the volatility-based filtering of the Supertrend indicator to create a robust "Confluence System."

The primary goal of this script is not just to overlay two indicators, but to enforce a strict rule where a trade is only taken when Momentum (HMA) and Volatility Direction (Supertrend) are in perfect agreement.

Why this combination? (The Logic Behind the Mashup)

Hull Moving Average (HMA 50): We use the HMA because it significantly reduces lag compared to SMA or EMA by using weighted calculations. It acts as our primary Trend Direction detector. However, HMA can be too sensitive and "whipsaw" during sideways markets.

Supertrend (ATR-based): We use the Supertrend (Factor 3.0, Period 10) as our Volatility Filter. It uses Average True Range (ATR) to determine the significant trend boundary.

How it Works (Methodology) The strategy uses a boolean logic system to filter out low-quality trades:

Bullish Confluence: The HMA must be rising (Slope > 0) AND the Close Price must be above the Supertrend line (Uptrend).

Bearish Confluence: The HMA must be falling (Slope < 0) AND the Close Price must be below the Supertrend line (Downtrend).

The "Choppy Zone" (Noise Filter): This is a unique feature of this script. If the HMA indicates one direction (e.g., Rising) but the Supertrend indicates the opposite (e.g., Downtrend), the market is considered "Choppy" or indecisive. In this state, the script paints the candles or HMA line Gray and exits all positions (optional setting) to preserve capital.

Visual Guide & Signals To make the script easy to interpret for traders who do not read Pine Script, I have implemented specific visual cues:

Green Cross (+): Indicates a LONG entry signal. Both HMA and Supertrend align bullishly.

Red Cross (X): Indicates a SHORT entry signal. Both HMA and Supertrend align bearishly.

Thick Line (HMA): The main line changes color based on the trend.

Green: Bullish Confluence.

Red: Bearish Confluence.

Gray: Divergence/Choppy (No Trade Zone).

Thin Step Line: This is the Supertrend line, serving as your dynamic Trailing Stop Loss.

Strategy Settings

HMA Length: Default is 50 (Mid-term trend).

ATR Factor/Period: Default is 3.0/10 (Standard for trend catching).

Exit on Choppy: A toggle switch allowing users to decide whether to hold through noise or exit immediately when indicators disagree.

Risk Warning This strategy performs best in trending markets (Forex, Crypto, Indices). Like all trend-following systems, it may experience drawdown during prolonged accumulation/distribution phases. Please backtest with your specific asset before using it with real capital.

Feragatname

Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, alım satım veya diğer türden tavsiye veya öneriler anlamına gelmez ve teşkil etmez. Kullanım Koşulları bölümünde daha fazlasını okuyun.