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 • 62 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 • 62 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
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...
Nicolas c'est exactement ce que je fais entre les lignes 58 et 64 pour pouvoir tracer la ligne complète
Italo Fabian Nicolas, Ces matrices sont-elles des vecteurs unidimensionnels ou multidimensionnels? Depu...
Denis Bonjour Nicolas et RicLg, Merci Nicolas pour cet indicateur intéressant et merci RicLg pour...
Nicolas Il faut l'ajouter sur le prix avec l'icône de la clé situé en haut à gauche du graphique du ...
jerome777 merci de ta réponse
jerome777 bonjour c est bon il fonctionne parfaitement merci beaucoup
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 ...
FXmike hey my friends, thank you for this great code. my problem is he make no trade open. backtest...
FXmike Can i put a Action that my start contract is smaller than 1 ? 0.3 or 0.5 ? In wich Position...
phoentzs I wrote the code for M15 back then and also variants in H1 and M1. Everything works so far....
Alps007 Hi Nicolas. Happy New Year. Can you please program me several MACD divergence screeners ...
Arlei Zanin Hello Nicolas, would it be possible to convert the Cloud to Pascal language? Thank you.
ashee i want it in MT4
Marie-Eve Vergoz Bonsoir - Voici l'erreur qui est signalée lorsque je souhaite utiliser cet indicateur : il...
Vonasi Sure that is possible. I will code it and make a post in the English ProBuilder forum and pu...
Vonasi Vama v2 with Hull moving average included can be found here: https://www.prorealcode.com/top...
JMat45 Thank you, Vonasi.
Nicolas
6 years ago
LRMA
LRMA
0
Indicators
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
riz001 thnk u
geroniman bonjour Nicolas, j ai un indicateur le Tiger . J aiemrai placer des fleches buy et sell dire...
Nicolas Merci de formuler les demandes sur le forum. ça n'est pas le bon endroit et hors sujet ici ! ;)
Alberto Aguilera Hi! Thanks for your strategy Anyone can check it with 200 bars?
TempusFugit Hi, this simple system for DOW and only shorts has worked quite well, maybe because of its q...
phoentzs Unfortunately, I never pursued this strategy further. Maybe I should take a look with what ...
robertogozzi It surely CHANGES even when currently outside time range, as the lookback periods change as ...
SkippyTrader Thanks Roberto, but shouldnt the values in the outside time range not be different? As it sh...
robertogozzi Actually it is a constant (I tested them on a 1-hour TF, 9am to 5pm) and outside that time r...
funkystuff Salut Balmora, Ton indicateur est plutôt intéressant :) Penses-tu qu'il soit possible de l'...
brian gilbert Hello, can you explain to me what are "pipsize" and "ATAN"? What functions do they have and ...
Bodaris Bonjour, Je suis débutant 1 mois :p pipsize ressemble à la fonction pointsize et ATAN...
Nicolas Il s'agit d'un indicateur compatible avec PRT v11 uniquement. Pour éviter les erreurs de cop...
Sébi Intéressant. Merci pour ce partage Nicolas. L'indicateur ne considère pas les divergences ...
Nicolas ok, pour les divergences chacun voit midi à sa porte je dirai :) Vu qu'il n'y a pas de formu...
darbes Hi How does it go on live ? JC
antonio73 Balmora74, io vedo che funziona anche su timeframe ad 1 minuto con piccole ottimizzazioni, t...
Juananantoniorodriguez hola buenas, a este sistema automático, Cómo se le podría poner un stoploss de beneficio sim...
Leo I don't know, I just copy paste the strategy. The optimisation of the values I wrote them in...
bertrandpinoy hello Leo I'm spending time on your strategy code. do you agree to try to include this code ...
bertrandpinoy //version a: ajout filtre MM defparam cumulateorders=false // --- paramètres taille =...
capgros Bonjour @Nicolas, Thanks a lot for this tool, it is very useful for me. I would like to s...
Hans63 Would you add the possibility to color also the Heikin Ashi and bar chart?
Nicolas That's possible, please open a new topic in the indicator forum explaining what you need exa...
Nicolas Change line 62 with: drawcandle(flup,fldn,flup,fldn) coloured(169,169,169,80) bordercolor(16...
DimKar Thank you very much from Greece sir , have a nice day ....!!!! Really i do not have words...
mit_ose Bonjour, J'ai d'excellents résultats avec cet indicateur simple et efficace; Merci beaucoup;

Top