Hello everyone, I am new to the expert advisor coding thing. I have came along to this point on my graph, and I am trying to copy this guy's algorithm : https://www.youtube.com/watch?v=t1fdXs5IycI&feature=youtu.be. 
I could not figure out how to apply one candle rule and how to close a long trade or a short trade. I'd really appreciate any help, Thanks..