I need an existing EA which I manually drag and drop onto bars to generate a horizontal line, with different colours for different timeframes amended to work automatically and in real time. I must retain the source code including the amendments below. The details are as follows:
I need the EA to run through each TF where a colour is set and for each TF, it will automatically paint the lines based on this rule: the bar in questions volume must be greater than x% over the bar before AND after it. Obviously this means you can't paint a bar until at least 1 bar after it has been formed.
The default of x would be 20%. So a bar would need to be at least 20% than both the bar before and after before you'd paint a horizontal line from that bar's close (and the vertical dotted line as well). x must obviously be maintainable.
On initial load it would go through the chart and paint anything new that isn't already painted (need to avoid painting a bar twice) and it would keep running, updating live.