How to creat an EA from indicator

I have an indicator, I want to sell if price touch the line up, and buy if price touch the line down (picture). Somebody help me.h1