You will find many variations of this in the Stock Scanners topic. Most scan solutions work with Study Alerts. Because you posted this question in the "Alerts and Notifications" topic it is possible you are requesting a custom chart study with alerts or a solution that works in a Study Alert or a custom scan. So we need to get those details before a solution can be provided.
Please take some time to search and review the many different solutions in the Stock Scanners topic. The following post is for 2nd yellow histogram bar after 2 or more red bars:
Depending on which tool you plan to use, this solution may be the right one for you. The code would need a very minor adjustment to account for 3 yellow bars instead of just 2.