The problem I’m facing is repainting of plot history, I would get a plot while the bar is open which is the way I want it. But the issue is the plot history not being accurate. I want the plots to lock onto the chart once it’s been triggered, and not to disappear.
Any help would be very appreciated
var lastSig = 0
var lastAlert = 0
cd = cooldownMode ? (bar_index> lastAlert+ cooldownPeriod) : true
alertSig = 0
if sigArr.size()>0
bullSignal = true
bearSignal = true
for i in sigArr
if i!=1 and bullSignal
bullSignal:=false
if i!=-1 and bearSignal
bearSignal:=false
if bullSignal==false and bearSignal==false
break
if bullSignal and cd
if anyGreen
label.new(bar_index,low,yloc=yloc.belowbar,color = bullColor,style = label.style_triangleup,size = getSize(sSize))
alertSig:=2
else if onlyGreen and lastSig!=1
label.new(bar_index,low,yloc=yloc.belowbar,color = bullColor,style = label.style_triangleup,size = getSize(sSize))
alertSig:=1
else
bullSignal:=false
lastSig:=1
lastAlert:=bar_index
if bearSignal and cd
if anyRed
label.new(bar_index,high,yloc=yloc.abovebar,color =bearColor,style = label.style_triangledown,size = getSize(sSize))
alertSig:=-2
else if onlyRed and lastSig!=-1
label.new(bar_index,high,yloc=yloc.abovebar,color = bearColor,style = label.style_triangledown,size = getSize(sSize))
alertSig:=-1
else
bearSignal:=false
lastSig:=-1
lastAlert:=bar_index
Akhan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.