PS: I've made no attempt to clean up the code. . .
Code: Select all
//@version=5
indicator(title = "Bodies Show The Way", shorttitle = "BSW", overlay = true)
h = high
l = low
c = high
o = low
candleTransp = input(40, title= "Darkness")
plotDot = input(true,title= "Plot Dots?")
join_HTF = input(false, title = "Connect:", inline = "2")
peri = input("", title = "Time Frame", inline = "2")
x = time_close(timeframe.period)
y = time_close(peri)
z = x[1] == y[1] ? close[1] : na
plot(peri != "" ? z : na,color = color.new(color.blue,50), offset = -1, style = plot.style_circles, linewidth = 2, trackprice = true)
plot(join_HTF and peri != "" ? z : na,color = color.new(color.blue,45), offset = -1, style = plot.style_line, linewidth = 4, display = display.all - display.price_scale)
//-----Pointy Places-----//
//plot_TRI = input(false, title = "Display:", inline = "1")
//adj = input(0.0, title = "Adjust Triangles", inline = "1")
noTrend = input(color.white, title = "noTrend: Color", inline = "3")
noTrendTransp = input(90, title = "Transp ", inline = "3")
trend_CLR = close > high[1]? color.rgb(46, 112, 167) : close < low[1] ? color.red : noTrend
candleTransp := trend_CLR == noTrend ? noTrendTransp : candleTransp
//color.new(#26310d,70)
plotcandle(o,h,l,c, color = color.new(trend_CLR,candleTransp), wickcolor =color.rgb(107, 113, 133), bordercolor = color.new(trend_CLR,candleTransp), display = display.all - display.status_line - display.price_scale)
plot(plotDot?close:na, color = color.new(#e1e6eb, 40), style = plot.style_line, linewidth = 1, join = true, display = display.all - display.status_line)
plot(plotDot?close:na, color = color.new(color.orange, 45), style = plot.style_circles, linewidth = 4, join = false, display = display.all - display.price_scale - display.status_line)
plot(peri != "" and y[1]==x[1]?close[1]:na, offset = -1, color = color.new(color.blue, 0), style = plot.style_circles, linewidth = 4, join = false, display = display.all - display.price_scale - display.status_line)
plot(plotDot?close:na, color = color.new(color.white, 10), style = plot.style_circles, linewidth = 3, join = false,display = display.all - display.price_scale)
plot(peri != "" and y[1]==x[1]?close[1]:na, offset = -1, color = color.new(#26310d, 0), style = plot.style_circles, linewidth = 3, join = false, display = display.all - display.price_scale - display.status_line)
//-----Pointy Places-----//
//fh = h
//fl = l
//cond1 = close[2] > close[3] and close[2] > close[4] and close[2] > close[5] and close[2] > close[6] and close[2] >= close[1] and close[2] >= close[0] // is highest of 5, is >= 2 to the right.
//cond2 = close[2] < close[3] and close[2] < close[4] and close[2] < close[5] and close[2] < close[6] and close[2] <= close[1] and close[2] <= close[0] // is lowest of 5, is <= 2 to the right.
//plotchar(plot_TRI and cond1 ? fh[2] + adj : na, char = "⬜", color = color.new(#26310d,82), offset = -2, location = location.absolute, editable = false, display = display.all - display.status_line)
//plotchar(plot_TRI and cond2 ? fl[2] - adj : na, char = "⬜", color = color.new(#26310d,82), offset = -2, location = location.absolute, editable = false, display = display.all - display.status_line)
//plotchar(plot_TRI and cond1 ? fh[2] + adj : na, char = "△", color = color.new(color.white,15), offset = -2, location = location.absolute, editable = false, display = display.all - display.status_line)
//plotchar(plot_TRI and cond2 ? fl[2] - adj : na, char = "▽", color = color.new(color.white,15), offset = -2, location = location.absolute, editable = false, display = display.all - display.status_line)