The EA knows exactly at which price level it has to draw these horizontales in my case. That is no problem. The EA is doing that accurately.
The issue is detecting the currently relevant horizontale.
I figured out with conditions to make the EA drawing and deleting horizontales if a condition is met.
Anyway, do you know an approach to store the current lowest horizontale in a variable?
That variable should be updated when for example price closes above that horizontale. Than the next lowest horizontale will be stored in a variable and so on.
The screenshot may explain it better (EA is working on ONE chart, tho):

