help me to construct my simple EA..

 

Hi,

All the forum members. I'm newbie to mql4... so please advice me to construct my simple EA..

the concept is like below:

>m15.. looking for main trend

first rule
>follow the trend and waiting
>down/up 20pips then reverse back 20pips
>next down/up again 10pips..open position buy/sell
>tp=10

second rule
>follow the trend and waiting
>down/up 25 pips then continue 5 pips...open position buy/sell
>tp=10

can edit/setting by trader...
1. move up/down=20
2. reverse =10
3. tp =10
4. open lot =0.1
5. stop loss = default = 0

 

advice: check the book / documentation. Pick an example and try to adjust it to your needs. If you run into trouble post a documented question on the forum


Please don't ask without even trying


hth

 

Tq..russell

actualy i'm tried cut and paste and also refer the book.. but the EA can't run. Thay why i'm asking anyone else can help me to guide it...

 
So now you're at the documented question part ;) Start with a very simple ea, and make more complex as your understanding of mql grows.
extern int MA_period = 14;
extern int MA_method = 0;

int init(){

}

int start(){
   
   double ldMA = iMA(NULL, 0, MA_period, 0, MA_method, PRICE_CLOSE, 0);
   if (ldMA > Close[0]){
     //do something
   } else {
     //do something else
   }
}
 
Russell wrote >>
So now you're at the documented question part ;) Start with a very simple ea, and make more complex as your understanding of mql grows.

tq.. for ur advice.. i will try my best....

 

The Print statement is your friend, or at least it's a good friend of mine.


Put the statement liberally in your EA, and watch the output in the Experts tab, so you know what it's doing or not doing what you are expecting it to do.

Reason: