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

I would work to print out the values of Position(0) from the buffers.
This would help you to sort which of the three buffers that make your red, green and blue lines comes from. Once you get that, you can take the value and do things like:

if(Price(0) > RedLine(0) && Price(1) < RedLine(1))
{

// you have caught the line crossing by looking at the Current = 0 and the 
// previous bar =1 as in Price(0) and Price(1).
//  DO THE STUFF YOU WANT ......IF Price crosses the Red line

But without the indicator code, it is hard to know what the layout is.
}