Guide me in creating an EA based on an Indicator

 

Hello friends this is checkmail and am a bit less experienced in the mql4 language, so want help in form of an EA.

Am having some awesome indicators that works well for me till now, so now want to create an EA based on it.

Though there are many complex indicators, I want to try an simple indicator to create an EA.

The indicator draws an curve line according to the market movements in green and red color.

Green color indicates an upmove and Red color indicates an downmove.

I want to build an EA that could execute buy-sell and close based on the change of color on the curve.

Means buy if the curve is Green and close when it turns Red and vice-versa.

The idea seems to be simple to me, but as am less experience in EA coding and its language require some help.

If anybody interested here in Guiding me in building such EA based on the above mentioned Indicator.

Please come forward,

Attached is the screenshot of the chart and its indicator curve movements.

 

Are you talking about some kind of linear regression or "slope" indicator? Many EA's based on this exist. I don't know how to use the color value but I do know how to see if it is moving up or down based on using the shift. If it was lower on the last bar (1) than it is on the current bar (0), then you know it's moving up. Vice versa for down. It's going to fire off at almost all the same times as the color changes. You'll likely need a few slope lines or another filter involved to be successful at this.

Slope does seem like a holy grail when you look at the indicator but as you code it, you'll find its flaws. Not that profitability with it is impossible.

Ignore my assumptions if this is something entirely different than slope directional line...

Reason: