#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);
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);
#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);
@generic, I tried all the options to add the above code. But it doesn't work.@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);
#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);
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.@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.
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
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);
Join useThinkScript to post your question to a community of 21,000+ developers and traders.
Start a new thread and receive assistance from our community.
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.
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.