Trend Levels Indicator: A Dynamic Support, Resistance and Trend Indicator

Trend Levels Indicator: A Dynamic Support, Resistance and Trend Indicator

The Trend Levels is a technical indicator designed to identify and visually represent trend changes and dynamic support and resistance levels on price charts. This indicator helps traders detect key market moments through reference lines, labels, and arrows that clearly signal direction changes.
It is a valuable tool for both intraday traders and those who operate on higher timeframes.


How the Indicator Works

1. Key Value Calculations

The indicator calculates the highest (hi) and lowest (lo) values over a user-defined period using the length parameter.
These values serve as references to determine when a new high or low is reached, potentially indicating a trend reversal.

2. Trend Direction

The trend direction is determined by comparing the highest (hi) and lowest (lo) values with recent highs and lows:

  • Uptrend (trend = 1): occurs when the price reaches a new high within the defined period.
  • Downtrend (trend = -1): is triggered when the price hits a new low within the defined period.

This trend change is key to identifying significant turning points in the market.

3. Drawing Trend Change Arrows

When the indicator detects a trend change, it draws arrows to mark these key points:

  • Up arrow (lime green): signals the start of an uptrend.
  • Down arrow (fuchsia): marks the beginning of a downtrend.

These signals allow traders to visually identify moments when the price may initiate a significant new movement.

4. Dynamic Level Calculations

From the moment a trend change occurs, the indicator calculates the following levels:

  • h1 (upper level): the highest value since the trend began.
  • l1 (lower level): the lowest value since the trend began.
  • m1 (mid-level): the average between the h1 and l1 levels.

These levels help identify dynamic support and resistance zones on the chart, providing clear visual references for technical analysis.

Visual Interpretation on the Chart

  • Reference Lines
    The Trend Levels indicator draws three horizontal reference lines:

    • h1 (upper line): displayed in lime green.
    • l1 (lower line): displayed in fuchsia.
    • m1 (mid-line): displayed in gray with a dotted style.
  • Text and Labels
    Next to each line, in the lastbarindex, the indicator displays a label showing the value of each level (#h1##l1##m1#).

Indicator Configuration

Customizable Parameters

  • length: The number of bars used to calculate highs and lows (default value: 30).
    This parameter allows the analysis period to be adjusted for different timeframes, ranging from intraday charts to daily charts.

Code Trend Levels indicator

Conclusion

The Trend Levels Indicator is an effective tool for identifying key dynamic support and resistance zones and detecting trend changes in a visual and precise way. By combining reference lines and arrows that highlight market turning points, this indicator provides traders with a clear view of entry and exit opportunities.
It is recommended to adjust the length parameter according to the timeframe and asset being analyzed to maximize the indicator’s effectiveness in different market contexts.

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

  1. Gaspare • 59 days ago #

    Grazie Ivan, ottimo indicatore
    posso chiedere, per favore, una strategia che apre posizioni long con freccia verde e short con la fucsia?
    Grazie

    • Iván • 58 days ago #

      thanks! maybe I could test it

avatar
Register or

Likes

avatar avatar
Related users ' posts
Godo Bonjour Souhait Sam, Après de nombreux essais pour le mettre en format afin d'utiliser ce c...
Nicolas Il faut supprimer celles qui existent dans la fenêtre d'optimisation et les créer en dur dan...
crusoe76 hi there, anyone can help making this strategy work, i have a message saying replace variabl...
Screw27 Salut nicolas j'aimerais savoir tes résulats grace a cettte methode
eva.g.forsgren It dose not work, I get a strap instead of candels???????????????????????????????????????????
Nicolas That indicator is the one below the chart. The indicator to put on the price chart is this o...
pyhrus P.S : IG , que j'ai contacté ,m'indique que la version V11 , ne sera pas disponible avant un...
Hasardeur Dear Nicolas, is there someting at the arry to modify in order to run the trend at the actu...
MALIMALO Dear Nicolas, just try touse your indicator with backtest but it's not working. is anybody...
ribes65 Bonjour Nicolas, Merci pour votre travail. Est-il envisageable de créer un screener pour ...
Nicolas Bien sûr, merci de formuler une demande dans le forum des screeners pour prorealtime. En res...
ipbvba Est il possible de le transformer en indicateur (pour ne plus avoir les lignes mais uniqueme...
supertiti Bonjour Nicolas, Je ne comprend pas bien , le trend change de couleur quand les prix sont a...
Nicolas Oui ce serait possible, cependant l'indicateur est bien prévu pour conserver la couleur de l...
supertiti Quand tu pourras si tu peux nous coder la troisième couleur cela améliorerait les trades cou...
Nicolas How to import file page: in the help section of the website explains howto
kenssa import through the indicator page/window in the Proreal time
chicoteca Buenas, no consigo que se me muestre en el chart de DAX. ¿Cómo procedo? Gracias.-
Ciccarelli Franco Per lasciare che la strategia venga eseguita (dopo aver importato il file): Basta eliminare...
JADINVEST Hello Jan, hello everyone, Thanks Jan for this strategy! Since 2020, have any of you found a...
Alessandro Furlani Hi Ian, hope you still use PRT and so you can read this post. I have tested a lot your work ...
Stockastiss Can this code be simply transferred into Backtestingcode so one doesnt need to use call ? (i...
Vonasi Sorry for the late reply. Add the code to your strategy and remove line 5 and line 39. Chang...
viktorthunss Hi! How many averages are there? Can I see the somewhere?
carpentier Joffrey Bonjour à tous, Avant tout merci pour ce travail, cependant je suis bloqué quand je l'insta...
carpentier Joffrey Re, C'est ok, j'ai trouvé mon erreur... Cependant sur quel base peut on calculer son CALC...
Aragorna Hi Nicolas, How is it possible to use it in a higher timeframe plotted on a lower timeframe?...
leofi https://www.prorealcode.com/topic/simple-average-with-visual-color/
leofi Go visit www.prorealcode.com/topic/simple-average-with-visual-color/ and watch 2em post
Dritan Hi,I am new on Prorealtime and coding.I downloaded the indi but I have it on a separate wind...
Bhanu Pratap Great Work Sir, Hats Off.
bolsatonimora2 Hi Roberto, It is possible to modify this indicator which it marks the supports and resist...
robertogozzi What do you mean by "very high volume"? What do you want to be printed exactly?
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 ...
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!
Bard Very interesting approach Vonasi! I'm getting a 404 error when trying to download though?
Vonasi I just tested and I was able to download with no error.
Psari Hi Vonasi, I am a newbie and was wondering whether you could possibly help me with this pro...
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

Top