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 • 2 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 • 1 day ago #

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

avatar
Register or

Likes

avatar avatar avatar avatar avatar
Related users ' posts
okeus Ivan, riesci a creare un indicatore per le "evolventi paraboliche" ? grazie
groelandes Impagable tu trabajo cada semana. ¡Gracias!
Iván de nada! :)
P. Marlowe Muy bueno. ¿Podría hacerse para señalar extremos por el lado bajista? Lo mismo a la inversa....
Miro Esta es una versión del indicador, para ambos extremos. //-------------------------------...
P. Marlowe Muchas gracias ¡¡
jordan //---settings MAmode=0 Period=150 NumberOfMA=100 //---end of settings MA2=undefined ...
jordan dites moi si cela correspond à ce que vous cherchez
kats bonjour merci de ta reponse mais non ca fonctionne pas sympa quand même d'avoir essayé cdlt
Stenozar Ciao IVAN , mi da errore per la riga 49 "print tema low"; puoi suggerirmi la modifica da met...
Iván Avete provato a scaricare il file .itf?
AndyB72 Caricato ora sulla V12, nessun errore.
jacquesgermain Bonjour non pas de soucis car src=customclose donc dans le menu configuration/propriété me...
geroniman Merci Jacques , indic tres utile. J'ai un indic à programmer avec du price action. es tu dis...
jacquesgermain ok pour regarder ...
Nicolas
2 years ago
FXtonio Bonjour Nicolas, merci pour cette merveille, je l'utilise en compl2ment du "magical buy sell...
xpe74 Bonjour Nicolas, quelle est la valeur de MA que l'on doit prendre en compte pour intégration...
Nicolas Il faut faire un CALL de l'indicateur et y placé en paramètre les valeurs des périodes souha...
supertiti Bel outil si on ne se tape pas sur les doigts avec ! Comment ajoute-on une image avec le co...
magnus59 Hi Nicolas, thaks for your great work here, I need a scanner for the swedish OMX when ma...
Nicolas Yes, sure please open a new topic in the ProScreener forum section, thank you.
paullyons Hello! Thanks for post your indicators. I'd like you to let me know how to draw lines for ...
Rafa Hi Nicolas! I can´t install this indicator. it installs in a separate window not as an av...
Nicolas Add it on the price, see how: https://www.prorealcode.com/blog/video-tutorials/how-to-add-an...
Frankyslo1 No consigo instalarlo en el precio en PRL-version 10
robertogozzi An updated version can be found here https://www.prorealcode.com/topic/conversion-of-pine-sc...
jissey Bonjour Robertogozzi, cet indicateur est interessant mais serait-il possible de marquer la ...
robertogozzi Sure, but you should start a new topic on the Probuilder support forum. Thank you :)
Roland57800 Bonjour Noobywan, si je comprends bien l'utilisation de ce code que je trouve particulièr...
Noobywan Bonjour, quand la question a été posée dans le forum à celui qui avait fait la requête en am...
Fabian This Code draws only a retangle if the condition has been confirmed and NOT before (in that ...
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/
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...

Top