Right click -> Trading -> New order
tonny:
Right click -> Trading -> New order
oh .... no. i want code a ea auto sell
Right click -> Trading -> New order
WHRoeder:
You have only three choices: Search for it, learn to code it, or pay someone. We're not going to code it FOR you. We are willing to HELP you when you post your attempt (using SRC) and the nature of your problem.
You have only three choices: Search for it, learn to code it, or pay someone. We're not going to code it FOR you. We are willing to HELP you when you post your attempt (using SRC) and the nature of your problem.
thank you
i write code but it does not work
double pBid = MarketInfo(OrderSymbol(), MODE_BID); double ma7 = pBid - iMA("EURJPYpro",PERIOD_M30,7,0,MODE_EMA,PRICE_CLOSE,1); double ma21 = pBid - iMA("EURJPYpro",PERIOD_M30,21,0,MODE_EMA,PRICE_CLOSE,1); if ( ma7 == ma21 ) { BUY("EURJPYpro",LS,TP,SL,TS,"if ( ma7 == ma21)") ;}
code
if ( iMA("EURJPYpro",PERIOD_M30,7,0,MODE_EMA,PRICE_CLOSE,0) > iMA("EURJPYpro",PERIOD_M30,21,0,MODE_EMA,PRICE_CLOSE,0) ) { BUY("EURJPYpro",LS,TP,SL,TS," ") ;}
it do work
can you help me Search error
thanks
axbc: i write code but it does not work
if ( ma7 == ma21 )
- Of course not because they cross, they are (almost) never equal. The == operand. - MQL4 forum
- So check for a cross not levels
double ma07cur = iMA(NULL,0, 7,0,MODE_EMA,PRICE_CLOSE,1), ma21cur = iMA(NULL,0,21,0,MODE_EMA,PRICE_CLOSE,1), ma07pre = iMA(NULL,0, 7,0,MODE_EMA,PRICE_CLOSE,2), ma21pre = iMA(NULL,0,21,0,MODE_EMA,PRICE_CLOSE,2); bool wasAbove = ma07pre > ma21pre, isAbove = ma07cur > ma21cur; if(isAbove != wasAbove) // Crossed.
"EURJPYpro",PERIOD_M30
Don't hard code symbols and periods when unnecessary. You want you EA to be able to work on other pairs and timeframes, don't you?double pBid = MarketInfo(OrderSymbol(), MODE_BID);
Don't use function calls when you can use predefined variable Bid
WHRoeder:
- Of course not because they cross, they are (almost) never equal. The == operand. - MQL4 forum
- So check for a cross not levels
oh ... yes. i will try with it.
thank you :)
WHRoeder:
- Of course not because they cross, they are (almost) never equal. The == operand. - MQL4 forum
- So check for a cross not levels
-
Don't hard code symbols and periods when unnecessary. You want you EA to be able to work on other pairs and timeframes, don't you?
-
Don't use function calls when you can use predefined variable Bid
3. yes
4. I know now.
thank you

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
how to sell at two lines ema 7 as ema 21 overlap at that time
Who can help me
Thanks