Laguerre RSI - non repainting

It seems that the traditional Laguerre* functions repaint due to the gamma parameter.
That goes even for the editorial pick here.
But one could use calculation period instead of "gamma" parameter. This gives us a non-repainting Laguerre RSI fit for scalping trends.
At first glance, I haven't seen anyone do this with a pine script, but I could be wrong because it's not a big deal.
So here is a variation of Laguerre RSI, without repainting. It's a little bit more insensitive, but this is not of great importance, since only the extreme values are used for confirmation.
( * Laguerre RSI is based on John EHLERS' Laguerre Filter to avoid the noise of RSI.)

And if you implement this indicator into a strategy (like I do) I can give you a trick.

Traditionaly the condition is at follows:

LaRSI = cd == 0 ? 100 : cu / (cu + cd)
(this is the final part of the indicator before the plotting)

LongLaguerre= LaRSI<dnb
ShortLaguerre= LaRSI>upb

It's fine for the short (ot exit long), but for the long is better to make a swich between the CD and CU parameters, as follows:

LaRSI1 = cd == 0 ? 100 : cu / (cu + cd)
LaRSI2 = cu == 0 ? 100 : cu / (cu + cd)

LongLaguerre= LaRSI2<dnb
ShortLaguerre= LaRSI1>upb

TradingViewの精神に則り、このスクリプトの作者は、トレーダーが理解し検証できるようにオープンソースで公開しています。作者に敬意を表します!無料で使用することができますが、このコードを投稿で再利用するには、ハウスルールに準拠する必要があります。 お気に入りに登録してチャート上でご利用頂けます。