How to define three white soldier and three black crows

Hi
Plaese help with the code how to define three white soldier i.e. three consecutive green candle opening within real body of previous candle and closing above the high of previous candle (in Hiekinashi chart).
Regards