is it possible in v10.3 to remove a horizontal line previously drawn by my code and then draw it again in a new place? I have to take into account that lines from highs to lows also on the chart should remain
It is not possible to remove objects previously drawn. But you can make your code plotting once and only on the last candle, this way on each new candlestick, the code is plotting again all objects at the same place or different ones depending of your calculation and settings.
See: DrawOnLastBarOnly
If you use:
defparam drawonlastbaronly = true
at the top of your code then only drawn object that are drawn on the latest bar are shown.
Sometimes it is necessary to create two indicators rather than one and then apply them both. One can draw on the last bar only and the other can draw on all bars.