LRLR Indicator

LRLR Indicator

Introduction

The LRLR indicator was originally presented by its creator Lukapex in a post where he described it as a tool to identify Low Resistance Liquidity Runs (LRLR) by detecting zones where the price remains above or below a reference line for at least one hour. Based on this logic, the indicator generates “LRLR” text signals directly on the chart.

In this article, we will explore the details of the indicator, highlight some interesting technical aspects of the code, and present an additional perspective: its use in detecting divergences with price, which can be a key function for many technical traders.

Indicator Inspiration

According to the author’s post, the primary purpose of the indicator is to replicate low-resistance areas. To achieve this, it uses the slope of a moving average and verifies whether this slope remains positive or negative for a defined period of time (one hour, in the original example), which then triggers the visual “LRLR” signal.

Beyond the utility described by its original creator, I would like to highlight another potential application of the indicator: detecting divergences between price and the slope of the moving average. This approach allows traders to identify zones where the market’s momentum and price behavior could be disconnected, which could signal potential reversals.

Technical Highlight: Variable Assignment Based on Timeframe

Although the indicator’s code is simple, I decided to create this article because it includes an interesting feature that could be useful for other indicators: the dynamic assignment of variable values based on the chart’s timeframe. The following code snippet demonstrates this concept:

This method automatically adjusts the number of bars per hour according to the chart’s timeframe, which simplifies the development of flexible and scalable indicators. Other programmers can use this technique when building indicators or strategies that need to adapt dynamically without manual intervention.

How the LRLR Indicator Works

The indicator combines the slope of a moving average with market volatility (measured using the Average True Range) to generate visual signals when trend changes are detected. Here’s a breakdown of the main steps:

  1. Calculating the moving average slope:
    The typical price (Open+High+Low+Close)/4 is averaged over a user-defined period (default is 56).
  2. Normalizing with the ATR:
    The difference between the current and previous moving average values is divided by the ATR to get a relative slope.
  3. Detecting slope changes:
    The indicator detects when the slope switches from negative to positive (bullish change) or from positive to negative (bearish change).
  4. Generating the “LRLR” signal:
    If the slope remains positive or negative for the required number of bars, the indicator draws the “LRLR” signal on the chart.

Interpreting the Indicator: Divergence Detection with Price

Although the author initially designed the LRLR indicator to identify dynamic support and resistance zones, I believe its true power lies in its ability to help detect divergences. Divergences occur when the price moves in one direction while the slope of the moving average indicates the opposite direction, signaling a potential loss of market momentum and a possible trend reversal.

  • Bearish divergence: Price continues to rise, but the moving average slope starts to decline.
  • Bullish divergence: Price continues to fall, but the slope of the moving average turns positive.

These signals works in all timeframes charts.

Conclusion

The LRLR indicator not only provides an effective tool for detecting trend changes, but it also opens new possibilities for technical analysis through divergence detection. Additionally, the dynamic variable assignment feature showcased in the code is an excellent example for developers looking to create adaptable and flexible indicators.

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. roccafragius • 66 days ago #

    Thank you Ivan, very Useful! I would like translation of Trading View CCI_S Indicator, How I can ask you it? Thankk you in advance! Franco

  2. Iván • 65 days ago #

    hi, you can ask here: https://www.prorealcode.com/free-code-conversion/

avatar
Register or

Likes

avatar avatar avatar avatar avatar avatar
Related users ' posts
Sofitech Ce code n'est valable que sur la V10.3 ? sur le 10.2 il y a une erreur de syntaxe dans le fi...
Nicolas Oui en effet, c'est un indicateur "10.3" à cause uniquement de la mise en forme des courbes ...
Nicolas En effet, c'est le cas si on copie/colle le code. Ces 2 variables sont inscrites en externes...
Salocin Hello Nicolas, my french is not that well. It occurs an error which can not be solved by cop...
Nicolas Just download the ITF file and import it into your platform, follow these easy steps: https:...
Nicolas
8 years ago
Holt EMA
Holt EMA
1
Indicators
robertanthonyuk Hi,What do the each colour represent? Rob
Nicolas You'll need to preload bars to get the good calculations of you indicators. I did not test i...
David Nicolas I tried DEFPARAM Preloadbars = 5000 And still the same drawn output of entries/exit...
marcara Hi, Thank you very much for the Moving Average Daily indicator, I am using it as indicator i...
Nicolas Je l'ai converti depuis un code pinescript. De mémoire il s'agit bien d'une variation d'une ...
Captain_Walker @Nicolas, I've copied your code into PRT indicator panel to create it. When I attempt to sav...
Nicolas Download the itf file and import it.
Nicolas Please post any question on forums, thanks.
Lavallette Bonjour Nicolas. J'utilise la version 11 et moi aussi j'ai une ligne horizontale malgré l'a...
Nicolas il faut modifier la ligne 20 avec: if adaptive=1 and averagePeriod > 1 and barindex>(...
dakaodo Hi, Wilko. Acc to the original FRAMA paper by Ehlers, Ehler's own code only takes inputs for...
dakaodo For reference, here is Ehlers' original paper: http://www.mesasoftware.com/papers/FRAMA.p...
dakaodo Here is the code with only SC included, per ETFHQ. pri=customclose //len>=4, even on...
Nicolas The code is correct, don't know if the label and color are the same as other trading softwar...
peppe novellino Hi Nicolas, the settings of the alligators are not editable. How can I change it? Thanks in ...
pabo_swe I got very bad performance with this script, it was slow... it seems like if one breaks out ...
bluetime6 Hello Doctrading.   Can you ask you for something? Can you code a screener screen po...
gianlox I added a simple momentum indicator (MACD). I think much better results:   achat = 0v...
gianlox achat = 0 vente = 0 MACD12M = MACDline[12,26,9](close) MACD12S = ExponentialAverage[9](MA...
Nicolas Thank you for contribution. Please consider that advertising is tolerate as long as you cont...
triss1965@gmail.com  Hi, I cant make it work. And if you doing so much money. Why do you have to sell it? It don...
T-rader Eva... He dosen´t sell anything. He is just a nice guy that want to share on of his strategy...
Fabio Anthony Terrenzio this strategy works only in a well defined trend
brosly Good afternoon I am trying to get the complete code of lex strategy made by adolfo since I s...
dreif123 hi Adolfo, is Alex Auto Trading Botindex working on DAX as well ? if so , can you post the...
phili711 Bonjour Si la moyenne 100 est au dessus de la moyenne 20 le trend est baissier zlors pourqu...
Nicolas La comparaison se fait entre la valeur de la moyenne actuelle et telle qu'elle était il y a ...
Thomas007 we should definitely open a new thread for intraday trading - can we post the link once it's...
Denis Bonjour Nicolas, j'ai une question à propos de ce code, il faut que je la pose en anglais ca...
Nicolas En français pas de problème
Lotech123 This Indicator is very useful if the Risk number is altered to suit the time frame, volume o...
Bern error displaying, code must end with RETURN. Any idea hot to fix it?
j102491 how are you applying it to asc trend
Yantra "i believe this indicator could help any trend followers in trading decision. " I'm wonderin...

Top