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 avatar
Related users ' posts
Om Hello, thanks for sharing! Getting a message that Variable P is undefined?
matin Intraday Average Volume Indicator Not working, what can i do plz
Nicolas Just add it on the price series.
yomisadiku Hello Nicolas, Can I use high and low price at lines hh=max(hh,close) and ll=min(ll,close) ...
Nicolas Yes you can do that, the impact will be that the trailing stop line will be much close to th...
Byggtrader Hi Nicolas! How do I get the indicator in the price chart? It only stays under i new chart.
Nicolas Just add it on the price chart by using the wrench on the left upper side of the chart (pric...
Dom Hello, hello....je commence le trading et découvre par la même occasion le codage....et ce n...
Nicolas Merci, ça fait plaisir !
Be-n Bonjour tout le monde ! Dans l'indicateur de tendance, j'ai du mal à saisir la nuance entre ...
Vonasi Sure that is possible. I will code it and make a post in the English ProBuilder forum and pu...
Vonasi Vama v2 with Hull moving average included can be found here: https://www.prorealcode.com/top...
JMat45 Thank you, Vonasi.
Globalmarkets79 Thank you Vonasi for the answer. I have an other question. When i tried to run the indicator...
Vonasi Lines is either 0 or 1 to turn on or off the drawing of them. Once again if you download and...
Globalmarkets79 Thank you Vonasi, this indicator is very helpful!!!
Nicolas
6 years ago
Bateson Merci pour la réponse Nicolas. C'est bien ce que j'ai fait mais ça ne fonctionne toujours pa...
Enzo Paliotti Veramente ottimo, era quello che cercavo, si potrebbe modificare inserendo come variazione a...
Nicolas Perché no, chiedetelo con una descrizione dettagliata nel forum degli indicatori, per favore!
jiddan78 how to convert to afl amibroker ?
Nicolas We do not supply free coding assistance for AFL Amibroker on the website. You can ask for pa...
Ngomsi @ Vonasi, how to use timeframe , 13 minutes ,21 minutes, 34 minutes,et 55 minutes with this...
manchokcity can we have it in mql4 platform? or how or which platform do we use it?
camporan I don't use MetaTrader so I won't be able to do the translation myself. Sorry!
Alexander9 This can for amibroker ? . Thanks
riz001 thnk u
geroniman bonjour Nicolas, j ai un indicateur le Tiger . J aiemrai placer des fleches buy et sell dire...
Nicolas Merci de formuler les demandes sur le forum. ça n'est pas le bon endroit et hors sujet ici ! ;)
avatar
Anonymous Hi robertogozzi - thank you very much for sharing this strategy. I have performed various ...
robertogozzi Thank you samsampop.
Dotan Hello guys I really appreciate this coding effort but can I use this code for Mt5 Forex Trad...
LucioleLucide Clean view, thanks for sharing
dertopen hi where i can found the window for candle configuration?
paolosab69 Ciao! . I have seen the pictures that explain this metod but i don't understand when is mome...
coscar Ottimo lavoro. come sempre!
luxrun Nello studio di Sepiashvili viene descritto anche un altro indicatore, il Q-indicator, che è...
Maik2404 wie kann ich den Code bekommen Paul?
jens_kittner Works with US Crude at 1h as well!
Jean-Claude REGIS Je préconise de regarder les graphiques H1 et M15 pour visualiser la tendance de fond et d'...
capgros Bonjour @Nicolas, Thanks a lot for this tool, it is very useful for me. I would like to s...
Hans63 Would you add the possibility to color also the Heikin Ashi and bar chart?
Nicolas That's possible, please open a new topic in the indicator forum explaining what you need exa...
Nicolas
7 years ago
BSTrend
v10.3
BSTrend
10
Indicators
Florian Legeard C’est à dire sur le prix et non sur le temps ? Merci
Rohit82189 bstrend repaints
Nicolas No, it doesn't repaint.
XXXXVII Excellent indicateur ! Déterminer une tendance est devenu un jeu d'enfants ! Félicitation......
gregoire bonjour nicolas j ai cherché partout sur le net et impossible de trouvé ce que je recherch...
Nicolas Merci de poster une demande dans le forum des indicateurs, ainsi on pourra le coder dans ce ...
cfta Hi Fulvio, many thanks for sharing this clever indicator, much appreciated. As Pepsmile ment...
cfta Sorry adding the PRT to code didn't work in the above comment so I guess we will have to set...
juanj Something appears to be wrong with this formula as graphing t shows t to almost never be wit...

Top