Conditions for rejection based strategy

hi i wanted to code a rejection based strategy like a candlestick pattern of hammer coming on 50 ema or nearby touching that i am unable to do it can someone pleaser help me with it