Lethe Effect indicator

Adeodatus

Active member
Plus
Inspired by the Greek River Lethe along the banks of forgetfulness and obscurity, price impulses gently fade, restoring balance and harmony like equilibrium. A toggled buy (Y/N) indicator using shaded areas divergence engines enhance leading strategies.
Code:
#===========================================
# LETHE EFFECT — HARMONY OSCILLATOR v2.02
# ATR-Normalized • Divergence Engine • Strategy Mode
# Adeodatus/cbt / 31/12/25
#===========================================

declare lower;

#------------------------- INPUTS -------------------------
input length             = 14;
input decay_factor       = 0.85;
input overBought         = 70;
input overSold           = 30;
input midLevel           = 50;
input enableStrategy     = no;
input divergenceLookback = 5;

#-------------------- MOMENTUM + FADE ---------------------
def momentum = close - close[length];

rec faded = if BarNumber() == 1
            then momentum
            else faded[1] * decay_factor + momentum * (1 - decay_factor);

#----------------------- NORMALIZATION ---------------------
def ATRnorm = Max(ATR(length), AbsValue(momentum));
def LetheValue = if ATRnorm != 0
                 then (faded / ATRnorm * 50) + 50
                 else 50;

#------------------------- PLOTS ---------------------------
plot Lethe = LetheValue;
Lethe.SetDefaultColor(Color.CYAN);
Lethe.SetLineWeight(3);

plot MidLine = midLevel;
MidLine.SetDefaultColor(Color.WHITE);
MidLine.SetStyle(Curve.LONG_DASH);

plot OB = overBought;
OB.SetDefaultColor(Color.RED);
OB.SetStyle(Curve.SHORT_DASH);

plot OS = overSold;
OS.SetDefaultColor(Color.PLUM);
OS.SetStyle(Curve.SHORT_DASH);

# Correct cloud ordering
AddCloud(OB, Lethe, Color.DARK_RED, Color.DARK_RED);
AddCloud(Lethe, OS, Color.DARK_GRAY, Color.DARK_GRAY);

#----------------------- SIGNALS ---------------------------
def buySignal  = Crosses(Lethe, OS, CrossingDirection.ABOVE);
def sellSignal = Crosses(Lethe, OB, CrossingDirection.BELOW);

plot BuyArrow = if buySignal then OS else Double.NaN;
BuyArrow.SetPaintingStrategy(PaintingStrategy.ARROW_UP);
BuyArrow.SetDefaultColor(Color.GREEN);
BuyArrow.SetLineWeight(4);

plot SellArrow = if sellSignal then OB else Double.NaN;
SellArrow.SetPaintingStrategy(PaintingStrategy.ARROW_DOWN);
SellArrow.SetDefaultColor(Color.RED);
SellArrow.SetLineWeight(4);

#------------------- DIVERGENCE ENGINE ---------------------
def priceLow  = low == Lowest(low, divergenceLookback);
def letheLow  = Lethe == Lowest(Lethe, divergenceLookback);
def priceHigh = high == Highest(high, divergenceLookback);
def letheHigh = Lethe == Highest(Lethe, divergenceLookback);

def isBullDiv = priceLow and !letheLow;     # bullish divergence
def isBearDiv = priceHigh and !letheHigh;   # bearish divergence

plot BullDivMark = if isBullDiv then Lethe else Double.NaN;
BullDivMark.SetPaintingStrategy(PaintingStrategy.ARROW_UP);
BullDivMark.SetDefaultColor(Color.GREEN);

plot BearDivMark = if isBearDiv then Lethe else Double.NaN;
BearDivMark.SetPaintingStrategy(PaintingStrategy.ARROW_DOWN);
BearDivMark.SetDefaultColor(Color.RED);

#------------------------- LABELS ---------------------------
AddLabel(
    yes,
    "Lethe Harmony: " + Round(Lethe, 1),
    if Lethe > OB then Color.RED
    else if Lethe < OS then Color.PLUM
    else if AbsValue(Lethe - midLevel) < 5 then Color.WHITE
    else Color.GRAY
);
2025-12-31-TOS_CHARTSf.png
 
Last edited by a moderator:
So the river can run dry, but could not get the desired split to the two streams, it just wanted to dominate when the lower chart plugged upper. Rewrite result, Price Chart Dots!! Keeping with the same type Lethe System - momentum decay, absolute value, fade and crossover.


Upper chart version
Code:
#====================================================
# Lethe Effect – Upper-Only Micro Signal
# No lower pane. No scale wars. No visual noise.
#====================================================

declare upper;

input length = 14;
input decay_factor = 0.85;
input overSoldLevel = 30;
input overBoughtLevel = 70;

#------------------------------
# Core Math
#------------------------------
def momentum = close - close[length];

rec fadedMomentum =
if IsNaN(fadedMomentum[1]) then momentum
else fadedMomentum[1] * decay_factor
+ momentum * (1 - decay_factor);

def maxAbs = Highest(AbsValue(momentum), length);

def letheValue =
if maxAbs != 0
then (fadedMomentum / maxAbs * 50) + 50
else 50;

#------------------------------
# Micro Price Signals ONLY
#------------------------------
plot HarmonyBuy =
if letheValue crosses above overSoldLevel
then low
else Double.NaN;

HarmonyBuy.SetPaintingStrategy(PaintingStrategy.POINTS);
HarmonyBuy.SetDefaultColor(Color.GREEN);
HarmonyBuy.SetLineWeight(2);

plot HarmonySell =
if letheValue crosses below overBoughtLevel
then high
else Double.NaN;

HarmonySell.SetPaintingStrategy(PaintingStrategy.POINTS);
HarmonySell.SetDefaultColor(Color.RED);
HarmonySell.SetLineWeight(2);
 

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
967 Online
Create Post

Similar threads

Similar threads

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

What is useThinkScript?

useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.

How do I get started?

We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.

If you are new, or just looking for guidance, here are some helpful links to get you started.

What are the benefits of VIP Membership?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.
Back
Top