Proper backtesting is difficult, because of various biases that easily slip into the results if you are not careful.
For example how do you compute historical P/E's. Well, you have historical E's and historical P's so you can divide P by E (as Dimitri Vulis suggests it is better to divide E by P, as most academic studies do). However beware of look ahead bias (using information in the backtest that was not available to investors at the time). The earnings of ACME Corp. for the year ending Q2 2016 are not known on the last day of the second quarter of 2016. They become public with a lag. You need a database that has info about when the earnings were released and also when the earnings were amended/revised (if they were). Most db only have the latest info and the period to which it is related. Instead you need "point in time" information, i.e. what information was available at various past points.
Also Bloomberg removes companies that have gone out of business. Another bias (survival bias, i.e. you are testing only the companies that survived). You need a database that includes dead companies.
In summmary Bloomberg is great for looking up the most recent info on current companies, it is not necessarily suited for historical backtests (at least without considerable additional work).