have written this code after combining 2 indicators. They seem to draw correctly individually, but when combined. the “stoch entry” label remains. Not sure if its a repainting issue or coding
wanted the plot shape of pivot Ready to remain,
but if stochastic was first to trade disable the Pivot or if pivot first to trade to disable stoch trade
traded_today = false
traded_today1 = false
stop_pivot = false
stop_stoch = false
var longOn = false
trade_Pivot = input.bool(false, "turn Pivot trading On", group=g_4, inline="", tooltip="turn Pivot trading On")
trade_Stoch = input.bool(false, "turn Stoch roll over On", group=g_4, inline="", tooltip="turn Stoch Roll over On")
//pivot_buy
pivot_buy = open >= vPP and close < vPPenter image description here
//stoch
cond2_long = ta.crossover(k,d) and k < stochOS and barstate.isconfirmed
// // Pivots
if newDay and open > vPP
startAboveP := true
▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲
// - TRADE CONDITIONS -
// ▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼
//Pivots
Pivot_Ready = not traded_today and startAboveP and trade_Pivot
Pivot_Entry = not traded_today1 and pivot_buy and not stop_pivot and trade_Pivot
//stoch
validLong = not longOn and cond2_long and not stop_stoch and trade_Stoch
▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲
// - ALERTS FUNCTIONS -
// ▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼
if Pivot_Ready
traded_today := true
// Pivot
if Pivot_Entry
traded_today1 := true
stop_stoch := true
alert("Buy " + syminfo.ticker + " at " + str.tostring(vPP, format.mintick) + "n TP1 " + str.tostring(vR1, format.mintick) + "n SL " + str.tostring(vS1, format.mintick) + "n Pivot_Buy" + "nn Time Stamp of triggern" + "nn Time of trade " + str.tostring(t) , alert.freq_once_per_bar)
// Stoch
if validLong
longOn := true
stop_pivot := true
longSL := close - i_Stop_Loss * 10 * syminfo.mintick
longTP := close + i_Take_Profit * 10 * syminfo.mintick
alert("Buy " + syminfo.ticker + " at " + str.tostring(close, format.mintick) + "n TP1 " + str.tostring(longTP, format.mintick) + "n SL " + str.tostring(longSL, format.mintick) + "n Stoch" + "nn Time Stamp of triggern" + "nn Time of trade " + str.tostring(barTimeFormatted) , alert.freq_once_per_bar)
// TRADES SHAPES
plotshape(Pivot_Ready , title="Pivot_Ready" , text="Pivotnsetup " , color=color.rgb(34, 185, 39), style=shape.labeldown , location=location.abovebar, size=size.tiny, textcolor=color.rgb(0, 0, 0))//lotshape(shortReady , title="Pivot_Sell", text="SellnReady" , color=color.rgb(185, 37, 34), style=shape.labeldown, location=location.abovebar, size=size.tiny, textcolor=color.rgb(0, 0, 0))
plotshape(Pivot_Entry , title="Pivot_Entry" , text="Pivot Buy " , color=color.rgb(34, 185, 39), style=shape.labelup , location = location.belowbar, size=size.tiny, textcolor=color.rgb(0, 0, 0))//lotshape(shortReady , title="Pivot_Sell", text="SellnReady" , color=color.rgb(185, 37, 34), style=shape.labeldown, location=location.abovebar, size=size.tiny, textcolor=color.rgb(0, 0, 0))
//stoch
plotshape(validLong , title="Stoch_Buy" , text="Stoch_Buy" , color=color.rgb(34, 185, 39), style=shape.labelup , location=location.belowbar, size=size.small, textcolor=color.black)