how to find pinbars?

 
Hello Guys,

got stuck with this problem
i want to find and mark pinbars either hammer or shooting stars
i find few indicators do this but they dont even mark same bars!
and they wrote it on way to complex way for me to understand  :-s

i appreciate it if anyone help me out and write mathematical method to find them without making in it too complicate to understand

thank you in advance :)
 
You have only three choices: Search for it, learn to code it, or pay someone. We're not going to code it FOR you.
We are willing to HELP you when you post your attempt (using SRC) and the nature of your problem.
Reason: