Tradingview indicator conversion

Created at 17 Nov 2020
DB

dbtune2020

Joined 17.11.2020

Status

Closed


Budget

20.00 EUR


Payment Method

Direct Payment

Job Description

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[1]-LP1[1])+(HP1[2]-LP1[2])+(HP1[3]-LP1[3])+(HP1[4]-LP1[4])+(HP1[5]-LP1[5])+(HP1[6]-LP1[6]))/7)
// PPD72 = Difference from HP2 and LP2 for the last 7 days
PPD72 = (((HP2-LP2)+(HP2[1]-LP2[1])+(HP2[2]-LP2[2])+(HP2[3]-LP2[3])+(HP2[4]-LP2[4])+(HP2[5]-LP2[5])+(HP2[6]-LP2 [6]))/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)
 

Comments
No comments found.