This post has been very well structured. Congratulations. I have been trying to teach folks how to create great forum posts and you nailed this one.
- The title clearly describes the context of your request
- Referenced a previous post AND provided a link to that post
- Included the code from that previous post
- Described how you adapted the code to a watchlist column and clearly described what you wanted to change
Fantastic. Everyone should look to this post as text book example of how to create an excellent post in the Q&A forum. (I didn't even find any typos!)
Ok, now we'll get on to the solution. Take the code you provided in the body of your question and remove the very last line:
plot scan = changesToCyan;
After removing that line, add the following two lines to that code:
rec countConsecutiveCyan = if changesToCyan and !changesToCyan[1] then 1 else if countConsecutiveCyan[1] > 0 and changesToCyan then countConsecutiveCyan[1] + 1 else 0;
plot scan = countConsecutiveCyan;
Add this line to the bottom of the code:
scan.AssignValueColor(Color.BLACK);
Or watch our video about using the Condition Wizard for custom watchlist columns to learn how to do that and more: https://www.hahn-tech.com/thinkorswim-condition-wizard-watchlist/