How to code price closing on a level??

 
Hey everyone, noob question lol been stuck for 5 days now: (in mql4) if i wanted to code price closing at a level say on a 20 period SMA, within plus or minus 5 points, how would i express that?
 
Alex McPhie:
Hey everyone, noob question lol been stuck for 5 days now: (in mql4) if i wanted to code price closing at a level say on a 20 period SMA, within plus or minus 5 points, how would i express that?
if(price<=SMA+5*Point && price>=SMA-5*Point)
{
}
 
Alex McPhie: within plus or minus 5 points, how would i express that?
if( MathAbs(price - SMA) <= 5*Point)
{
}
 
Keith Watford:
Thank you!!
 
William Roeder:
Thank you as well!!
Reason: