can a While statement be programmed in an EA

 

if (Opentrades==0)
{double MyTrend=iCustom(NULL,0,"i_Trend",0,0,0,40,18,25,300,0,0);
while (MyTrend < 7.0 && MyTrend > -7.0)

and is the logic correct???

Reason: