This forum is in read-only mode now. You may discuss your questions on forums of MQL4.community and MQL5.community
MQL4 QuestionBack to topics list |
|
borko
2005.01.28 20:53
The code below is supposed to indicate a MA Cross but it does not. Maybe I am wrong.
macurrent=iMA(NULL,0,5,0,MODE_LWMA,PRICE_CLOSE,0); macurrentslow=iMA(NULL,0,10,0,MODE_LWMA,PRICE_CLOSE,0); if (MathAbs(macurrentslow-macurrent)==0) {Comment("CROSS............");} else{Comment(macurrent,"|",macurrentslow,"|",MathAbs(macurrentslow-macurrent));} if (MathAbs(macurrentslow-macurrent)==0) { Print("Cross"); Alert("CROSS"); } |
|
Slawa
2005.02.02 11:49
insufficient condition. should be:
if((prevvalue1<prevvalue2 && currentvalue1>=currentvalue2) || (prevvalue1>prevvalue2 && currentvalue1<=currentvalue2)) Alert("Crossing...") |
Download MetaTrader 5 (450 Kb, web installer) — a new terminal for financial markets
