How to optimize/test an EA that works on tick data

 

Hi, I wrote an EA that works off of tick data. It works like I want when I run it, but when I try it in the strategy tester I just get a bunch of zeros for the results.

 I've attached it, it's a simple little percentile EA. Please take a look at it and let me know what I'm doing wrong.

Files:
MinMax.mq5  4 kb
MinMax.ex5  55 kb