help please - my first ea

 
I'm still trying to get my first ea to work properly. The strategy is to open a trade when EMA9 crosses EMA41 by 3 points and close when EMA9 crosses back over EMA17 by 3 points. I'm using StopLoss = 20, take profit = 180. I think I've mastered everything, but it doesn't seem to be opening trades properly in strategy tester. It opened only 3 trades when tested from 10/1/2006 to 4/27/2007. Doesn't seem to be seeing the stop loss. I've attached the code.
Reason: