Leledc Exhaustion Indicator for ThinkorSwim

Hi Matt

Thanks for offering to help. Hope the image showed below :

hmHQoIj.jpg


Basically I keyed in 1 point SL for the ES ( the code supposedly allow for any adjustments on the profit / SL) but as per the P/L, it did not execute the SL at 1 point.

Thanks again for trying :)
 

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

Could anybody help me make the signal appear as a painted candle instead of an arrow? much thx

I tried using "AssignPriceColor" but didn't work.
 
@Alex Here you go:

Code:
#Leledc Exhaustion Port
#Joy_Bangla
#
#https://www.tradingview.com/script/pQv1kge2-Leledc-Exhaustion-V4/
#The Psychology
#Let's assume that we have a group of people, say 100 people who decide to go for a casual running.
#After running for a few KM's few of them will say “I am exhausted. I cannot run further”.
#They will quit running. After running further, another bunch of runners will say I am exhausted. I can’t run further
#and they also will quit running. This goes on and on and then there will be a stage where only a few will be left
#in the running. Now a stage will come where the last person left in the running will say am exhausted and he stops running.
#That means no one is left now in the running. This means all are exhausted in the running.
#
#The same way an exhaustion bar works. The reason is an exhaustion bar sometimes formed at almost tops and bottoms.
#
#Timeframe
#The exhaustion bars are found on all Time frames as a trend also exists on all Timeframes.
#However, as a thumb rule Higher the Time frame, higher will be the accuracy as well as the profitability.
#
#Trading the Leledec Exhaustion Bars
#I may trade as soon as it is shown on the chart.
#I may trade when price breaks the high/low of the bar depending on whether I am getting bullish or bearish signal
#I may trade when price breaks the high/low of the bar depending on whether I am getting bullish or bearish signal.
#I may also be looking to ensure the current volume is higher than the previous few
#(? how many?) bar volumes.
#
# Ported 2019.11.16
# Release 1.0
#

input maj_qual = 6;
input maj_len = 30;
input min_qual = 5;
input min_len = 5;

input showMajor = yes; #show major
input showMinor = no; #show minor

script lele {
    input qual = 6; #default major
    input len = 30; #default major

    def bIndex = CompoundValue(1,
     if (bIndex[1] > qual) and (close < open) and high >= Highest(high, len) then 0 else
     if (close > close[4]) then bIndex[1] + 1 else bIndex[1]
    , 0);

    def sIndex = CompoundValue(1,
     if ((sIndex[1] > qual) and (close > open) and (low <= Lowest(low, len))) then 0 else
     if (close < close[4]) then sIndex[1] + 1 else sIndex[1]
    , 0);

    def ret =
     if (bIndex[1] > qual) and (close < open) and high >= Highest(high, len) then -1 else
     if ((sIndex[1] > qual) and (close > open) and (low <= Lowest(low, len))) then 1
    else 0;

    plot sData = ret;
}

#PLOTS

def major = lele(maj_qual,maj_len);

def pUP = major == 1;
def pDown = major == -1;

# Alerts
Alert(pUP, " ", Alert.Bar, Sound.Chimes);
Alert(pDown, " ", Alert.Bar, Sound.Bell);

AssignPriceColor(if pUp then color.green else if pDown then color.red else color.white);
 
Just like any other indicator, employing a study that identifies reversal candles needs to be used in conjunction with other indicators (stochastic, RSI, ADX) to support the reversal. Plus, the longer the time frame, the more accurate the reversal. Looking at a 1 minute chart, for instance, you can have multiple reversal candles in a row, and then price action continues on its merry way in the same direction as before. Watching the 15 minute chart for these, the signals have a higher accuracy percent for the turn. Personally, I have always made it a point to watch price structure, i.e. candle and pattern formation. It is probably THE most important observation. This is a nice study, though. Thanks to the traders that worked on it.
 
hi @BenTen - I tried the "is true" but still not getting any result.
i changed the bar from 1 to 10 values. and different time (1h, 1d) - still not getting any result.
 
I am wondering if someone could help me with an addition to this fine study. I looking for a way to plot a short horizontal line next to the candle that has a Leledc signal like in the picture below (yellow line). And i want the line to be plotted halfway on the candle that has the signal and because the candle is still developing, the line will also dynamically move up/down before the candle close but it should always be in the middle of the candle.
I only need it for bear signals right now but if it's possible, would be great if i could select to plot for either bull and/or bear signals.

Anyone can help me with this addition? Would be much appreciated.

BbHZoOD.png
 
@zeek Add this after def major line.
Code:
def mid = if major == -1 then (high + low)/2 else mid[1];
plot midline = mid;
midline.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
 
I added the code below to show Minor. Seems to be working.

Code:
def minor = lele(min_qual,min_len);

plot pMinorUP = minor == 1 and showMinor;
pMinorUP.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
pMinorUP.SetDefaultColor(Color.GREEN);
pMinorUP.SetLineWeight(2);

plot pMinorDown = minor == -1 and showMinor ;
pMinorDown.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
pMinorDown.SetDefaultColor(Color.RED);
pMinorDown.SetLineWeight(2);
 
Can somebody help to convert the below codes to the custom watchlist column, with the background as Green or Red Color depending on the up Arrow or Down arrow?

OZlyho0.png



Code:
#Leledc Exhaustion Port
#Joy_Bangla
#The Psychology
# Release 1.0
#
input maj_qual = 6;
input maj_len = 30;
input min_qual = 5;
input min_len = 5;

input showMajor = yes; #show major
input showMinor = no; #show minor

script lele {
input qual = 6; #default major
input len = 30; #default major

def bIndex = CompoundValue(1,
if (bIndex[1] > qual) and (close < open) and high >= Highest(high, len) then 0 else
if (close > close[4]) then bIndex[1] + 1 else bIndex[1]
, 0);

def sIndex = CompoundValue(1,
if ((sIndex[1] > qual) and (close > open) and (low <= Lowest(low, len))) then 0 else
if (close < close[4]) then sIndex[1] + 1 else sIndex[1]
, 0);

def ret =
if (bIndex[1] > qual) and (close < open) and high >= Highest(high, len) then -1 else
if ((sIndex[1] > qual) and (close > open) and (low <= Lowest(low, len))) then 1
else 0;

plot sData = ret;
}

#PLOTS

def major = lele(maj_qual,maj_len);

plot pUP = major == 1;
pUP.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
pUP.SetDefaultColor(Color.GREEN);
pUP.SetLineWeight(2);

plot pDown = major == -1;
pDown.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
pDown.SetDefaultColor(Color.RED);
pDown.SetLineWeight(2);

#UpHorizontal Line
def mid = if major == -1 then (high + low)/2 else mid[1];
plot midline = mid;
midline.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);

# Alerts
Alert(pUP, " ", Alert.Bar, Sound.Chimes);
Alert(pDown, " ", Alert.Bar, Sound.Bell);
 
@Partner Replace everything under def major with this.
Code:
AddLabel(yes, major, color.black);
AssignBackgroundColor(if major == 1 then color.green else if major == -1 then color.red else color.black);
 
@Partner Replace everything under def major with this.
Code:
AddLabel(yes, major, color.black);
AssignBackgroundColor(if major == 1 then color.green else if major == -1 then color.red else color.black);
@generic, I tried all the options to add the above code. But it doesn't work.
if you don't mind can you share entire code?
 
@Partner
Code:
#Leledc Exhaustion Port
#Joy_Bangla
#The Psychology
# Release 1.0
#
input maj_qual = 6;
input maj_len = 30;
input min_qual = 5;
input min_len = 5;

input showMajor = yes; #show major
input showMinor = no; #show minor

script lele {
input qual = 6; #default major
input len = 30; #default major

def bIndex = CompoundValue(1,
if (bIndex[1] > qual) and (close < open) and high >= Highest(high, len) then 0 else
if (close > close[4]) then bIndex[1] + 1 else bIndex[1]
, 0);

def sIndex = CompoundValue(1,
if ((sIndex[1] > qual) and (close > open) and (low <= Lowest(low, len))) then 0 else
if (close < close[4]) then sIndex[1] + 1 else sIndex[1]
, 0);

def ret =
if (bIndex[1] > qual) and (close < open) and high >= Highest(high, len) then -1 else
if ((sIndex[1] > qual) and (close > open) and (low <= Lowest(low, len))) then 1
else 0;

plot sData = ret;
}

#PLOTS

def major = lele(maj_qual,maj_len);

AddLabel(yes, major, color.black);
AssignBackgroundColor(if major == 1 then color.green else if major == -1 then color.red else color.black);
 
Curious to know if it’s possible to add a condition for the signals to trigger. Would like the signals to only trigger when price is above (for bearish) 1.0 standard VWAP deviation and vice versa, when price is below 1.0 std for bullish signals. Can this be added as a condition somehow?

I am seeing good reliable signals when these two are combined.
 
@zeek
The easiest method to see signals from two or more studies is to set up a scan for the various study triggers. The results will only be those candidates that have met all your conditions. This method can even eliminate the need to have those studies on your chart if you are in need of real estate.

This method is favored over attempting to create a kitchen sink indicator as it is much easier to change out indicators as your strategy develops.
 
@zeek
The easiest method to see signals from two or more studies is to set up a scan for the various study triggers. The results will only be those candidates that have met all your conditions. This method can even eliminate the need to have those studies on your chart if you are in need of real estate.

This method is favored over attempting to create a kitchen sink indicator as it is much easier to change out indicators as your strategy develops.
Yes, i already did that actually and it works but because of the way scans doesn’t update in real time, i am missing quite a lot of signals. But yes, it’s one way to do it for sure. Would still prefer to have the condition added into the study if possible.
 
Leledc Exhaustion Bar is an indicator converted by @diazlaz for ThinkorSwim. It does a great job of pointing out when a trend may be coming to an end.

Some comments found on TradingView:



Note: This indicator does not repaint ;)

Luo4qxj.png


Q3ULsAL.png


thinkScript Code

Code:
#Leledc Exhaustion Port
#Joy_Bangla
#
#https://www.tradingview.com/script/pQv1kge2-Leledc-Exhaustion-V4/
#The Psychology
#Let's assume that we have a group of people, say 100 people who decide to go for a casual running.
#After running for a few KM's few of them will say “I am exhausted. I cannot run further”.
#They will quit running. After running further, another bunch of runners will say I am exhausted. I can’t run further
#and they also will quit running. This goes on and on and then there will be a stage where only a few will be left
#in the running. Now a stage will come where the last person left in the running will say am exhausted and he stops running.
#That means no one is left now in the running. This means all are exhausted in the running.
#
#The same way an exhaustion bar works. The reason is an exhaustion bar sometimes formed at almost tops and bottoms.
#
#Timeframe
#The exhaustion bars are found on all Time frames as a trend also exists on all Timeframes.
#However, as a thumb rule Higher the Time frame, higher will be the accuracy as well as the profitability.
#
#Trading the Leledec Exhaustion Bars
#I may trade as soon as it is shown on the chart.
#I may trade when price breaks the high/low of the bar depending on whether I am getting bullish or bearish signal
#I may trade when price breaks the high/low of the bar depending on whether I am getting bullish or bearish signal.
#I may also be looking to ensure the current volume is higher than the previous few
#(? how many?) bar volumes.
#
# Ported 2019.11.16
# Release 1.0
#

input maj_qual = 6;
input maj_len = 30;
input min_qual = 5;
input min_len = 5;

input showMajor = yes; #show major
input showMinor = no; #show minor

script lele {
    input qual = 6; #default major
    input len = 30; #default major

    def bIndex = CompoundValue(1,
     if (bIndex[1] > qual) and (close < open) and high >= Highest(high, len) then 0 else
     if (close > close[4]) then bIndex[1] + 1 else bIndex[1]
    , 0);

    def sIndex = CompoundValue(1,
     if ((sIndex[1] > qual) and (close > open) and (low <= Lowest(low, len))) then 0 else
     if (close < close[4]) then sIndex[1] + 1 else sIndex[1]
    , 0);

    def ret =
     if (bIndex[1] > qual) and (close < open) and high >= Highest(high, len) then -1 else
     if ((sIndex[1] > qual) and (close > open) and (low <= Lowest(low, len))) then 1
    else 0;

    plot sData = ret;
}

#PLOTS

def major = lele(maj_qual,maj_len);

plot pUP = major == 1;
pUP.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
pUP.SetDefaultColor(Color.GREEN);
pUP.SetLineWeight(2);

plot pDown = major == -1;
pDown.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
pDown.SetDefaultColor(Color.RED);
pDown.SetLineWeight(2);

# Alerts
Alert(pUP, " ", Alert.Bar, Sound.Chimes);
Alert(pDown, " ", Alert.Bar, Sound.Bell);

Hi Ben,

This code doesn't seems to address the minqual and minlen parameters. Can you add thee too into the code.
 

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
197 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