Small EA Component help

 

Hello Members/Coders

This is not a huge job and I have given it a go but am currently experiencing a little trouble with this code.

I was looking for somebody to write me a very simple EA based on the Megatrend Indicator (not MTF just the single line adjustable input).

All it needs is the standard inputs, Lot amount, an alert and the Megatrend values. Basic EA logic command is when a buy signal given (Megatrend line swinging up and changing color), open buy (obviously) and when opposing sell signal comes the buy is closed and sell opened.

This command keeps rolling back and forth until EA removed from chart.

Don't worry, I realize it's no better than crossed MA's by itself but it's a small component of a larger system.

As I said, I had a crack at writing it but alas, I am more the trader than a programmer.

If somebody could help out or give me a shove in the correct direction that would be really kind.

Many thanks

Archimedes

(Find attached Megatrand Indicator)

Files:
megatrend.mq4  5 kb
 

And.....

Oh sorry....

Also requires adjustable Magic number

Thanks

Archimedes