buy and sell orders Not obeying all my conditions

 
I'm having an issue with my EA. Although it's doing very well it's not obeying all my conditions all the time. I have a variable named "gap" and my EA should not make trades on currency pairs when there relative strength and weakness are in a certain range to one another. Example: the AUDJPY, the AUD is really strong and the JPY is really week. Its ok to trade this this symbol. If the AUD is not really strong and the JPY is also not very weak then dont trade this symbol. I have no idea why my conditions are not being obeyed. Could someone please look at this and help me identify the issue?
Files:
CS_Stoch_EA.mq4  36 kb
 
I'm still lost on this issue.