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 • 59 days ago #

      thanks! maybe I could test it

avatar
Register or

Likes

avatar avatar
Related users ' posts
Nicolas
7 years ago
Maxime Baudin Interesting, Thank you! :)
franck-david Bonjour Nicolas , actuellement je me forme grace a vos videos tres tres bien expliques mer...
Nicolas Merci. ça n'est pas le lieu pour poser ce genre de question :) Merci d'utiliser le forum Pro...
Vonasi Discussion on this indicator/filter can be found here: https://www.prorealcode.com/topic/121...
Domenec Claro Juanjo de todas maneras en deinversoratrader.com tienes estsos osciladores evolucionad...
Dron Hola Domenec, en la descripción hablas del indicador velas de colores, no lo encuentro en la...
Domenec Hola Dron mira en el blog deinversoratrader.com en formacion indicadores ahi hay varios grat...
Gianluca ok i fixed it i hope is ok like this: //TAC trader zone 10.2 | indicator //01.01.2018 //R...
TAC Bolsa Hello try this new version or view the blog with the new indicators .. https://www.t...
TAC Bolsa Sorry, TAC Trader Zone V2 https://www.tiburonesdealetacorta.com/2018/11/indicador-tac-tr...
Geronima Ortiz I watched the video three times, but I can not put the npips parameter as a variable. I do...
Geronima Ortiz I think the video is for an old version of prorealtime, the images do not correspond at all ...
Nicolas indicator1 = CALL “PRC_StopReversal”[npips, 1] and define npips in the optimization window ...
Caribeengeek Bonjour j’avais vu que vous proposiez d’écrire des codes pour ceux qui s’y connaisse pas Mai...
Caribeengeek Les devises unité
Nicolas Merci d'utiliser le forum pour les demandes de programmation personnalisée
ullle73 nicolas, can you somehome make this to be in the background of the price chart?
jonpt88 none did that yet right?
Nicolas You can ask for a code modification on forums, please open a new topic with your request.
Toto le Heros Thanks Nicolas. I read somewhere that in the calculation, we should round the value of the A...
Nicolas aADX = round(adx[10])
bolsatrilera
7 years ago
Rainbow Oscillator
Rainbow Oscillator
1
Indicators
Maxime Baudin Interesting, thanks! Combine this indicator with the bollinger bands there is enough to make...
FULVIO09 Attualmente non c'è sufficiente volatilità : la condizione "C0 = AverageTrueRange[1500](Clos...
vlongobardo67 Ma io intendevo in backtest ! Scusa non l’ho menzionato.
ciniselloftse salve fulvio .il trading sistem e sempre profittevole?
supertiti Bonsoir à tous For those who like me want to calibrate this indicator on a scale of 0 to ...
verdi55 You can find me at www.FXautomate.com Ahh. So i got it ? 4 different supertrends without th...
juanj What? This has nothing to do with the website. The site is simply a service to help people ...
Nicolas Advertising is allowed,as long as people are helping others and if provided services are abo...
styrke Hello Nicolas, Nice screener, I appreciate the way you always try to condense at maximum th...
Nicolas There's no particular reason. RSI is widely use with its default period and results seems re...
Vonasi I noticed a couple of typo errors in the code. The list of variables lines 4 to 11 should be...
Genotik Thank you for your important contribution this week which is much appreciated! Happy New Yea...
Vonasi No problem. I hope they are useful to someone. Happy and hopefully prosperous New Year to y...
DarioMazza Hi Vonasi, i have a question for you, the comand "pricetype" where did you found it in the ...
Vonasi PriceType is just a variable that I use. The value decides what type of price is used in the...
Vonasi I noticed a couple of typo errors in the code. The list of variables lines 4 to 11 should be...
cervantes2 Buenas tardes y gracias por este magnifico indicador. Queria saber si tienes un proscreener ...
cervantes2 Que busque los valores que la linea verde acaba de cruzar al alza o a la baja
AngelPujalt Tenéis algún screener de este indicador?
Nicolas
7 years ago
Trinity Impulse
Trinity Impulse
5
Indicators
ribou ah d'accord merci beaucoup
domenico nlevel1 non modifica la curva al variare del suo valore
tiger_man_no1 Very nice ; what is the best period input date for DAILY CHART ?
Yannick Hello There is a mistake in trailing stop code, I think that this should fix the problem s...
Paul About the trailing-stop the way it's coded. That works for backtesting only, just look at th...
Jonny sorry paul, but system says that is not possible to put many stop order combined...what have...
s00071609 I am using this indicator but it keep crashing as i change the timeframe. For example, chang...
Nicolas in the mean time you can try this one: https://www.prorealcode.com/prorealtime-indicators/ho...
Gianluca Is it possible to have an indicator where those value are as instogram ? and separated? in o...

Top