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
Related users ' posts
Iván
1 year ago
Iván Si lo descargas e importas en tu PRT verás que se han creado las variables para luego config...
WhyAskOZ Hi, Ivan As always you are doing great coding. The code works on my PRT, however the issu...
Iván You can delete in the last line (return) the configuration for color. Delete coloured(xx,xx,...
Bernard13 (Je réécris mon commentaire -français- en français car certains mots ne correspondaient pas ...
Iván 1000 indicateurs !!! brutaux
Iván Gracias! Para el screener sólo tienes que copiar el indicador y poner como condición de búsq...
Lean Muchas gracias Iván, ya lo he podido crear.
bertoluce Hello Ivan, thank you very much for the indicator. An observation: would it be possible (and...
Doddge Hola Iván, ¿sería posible crear un screener que indique cuándo las velas coloreadas del indi...
RTR Ivan thank you for the pro-screener. I a trying to understand how to write the signals from ...
Iván Hi, Lines 62 and 63. These lines define buy and sell conditions.
Iván Hi You should delete from the indicator code all drawing functions and all variables not us...
Iván I've created a screener to show [longcondition or shortcondition]
Chrisinobi Hallo Ivan, Danke das ist Perfekt !! Kannst du bitte in der Screener-Bibliothek die itf. hoc...
MaoRai54 Thanks, now it's OK. in your first code at line 15-16 it's missing.
Madrosat Hello Ivan Did you try a strategy with this indicator
Iván Hi. No I didn't. This is a code translation requested by an user a few days ago.
Iván
1 year ago
cjr30 Simplemente modifica las lineas 19 y 21 por las siguientes: drawtext("▲",barindex,low-0.1*a...
groelandes Gracias!!
WhyAskOZ i copied the code into strategy and it gives error on line 21 and 23. it says " Line 1: ...
Iván
1 year ago
Madrosat Hello Ivan You have interesting topics on indicators , smart supertrend, optimised trend t...
Iván Hi! thanks. All of these codes are translations requested in the forum. I've on mind to back...
Raspete01 Buenos días Iván, estoy intentando llevar el código eliminando los colores y pasando un Back...
Iván
1 year ago
winnie37 Hi Ivan, if i want to use it, and call the oscillator value (in grey, green or red), how to...
Iván The oscillator is smoothtype. In inputs there is de lag to configure the output
ARLEQUIN49 Hello Ivan, Would it be possible to convert the code of this QQE MOD indicator which accomp...
ARLEQUIN49 here is the code: //@version=4 //By Glaz, Modified // study("QQE MOD") RSI_Period = i...
Iván Hi, Yes I can translate it but please, create a new topic for it.
Fgats quelques explications en Français ici : Some explanations in French here : https://www.p...
Nicolas Merci pour cette contribution, j'apprécie ! :)
Fgats Merci Nicolas pour ces encouragements et merci aussi pour le commentaire en Anglais accompa...
Alai-n I really like it when you develop ideas around price movement! I am much less a fan of all t...
elcortijoverde Muy buen trabajo.Intuitivo y claro.Gracias por tu dedicación y aportación.
Nicolas
2 years ago
B-Xtrender
B-Xtrender
8
Indicators
616248 Bonjour Nicolas, Peux tu nous expliquer le principe de fonctionnement ? Ou nous mettre un...
Nicolas Le lien vers l'article IFTA de l'auteur est dans le post déjà :)
P. Marlowe Very poweful indeed. It deserves close attention. I really appreciate very much IFTA backgro...
JS
2 years ago
Trendilo
Trendilo
1
Indicators
Coded1 very interesting indicator, thanks JS
Nicolas
2 years ago
Lucas0000 Hello, Congratulations on this programming, it seems incredible to me, I am new to this but ...
plbourse Hello, I am trying to use this singal (in fact I have converted it to an indicateur giving B...
manfeber Buenos dias,alguien me podria decir como se descargar el archivo o el indicador Q-Trend??,ya...
BriceE Bonjour Nicolas, Je suis a la recherche d'indicateurs pour me donner la meilleure indicatio...
Nicolas
2 years ago
Maxime Baudin Well done Nicolas, creative!
Stenozar Hi Nicolas, please can you explain how to read/use this indicator? thanks!

Top