Closed bluetechsky closed 3 years ago
Hi can somebody help me out.I whant to combine 2 script code indecator into 1script code indecator.The 1 sript code indecator is //@version=3 study("Bill Williams. Alligator, Fractals & Res-Sup combined", shorttitle="๐ฒ AlFReSco", overlay=true)
// Alligator smma(src, length) => smma = 0.0 smma := na(smma[1]) ? sma(src, length) : (smma[1] * (length - 1) + src) / length lipsLength = input(title="๐ฒ Lips Length", defval=5) teethLength = input(title="๐ฒ Teeth Length", defval=8) jawLength = input(title="๐ฒ Jaw Length", defval=13) lipsOffset = input(title="๐ฒ Lips Offset", defval=3) teethOffset = input(title="๐ฒ Teeth Offset", defval=5) jawOffset = input(title="๐ฒ Jaw Offset", defval=8) lips = smma(hl2, lipsLength) teeth = smma(hl2, teethLength) jaw = smma(hl2, jawLength) plot(title="๐ฒ Lips", series=lips, color=green, transp=75, offset=lipsOffset) plot(title="๐ฒ Teeth", series=teeth, color=red, transp=75, offset=teethOffset) plot(title="๐ฒ Jaw", series=jaw, color=blue, transp=75, offset=jawOffset)
// Fractals n = input(title="๐ Period", defval=2, minval=2, type=integer) 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])) plotshape(title="๐ Up-Fractal", series=upFractal, style=shape.triangleup, location=location.abovebar, offset=-2, color=olive, transp=25) plotshape(title="๐ Down-Fractal", series=dnFractal, style=shape.triangledown, location=location.belowbar, offset=-2, color=maroon, transp=25)
// Resistance, Support showRS = input(title="โคโค Show Res-Sup", defval=true) lengthRS = input(title="โคโค Res-Sup Length", defval=13, type=integer) highRS = valuewhen(high >= highest(high, lengthRS), high, 0) lowRS = valuewhen(low <= lowest(low, lengthRS), low, 0) plot(title="โค Resistance", series=showRS and highRS ? highRS : na, color=highRS != highRS[1] ? na : olive, linewidth=1, transp=25, offset=0) plot(title="โค Support", series=showRS and lowRS ? lowRS : na, color=lowRS != lowRS[1] ? na : maroon, linewidth=1, transp=25, offset=0) And the next script code indecator is study("Williams Squat Bars", shorttitle="Squat Bars", overlay=true) r_hl=roc((high-low)/volume,1) r_v=roc(volume,1) squat_f=(r_hl < 0) and (r_v > 0) barcolor(squat_f ? blue : na) Those 2 script code i whant to combine into 1 script code indecator thanks.
Add running Pine script instruction for beginner at first time.