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 } }
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.

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
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