I would like to know the nearest flat SSB (ichimoku) value above closing price. I wrote this but this does not work properly and I don’t know why… any idea?
out = true
for i = 0 to flatichimokulevel-1
out := out and (x[i] == x[i+1])
for i = 0 to (p+displacement)
out := (ssb[i] <= ssb[i+1] and ssb[i] >= close and isflat(ssbi)) ? ssb[i] : out