-
Notifications
You must be signed in to change notification settings - Fork 93
Update README.md #67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update README.md #67
Conversation
Add running Pine script instruction for beginner at first time.
yadadamean
commented
May 24, 2021
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.