iSAR Indicator Comparison In Multiple Timeframes Not Working Correctly

 

Hello,

I'm developing an EA and have run into a roadblock, and am in need some help. If anyone can provide sound advice it would surely be appreciated!

The following IF tests is running in an EA on a 5M chart and fails consistently, even when I have phsyically verified the data as being correctly setup on the 5M, 15M and 30M charts. What am I doing incorrectly?

int digits = MarketInfo(Symbol(),MODE_DIGITS);
if(NormalizeDouble(iSAR(NULL,PERIOD_M5,0.02,0.2,0),digits) < NormalizeDouble(iOpen(NULL,PERIOD_M5,0),digits))
{
if(NormalizeDouble(iSAR(NULL,PERIOD_M5,0.02,0.2,1),digits) > NormalizeDouble(iOpen(NULL,PERIOD_M5,1),digits))
{
if(NormalizeDouble(iSAR(NULL,PERIOD_M15,0.02,0.2,0),digits) < NormalizeDouble(iOpen(NULL,PERIOD_M15,0),digits))
{
if(NormalizeDouble(iSAR(NULL,PERIOD_M30,0.02,0.2,0),digits) < NormalizeDouble(iOpen(NULL,PERIOD_M30,0),digits))
{
Print("made it here");

}

}

}

}

Thanks for your help.

Andy

Reason: