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
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 ...
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/
Daniele Maddaluno Écrivez-moi où vous préférez you can easily find me on LinkedIn
AK27 C'est payant visiblement sur linkdin je peux pas vous envoyer, discord vous avez ?
Pensera Bonjour Nicolas, comment est-il possible de backtester cet indicateur? cela fait une erreu...
Nicolas Oui bien sûr, il doit y avoir pas mal de sujets dans le forum à ce propos.
simmerseb Bonjour, merci beaucoup pour cet indicateur je le trouve très clair et pertinent.
fazel53 How do i attach this indicator to my mt5 platform?
Nicolas You can't! All indicators here are for ProRealTime trading platform: https://www.prorealtime...
mistersylv What parameter should we change to make another channel appear in the higher or lower time u...
Nicolas Il doit s'agir d'un mauvais copier/coller. Je suggère de télécharger le fichier itf contenu ...
Bard Hello @Nicolas, I can get this to display in a separate indicator panel but not on Price as ...
Stenozar Hi @Nicolas, how can I put the bands on price? Thanks, Stefano
Guillaume Mcm I gave the above message fix ;)
Tradingrob Is it possible to put the itf-file in the right way here in Prorealcode? so the right 'trend...
Guillaume Mcm Update link ;) https://www.prorealcode.com/topic/trend-histogramme-cci-mise-a-jour-suite-...
Screw27 Hi man, I installed the indicator and i don't know why but my graph it is so big
HelixKing sounds interesting I'll take a look

Top