How to identify consecutive Heiken Ashi bars

 

I am going to build a trading strategy based on the Heiken Ashi. I need to identify three consecutive red or white bars. i would like someone can put the MQL4 code here

 
 
Alain Verleyen:

thx