我有以下脚本,我试图在分钟图表上打印Pivot
点的日线图,但是它没有正确显示。
任何帮助将不胜感激。
//@version=4
study("HFT Pivot Point", overlay = true, max_bars_back = 600)
rb = input(10, title = "Period for Pivot Points", minval = 10)
prd = input(284, title = "Loopback Period", minval = 100, maxval = 500)
nump = input(2, title ="S/R strength", minval = 1)
ChannelW = input(10, title = "Channel Width %", minval = 5)
linestyle = input('Dashed', title = "Line Style", options = ['Solid', 'Dotted', 'Dashed'])
linecolor = input('Blue', title = "Line Color", options = ['Blue', 'Red', 'Lime', 'White', 'Black'])
drawhl = input(true, title = "Draw Highest/Lowest Pivots in Period")
showpp = input(true, title = "Show Point Points")
resolution = input("D", type=input.resolution, title="Timeframe Resolution")
close_ref = security(syminfo.tickerid, resolution, close)
high_ref = security(syminfo.tickerid, resolution, high)
low_ref = security(syminfo.tickerid, resolution, low)
ph_r = pivothigh(high,rb, rb)
pl_r = pivotlow(low,rb, rb)
ph = pivothigh(security(syminfo.tickerid, resolution, high,barmerge.gaps_off,barmerge.lookahead_on),rb, rb)
pl = pivotlow(security(syminfo.tickerid, resolution, low,barmerge.gaps_off,barmerge.lookahead_on),rb, rb)
plotshape(ph and showpp, text="[H]", style=shape.labeldown, color=color.white, textcolor=color.black, location=location.abovebar, transp=0, offset = -rb)
plotshape(pl and showpp, text="[L]", style=shape.labelup, color=color.white, textcolor=color.black, location=location.belowbar, transp=0, offset = -rb)