anonymous No title
No License Python
2019年05月30日
Copy Clone
//@version=3
strategy("CB", overlay=true)
len=37
//DCC
i2 = input(len, "DCC", type=integer, minval=3)
eh = highest(high,i2)
el = lowest(low,i2)
r = eh - el
k = (close - el) / r
upBound = highest(high, i2)
downBound = lowest(low, i2)

//ENTRY
if (not na(close[i2]))
    strategy.entry("CBL", strategy.long, stop=upBound + syminfo.mintick, comment="L")
    strategy.entry("ChS", strategy.short, stop=downBound - syminfo.mintick, comment="S")


//COLOR
P1 = plot(eh,color=aqua)
P2 = plot(el,color=aqua)
fill(P1 , P2 ,color=aqua)
//@version=3
strategy("CB", overlay=true)
len=37
//DCC
i2 = input(len, "DCC", type=integer, minval=3)
eh = highest(high,i2)
el = lowest(low,i2)
r = eh - el
k = (close - el) / r
upBound = highest(high, i2)
downBound = lowest(low, i2)

//ENTRY
if (not na(close[i2]))
    strategy.entry("CBL", strategy.long, stop=upBound + syminfo.mintick, comment="L")
    strategy.entry("ChS", strategy.short, stop=downBound - syminfo.mintick, comment="S")


//COLOR
P1 = plot(eh,color=aqua)
P2 = plot(el,color=aqua)
fill(P1 , P2 ,color=aqua)
No one still commented. Please first comment.
Output