Automatic Horizontal lines

Is there a way to automatically draw horizontal lines on the chart? For example, if our strategy requires drawing 10 horizontal lines, can we automate the process and assign different colours.

I would like to pass only values and colour.