20 EUR  Payment method:  Direct Payment

Hi,

I am looking for someone to convert a simple custom tradingview indicator.

Here is the code:

//@version=3

study(title="DB Pivot Bands", shorttitle="DB_PivotBands", overlay=true)
lengthMA=input(7, title="EMA Length To Calculate Bands")
sc = input(true, title="Show Current Chart Timeframe Pivot Bands?")

PP = (high + low  + close)/ 3
PPEMA = ema(PP, lengthMA)
HP1 = (PP + (PP-low))
LP1 = (PP - (high-PP))
HP2 = (PP + 2*(PP-low))
LP2 = (PP - 2*(high-PP))

// PPD71 = Difference from HP1 and LP1 for the last 7 days
PPD71 = (((HP1-LP1)+(HP1-LP1)+(HP1-LP1)+(HP1-LP1)+(HP1-LP1)+(HP1-LP1)+(HP1-LP1))/7)
// PPD72 = Difference from HP2 and LP2 for the last 7 days
PPD72 = (((HP2-LP2)+(HP2-LP2)+(HP2-LP2)+(HP2-LP2)+(HP2-LP2)+(HP2-LP2)+(HP2-LP2 ))/7)

r1 = PPEMA + PPD71
s1 = PPEMA - PPD71
r2 = PPEMA + PPD72
s2 = PPEMA - PPD72

plot(sc and PPEMA ? PPEMA : na, title="Current Timeframe Pivot Point ", style=linebr, linewidth=2, color=fuchsia)
p1=plot(sc and r1 ? r1 : na,   title="Current Timeframe R1", style=linebr, linewidth=2, color=#DC143C)
p2=plot(sc and s1 ? s1 : na, title="Current Timeframe S1", style=linebr, linewidth=2, color=lime)
p3=plot(sc and r2 ? r2 : na, title="Current Timeframe R2", style=linebr, linewidth=2, color=maroon)
p4=plot(sc and s2 ? s2 : na, title="Current Timeframe S2", style=linebr, linewidth=2, color=#228B22)
fill(p1, p3, color=red, transp = 85)
fill(p2, p4, color=lime, transp = 85) 