The design of smart grid systems have been proposed in several literature. However, the actual commercial feasibility of smart grids or micro grids still faces several problems including technical infrastructure related issues and market economy issues. One critical issue in the design of commercially feasible smart grids is how the electricity trading can be performed fairly among micro grids. In existing works, this issue has been mainly addressed by using some sort of priority scheme among buyers and sellers in electricity trading, which obviously does not guarantee a fair trading scheme. As a result, the commercial feasibility of existing works is at stake and will not work as proposed. This work tries to address this issue by proposing a Fair Energy Resource Allocation (FERA) method for smart grids. The proposed method has been implemented in a FIPA-compliant Multi-Agent System (MAS) based smart grid control system and evaluated against state-of-the-art round robin and priority based allocation methods. For trading among 30 micro grids, it is demonstrated that the proposed method results in a high fairness index of 96.22% even in the worst case, while the round robin scheme and the priority scheme result in a worst-case fairness index of only 57.8% and 11.29%, respectively. Thus, in the long term under different ratios of buyers and sellers, the proposed method is the only method that can achieve a very high fairness index in the worst case. Averaging over different ratios of buyers and sellers, the proposed method results in a fairness index of 99.57%, which is much higher that achieved by the round robin method (84.04%) and the priority scheme (63.56%). As far as cost saving is concerned, based on the cost saving opportunity (CSO) metric, in the long term (10,000 rounds of trading), the proposed method results in a CSO of 51.48%, which is much higher than that by the other two methods; round robin method results in 14.07% and priority-based method results in 34.44%.