Pine script coding. I am using a variable long_above which is defiend inside the if block. I am getting error-Undeclared identifier 'long_above'

My code is given below. Can anyone edit my code so that I can be compiled // This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/ // © nibedit2irtmtc //@version=5 indicator("My script", overlay = true) if high[2] > high[3] if low[3] > low[2] long_above=high[2] if high[2]>high[1] if low[2]<low[1]… Read More Pine script coding. I am using a variable long_above which is defiend inside the if block. I am getting error-Undeclared identifier 'long_above'

Pine script coding. I am using a variable long_above which is defiend inside the if block. I am getting error-Undeclared identifier 'long_above'

My code is given below. Can anyone edit my code so that I can be compiled // This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/ // © nibedit2irtmtc //@version=5 indicator("My script", overlay = true) if high[2] > high[3] if low[3] > low[2] long_above=high[2] if high[2]>high[1] if low[2]<low[1]… Read More Pine script coding. I am using a variable long_above which is defiend inside the if block. I am getting error-Undeclared identifier 'long_above'

Removing the Duplicate occurrences from a Pandas series without removing entire rows

So I am working on testing financial performance of some stocks. I have a pandas column "signal" that by certain logic has "buy" or "sell" signals. Now these signals occur at random intervals, but whenever they do, almost always they are repeated in a number of consecutive rows. I would like to only keep the… Read More Removing the Duplicate occurrences from a Pandas series without removing entire rows