insufficient condition. should be:
if((prevvalue1<prevvalue2 && currentvalue1>=currentvalue2) || (prevvalue1>prevvalue2 && currentvalue1<=currentvalue2)) Alert("Crossing...")
if((prevvalue1<prevvalue2 && currentvalue1>=currentvalue2) || (prevvalue1>prevvalue2 && currentvalue1<=currentvalue2)) Alert("Crossing...")
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
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");
}