Moving Average Trend Sniper

Moving Average Trend Sniper

1. Introduction

The Moving Average Trend Sniper indicator is designed to detect trend movements more accurately than traditional moving averages. This indicator goes beyond simple price averaging: it integrates adaptive volatility-based smoothing, dynamic trend filters, and slope analysis to deliver a clearer picture of market direction.

Its main goal is to provide a smart and visual trend-following tool, highly responsive to significant price shifts while filtering out noise during sideways markets.

2. Indicator Logic and Foundation

This indicator is built upon a solid base of advanced technical analysis concepts. Its core logic combines:

  • Adaptive moving averages, which adjust to volatility and structural price changes.
  • Directional filters based on the slope angle (derived from ATR) to dynamically decide whether to prioritize highs or lows.
  • Chebyshev-like smoothing, which adapts based on price impulses, reacting more quickly when significant shifts occur and less when the market is stable.
  • Dynamic envelope bands, calculated from a modified ATR, serving as visual references for support/resistance zones during trends.

3. Indicator Components

Here’s a breakdown of the indicator’s main components:

• Chebyshev-like adaptive smoothing

This smoothing mechanism adapts only when structural changes are detected in recent highs or lows. If not enough bars are available, it falls back to using the close price.

• Slope angle and dynamic source

The indicator calculates a slope normalized by ATR and converts it into an angle. Based on the angle’s sign, it chooses the data source: average of highs or lows.

• Modified ATR

A progressively accumulated ATR (atrema) is used to stabilize volatility calculations over time. This value is key to defining the filter’s offset and band width.

• MATS trend filter

This is the core of the trend detection logic. The filter updates conditionally depending on whether the movement is strong enough. It doesn’t blindly follow price – it demands confirmation.

• Envelope bands

Plotted above and below the MATS line, these bands are based on ATR and help to visually capture zones of potential support and resistance within trends.

• Dynamic coloring

The indicator changes color depending on whether price is above or below the trend filter, giving a quick visual cue of the prevailing trend direction.

4. Settings and Custom Parameters

The indicator includes several tunable parameters for greater flexibility:

  • length (default: 30): main smoothing period. Higher values slow the indicator down.
  • atrMult (default: 0.5): ATR multiplier for the envelope bands. Higher values create wider bands.
  • wildersPeriod and atrPeriod: automatically calculated from length.

Tip: for highly volatile instruments or lower timeframes, consider using a smaller length (10–20). For daily or weekly charts, keeping it at 30 or even higher is more effective for capturing long-term trends.

5. Practical Use and Advantages

This indicator is especially useful for:

  • Trend-following in medium to long-term timeframes.
  • Filtering false signals during consolidations thanks to its adaptive directional logic.
  • Quickly identifying trend shifts via color changes.
  • Defining dynamic zones of support/resistance with the envelope bands.

Compared to a classic moving average (like EMA or SMA), the Trend Sniper adapts its behavior to market conditions, providing better-informed signals and reducing lag in evolving markets.

6. ProRealTime Indicator Code

Share this

Risk disclosure:

No information on this site is investment advice or a solicitation to buy or sell any financial instrument. Past performance is not indicative of future results. Trading may expose you to risk of loss greater than your deposits and is only suitable for experienced investors who have sufficient financial means to bear such risk.

ProRealTime ITF files and other attachments : How to import ITF files into ProRealTime platform?

PRC is also on YouTube, subscribe to our channel for exclusive content and tutorials

avatar
Register or

Likes

avatar avatar avatar avatar avatar
Related users ' posts
JC_Bywan For people interested in the screener: https://www.prorealcode.com/topic/screener-buy-sell-m...
octum Gracias NJicolas. Las lineas 35 y 36 dan fallo. (¿Es adrede para iniciados?) Puedes co...
mortezaali14 Salut Nicholas, comment exécuter ce fichier dans les métadonnées
Nicolas Yes, Magic if the variable that contains the value of the line, you can test if it goes up o...
dadah1987 Bonjour Nicolas, merci pour cet indicateur. Utilisant pour l'instant la création simplifié p...
Nicolas Merci d'ouvrir un sujet sur le forum avec une description complète du système.
GustavoLoboOrenstein Is it possible to add histogram with only increasing bars?
YvesRobert Bonjour Nicolas, en effet ca marche, je me suis trompé, j'ai bien tout le tracé. C'est parce...
oliTR Bonjour, les conditions longCond et shortCond ne contiennent-elles pas une condition qui s'a...
xpe74 Utilitaire vraiment top, d'autant qu'ajouter des filtres de seuil peux aider a limiter le no...
Jiacky
3 years ago
Kalman Filter
Kalman Filter
0
Indicators
Dest
3 years ago
DIDI Index
DIDI Index
0
Indicators
Stenozar Hi Sever, how can I visualize the coloured areas?
Sever Hi Stenozar, You need to add the color zones yourself , just go to Add Color Zone To set ...
atlante hi nicolas this indicator have 2 wrong borderline and islalastbarupdate. thank you can you h...
Nicolas That'"s because you are not using PRT v11? Just remove lines 59 to 62
Kanamax Hi Roberto, sorry for my confusing previous posts (forget them). My request is very simple,...
robertogozzi Please start a new topic in ProOrder support.
robertogozzi There you go: myMagicTrend = CALL “Magic Trend custom”[20, 14, 1, 5] alpha = 105 b = 0...
johann8 exactly :) Thank you all for the help!
max_92 Ciao Roberto, ho scaricato l'indicatore e come ti avevano già scritto sopra anch'io vedo la ...
ChemaGeek Bonjour Nicolas, j'ai récemment découvert cet indicateur (Regularized Momentum 2017) et je l...
YvesRobert Bonjour, nouveau sur PRT (qq jours), j'essaie un peu de voir quel type d'indicateur me convi...
Xenotrax A première vue, sa à l'air d'être un indicateur très puissant sur de petites temporalités, j...
merri Bonjour Nicolas, Comment transformer cet indicateur en bot sur PRT ?
Nicolas Cela a déjà été fait, voir ce sujet: https://www.prorealcode.com/topic/strategia-con-lindica...
Nicolas change the last line with: return v coloured(r,g,b) style(line,2), v+band coloured(168,168,1...
Paolo.B Thanks ... works as i wanted.
Kanamax Bonjour Nicolas, comme Paolo.B je souhaiterais utiliser cette indicateur au sein d'un code. ...
zilliq Thanks @Nicolas. I tried to use it as Trend in a proorder system, but don't know why, it doe...
Suzu Yuk He is right. MT and mavgMT are not defined and causing errors.....
RakeshPoluri I have a question about the bands on the candles. Is it bollinger bands or something else?
Nicolas I think that's 2 Bollinger Bands
Emperor.it "style(line,2)" C'è una guida ai parametri che si possono modificare ? Tipo stile della lin...
IV Mcm https://www.prorealcode.com/programming-with-prorealtime/

Top