Patern detector strategy

Hi,

I am a complete newbie in forex trading. I am coding a Strategy that detects hammers and place orders after their formations.
Is this kind of strategy viable configuring the SL and TP according to the quality of the hammer shape ?

Thanks,

Regards