23 Jan 2019 23:57 UTC + 1
Length : 1
It was long, then price dropped under previous candle low, so sell alert was fired, then price went above within current candle.
Maybe I figured it out, added some logic :
// Filter out signals if oposite signal is also on
up_filt = up and not down
down_filt = down and not up
both_filt = up and down
// Filter out consecutive signals
prev = 0
prev := up_filt ? 1 : down_filt ? -1 : prev
up_final = (up_filt and prev == -1) or (both_filt and prev == 1) or (both_filt and prev == -1)
down_final = (down_filt and prev == 1) or (both_filt and prev == -1) or (both_filt and prev == 1)
Send me a screenshot of the plot in PM or to email@example.com, don't think I'm looking at the right time.
Your solution might work, the problem is that we don't know what happened first we broke the upper or lower limit.