OPEN-SOURCE SCRIPT
Мой скрипт

//version=4
study("BDBTW", overlay=true)
jawLength = input(13, minval=1, title="Jaw Length")
teethLength = input(8, minval=1, title="Teeth Length")
lipsLength = input(5, minval=1, title="Lips Length")
jawOffset = input(8, title="Jaw Offset")
teethOffset = input(5, title="Teeth Offset")
lipsOffset = input(3, title="Lips Offset")
n = input(title="Periods Fractal", defval=2, minval=2, type=input.integer)
offsetFractal = input(100, title = "Offset Fractal")
offsetBDBTW = input(200, title = "Offset BDBTW")
upFractal = ( (high[n+2] < high[n]) and (high[n+1] < high[n]) and (high[n-1] < high[n]) and (high[n-2] < high[n]))
or ( (high[n+3] < high[n]) and (high[n+2] < high[n]) and (high[n+1] == high[n]) and (high[n-1] < high[n]) and (high[n-2] < high[n]))
or ( (high[n+4] < high[n]) and (high[n+3] < high[n]) and (high[n+2] == high[n]) and (high[n+1] <= high[n]) and (high[n-1] < high[n]) and (high[n-2] < high[n]))
or ( (high[n+5] < high[n]) and (high[n+4] < high[n]) and (high[n+3] == high[n]) and (high[n+2] == high[n]) and (high[n+1] <= high[n]) and (high[n-1] < high[n]) and (high[n-2] < high[n]))
or ((high[n+6] < high[n]) and (high[n+5] < high[n]) and (high[n+4] == high[n]) and (high[n+3] <= high[n]) and (high[n+2] == high[n]) and (high[n+1] <= high[n]) and (high[n-1] < high[n]) and (high[n-2] < high[n]))
dnFractal = ( (low[n+2] > low[n]) and (low[n+1] > low[n]) and (low[n-1] > low[n]) and (low[n-2] > low[n]))
or ( (low[n+3] > low[n]) and (low[n+2] > low[n]) and (low[n+1] == low[n]) and (low[n-1] > low[n]) and (low[n-2] > low[n]))
or ( (low[n+4] > low[n]) and (low[n+3] > low[n]) and (low[n+2] == low[n]) and (low[n+1] >= low[n]) and (low[n-1] > low[n]) and (low[n-2] > low[n]))
or ( (low[n+5] > low[n]) and (low[n+4] > low[n]) and (low[n+3] == low[n]) and (low[n+2] == low[n]) and (low[n+1] >= low[n]) and (low[n-1] > low[n]) and (low[n-2] > low[n]))
or ((low[n+6] > low[n]) and (low[n+5] > low[n]) and (low[n+4] == low[n]) and (low[n+3] >= low[n]) and (low[n+2] == low[n]) and (low[n+1] >= low[n]) and (low[n-1] > low[n]) and (low[n-2] > low[n]))
smma(src, len) =>
s = 0.0
s := na(s[1]) ? sma(src, len) : (s[1]*(len-1)+src)/len
r_hl=roc((high-low)/volume,1)
r_v=roc(volume,1)
sq_f=(r_hl < 0) and (r_v > 0)
jaw = smma(hl2, jawLength)
teeth = smma(hl2, teethLength)
lips = smma(hl2, lipsLength)
BDBup = high < jaw[jawOffset] and high < teeth[teethOffset] and high < lips[lipsOffset] and low < low[1] and close > hl2
BDBdown = low > jaw[jawOffset] and low > teeth[teethOffset] and low > lips[lipsOffset] and high > high[1] and close < hl2
plot(jaw, title = "Williams Alligator", offset = jawOffset, color=#3BB3E4)
plot(teeth, title = "Williams Alligator", offset = teethOffset, color=#FF006E)
plot(lips, title = "Williams Alligator", offset = lipsOffset, color=#36C711)
plotshape(dnFractal ? low[n] - offsetFractal * syminfo.mintick : na, title = "Fractals", style=shape.triangledown, location=location.belowbar, offset=-n, size = size.auto, color= color.maroon, transp=0)
plotshape(upFractal ? high[n] + offsetFractal * syminfo.mintick : na, title = "Fractals", style=shape.triangleup, location=location.abovebar, offset=-n, size = size.auto, color=color.olive, transp=0)
plotshape(BDBup ? high + offsetBDBTW * syminfo.mintick : na, title = "BDBTW buy", style=shape.circle, location=location.abovebar, color=color.green, size=size.auto, editable=true)
plotshape(BDBdown ? low - offsetBDBTW * syminfo.mintick : na, title = "BDBTW sell", style=shape.circle, location=location.belowbar, color=color.red, size=size.auto, editable=true)
ao = sma(hl2,5) - sma(hl2,34)
cao = change(ao)
barcolor(sq_f ? color.blue : cao <= 0 ? color.red : color.green, title = "Williams Squat Bars")
study("BDBTW", overlay=true)
jawLength = input(13, minval=1, title="Jaw Length")
teethLength = input(8, minval=1, title="Teeth Length")
lipsLength = input(5, minval=1, title="Lips Length")
jawOffset = input(8, title="Jaw Offset")
teethOffset = input(5, title="Teeth Offset")
lipsOffset = input(3, title="Lips Offset")
n = input(title="Periods Fractal", defval=2, minval=2, type=input.integer)
offsetFractal = input(100, title = "Offset Fractal")
offsetBDBTW = input(200, title = "Offset BDBTW")
upFractal = ( (high[n+2] < high[n]) and (high[n+1] < high[n]) and (high[n-1] < high[n]) and (high[n-2] < high[n]))
or ( (high[n+3] < high[n]) and (high[n+2] < high[n]) and (high[n+1] == high[n]) and (high[n-1] < high[n]) and (high[n-2] < high[n]))
or ( (high[n+4] < high[n]) and (high[n+3] < high[n]) and (high[n+2] == high[n]) and (high[n+1] <= high[n]) and (high[n-1] < high[n]) and (high[n-2] < high[n]))
or ( (high[n+5] < high[n]) and (high[n+4] < high[n]) and (high[n+3] == high[n]) and (high[n+2] == high[n]) and (high[n+1] <= high[n]) and (high[n-1] < high[n]) and (high[n-2] < high[n]))
or ((high[n+6] < high[n]) and (high[n+5] < high[n]) and (high[n+4] == high[n]) and (high[n+3] <= high[n]) and (high[n+2] == high[n]) and (high[n+1] <= high[n]) and (high[n-1] < high[n]) and (high[n-2] < high[n]))
dnFractal = ( (low[n+2] > low[n]) and (low[n+1] > low[n]) and (low[n-1] > low[n]) and (low[n-2] > low[n]))
or ( (low[n+3] > low[n]) and (low[n+2] > low[n]) and (low[n+1] == low[n]) and (low[n-1] > low[n]) and (low[n-2] > low[n]))
or ( (low[n+4] > low[n]) and (low[n+3] > low[n]) and (low[n+2] == low[n]) and (low[n+1] >= low[n]) and (low[n-1] > low[n]) and (low[n-2] > low[n]))
or ( (low[n+5] > low[n]) and (low[n+4] > low[n]) and (low[n+3] == low[n]) and (low[n+2] == low[n]) and (low[n+1] >= low[n]) and (low[n-1] > low[n]) and (low[n-2] > low[n]))
or ((low[n+6] > low[n]) and (low[n+5] > low[n]) and (low[n+4] == low[n]) and (low[n+3] >= low[n]) and (low[n+2] == low[n]) and (low[n+1] >= low[n]) and (low[n-1] > low[n]) and (low[n-2] > low[n]))
smma(src, len) =>
s = 0.0
s := na(s[1]) ? sma(src, len) : (s[1]*(len-1)+src)/len
r_hl=roc((high-low)/volume,1)
r_v=roc(volume,1)
sq_f=(r_hl < 0) and (r_v > 0)
jaw = smma(hl2, jawLength)
teeth = smma(hl2, teethLength)
lips = smma(hl2, lipsLength)
BDBup = high < jaw[jawOffset] and high < teeth[teethOffset] and high < lips[lipsOffset] and low < low[1] and close > hl2
BDBdown = low > jaw[jawOffset] and low > teeth[teethOffset] and low > lips[lipsOffset] and high > high[1] and close < hl2
plot(jaw, title = "Williams Alligator", offset = jawOffset, color=#3BB3E4)
plot(teeth, title = "Williams Alligator", offset = teethOffset, color=#FF006E)
plot(lips, title = "Williams Alligator", offset = lipsOffset, color=#36C711)
plotshape(dnFractal ? low[n] - offsetFractal * syminfo.mintick : na, title = "Fractals", style=shape.triangledown, location=location.belowbar, offset=-n, size = size.auto, color= color.maroon, transp=0)
plotshape(upFractal ? high[n] + offsetFractal * syminfo.mintick : na, title = "Fractals", style=shape.triangleup, location=location.abovebar, offset=-n, size = size.auto, color=color.olive, transp=0)
plotshape(BDBup ? high + offsetBDBTW * syminfo.mintick : na, title = "BDBTW buy", style=shape.circle, location=location.abovebar, color=color.green, size=size.auto, editable=true)
plotshape(BDBdown ? low - offsetBDBTW * syminfo.mintick : na, title = "BDBTW sell", style=shape.circle, location=location.belowbar, color=color.red, size=size.auto, editable=true)
ao = sma(hl2,5) - sma(hl2,34)
cao = change(ao)
barcolor(sq_f ? color.blue : cao <= 0 ? color.red : color.green, title = "Williams Squat Bars")
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.