I have a strategy built that only takes one trade in each direction at a time, but I'd like to turn it into just an indicator with labels using plotshape. Every method I have tried to use a variable increase when my buy or sell parameter hits more than once in a row, doesn't work to turn the labels off until the opposite signal comes in. So basically it is repainting a buy or sell signal multiple times when I want it to give one signal and then shut off until the opposite trade parameters are met. So one buy signal, then one sell signal, no irrelevant signals in the middle. How can I achieve this?
//Strategy Trade Signal Bull
if bull
strategy.entry('Bull', strategy.long, comment='Bull')
strategy.close('Bull', when=bear, comment='Bear')
//Strategy Trade Signal Bear
if bear
strategy.entry('Bear', strategy.short, comment='Bear')
strategy.close('Bear', when=bull, comment='Bull')