How to automate strategy back-testing in Forex Trading?

I am aware of MQL4. One can create an expert advisor to automate your investing, but what I want is to test my strategies with historical data. For example, what would have happen during the last 5 months if I would have sold here and bought here using such and such indicators in every single time a certain criteria was met.