Possible to change horizontal lines based on time in EasyLanguage? (Cross posted)
I've coded an EasyLanguage indicator that draws horizontal lines at price levels based on an oscillator's extreme readings. Those horizontal lines accumulate over the life of the chart. I'd like to code in an automatic color control for those lines so that the most recent occurrences are one color and the older lines are another color. Thinking I'd like to have three time-bands with corresponding colors. Not to belabor this but, a plain language example would be that my chart would have three colors of horizontal lines. Blue would be the lines that were formed 6 months ago. Yellow would be the lines that formed between 3 and 6 months ago. Green would be the lines that formed within the past 3 months.
I'm having a tough time figuring out how to make that work. Changing line color is easy. Changing line color based on a specific time criteria throws me a curve ball. Any suggestions, snippets, advice, etc. would be greatly appreciated.
depending on how you draw the trendlines you either need to store the time you draw the trendline or use the start date of the line to know the "age".
Now it's just a matter of cycling through the line IDs and checking the age to see if the color needs to be changed. The best way to do that would be to store the new trendline IDs in a collection or array and remove them from that collection once you changed the color.