pandas-ta
pandas-ta copied to clipboard
Leledc Exhaustion Bar indicator (Request)
This Pinescript code is really easy but I didn't even manage to set up a really simple for loop I guess because I was too tired :D Anyways
Can someone help me to convert this pine code to python?
maj_qual=input(6),maj_len=input(30)
min_qual=input(5),min_len=input(5)
maj=input(true,title="Show Major")
min=input(true,title="Show Minor")
lele(qual,len)=>
bindex=nz(bindex[1],0)
sindex=nz(sindex[1],0)
ret=0
if (close>close[4])
bindex:=bindex + 1
if(close<close[4])
sindex:=sindex + 1
if (bindex>qual) and (close<open) and high>=highest(high,len)
bindex:=0
ret:=-1
if ((sindex>qual) and (close>open) and (low<= lowest(low,len)))
sindex:=0
ret:=1
return=ret
major=lele(maj_qual,maj_len)
minor=lele(min_qual,min_len)
Thank you !
@kaanguven I could write this in python . Do you have any good source for the documentation of this indicator .
@kaanguven I could write this in python . Do you have any good source for the documentation of this indicator .
Only got this https://tr.tradingview.com/v/2rZDPyaC/
Has this been resolved? It would be really nice to have it in python.
define the inputs
maj_qual = 6 maj_len = 30 min_qual = 5 min_len = 5 maj = True min = True
define the lele function
def lele(qual, len): bindex = 0 sindex = 0 bindex = nz(bindex[bindexSindex], 0) sindex = nz(sindex[bindexSindex], 0) ret = 0 if close > close[closeVal]: bindex += 1 if close < close[closeVal]: sindex += 1 if bindex > qual and close < open and high >= highest(high, len): bindex = 0 ret = -1 if sindex > qual and close > open and low <= lowest(low, len): sindex = 0 ret = 1 return ret
calculate the major and minor
major = lele(maj_qual, maj_len) minor = lele(min_qual, min_len)
plot the characters
if maj: if major == -1: plotchar(high, char='•', location=location.absolute, color=color.red, transp=0, size=size.large) elif major == 1: plotchar(low, char='•', location=location.absolute, color=color.lime, transp=0, size=size.large)
if min: if minor == 1: plotchar(high, char='x', location=location.absolute, color=color.red, transp=0, size=size.small) elif minor == -1: plotchar(low, char='x', location=location.absolute, color=color.lime, transp=0, size=size.small)
define the alert conditions
leledecMajorBullish = major == 1 ? low : na leledecMajorBearish = major == -1 ? high : na
leledecMinorBullish = minor == 1 ? low : na leledecMinorBearish = minor == -1 ?
define the inputs
maj_qual = 6 maj_len = 30 min_qual = 5 min_len = 5 maj = True min = True
define the lele function
def lele(qual, len): bindex = 0 sindex = 0 bindex = nz(bindex[bindexSindex], 0) sindex = nz(sindex[bindexSindex], 0) ret = 0 if close > close[closeVal]: bindex += 1 if close < close[closeVal]: sindex += 1 if bindex > qual and close < open and high >= highest(high, len): bindex = 0 ret = -1 if sindex > qual and close > open and low <= lowest(low, len): sindex = 0 ret = 1 return ret
calculate the major and minor
major = lele(maj_qual, maj_len) minor = lele(min_qual, min_len)
plot the characters
if maj: if major == -1: plotchar(high, char='•', location=location.absolute, color=color.red, transp=0, size=size.large) elif major == 1: plotchar(low, char='•', location=location.absolute, color=color.lime, transp=0, size=size.large)
if min: if minor == 1: plotchar(high, char='x', location=location.absolute, color=color.red, transp=0, size=size.small) elif minor == -1: plotchar(low, char='x', location=location.absolute, color=color.lime, transp=0, size=size.small)
define the alert conditions
leledecMajorBullish = major == 1 ? low : na leledecMajorBearish = major == -1 ? high : na
leledecMinorBullish = minor == 1 ? low : na leledecMinorBearish = minor == -1 ?
Yes, this is pinescript code :D we are looking for python
I've converted it to python and also build a dynamic version of leledc exhaustion bands :) Feel free to include it in pandas-ta! https://github.com/just-nilux/legendary_ta/
I've converted it to python and also build a dynamic version of leledc exhaustion bands :) Feel free to include it in pandas-ta! https://github.com/just-nilux/legendary_ta/
Can you please share any instructions on how I can run this Python code on a chart? I tried to convert a dynamic version of the Leledc exhaustion band in Pine Script no success. I would appreciate your response.
@just-nilux
I've converted it to python and also build a dynamic version of leledc exhaustion bands :) Feel free to include it in pandas-ta!
Would be great if someone could edit it a bit for inclusion. 😎 Some of the methods with for loops will need njit wrapped functions for numba; some indicators on the development branch can be referenced there.
Kind Regards KJ