I have a script that can plot many sell signals in a row and I want to number them if there is no buy signal in between the sell signals, so the first signal is p1sell, second is p2sell etc... if there is a buy signal then the count restarts.... any idea how to tackle this?
This is what I have so far, p1sell is correct but the other ones aren't-
//first sellsignal since buysignal
p1sell=barssince(SellSignal)<barssince(BuySignal) and barssince(SellSignal[1])>barssince(BuySignal)
//second sellsignal since first sellsignal without buysignal
p2sell=barssince(SellSignal)<barssince(BuySignal) and barssince(SellSignal[1])<barssince(BuySignal)
//third sellsignal since second sell signal without buysignal
p3sell=barssince(SellSignal)<barssince(BuySignal) and barssince(SellSignal[1])<barssince(BuySignal)