© 2015 CSEE.This paper proposes a new cost-efficient, adaptive, and self-healing algorithm in real time that detects faults in a short period with high accuracy, even in the situations when it is difficult to detect. Rather than using traditional machine learning (ML) algorithms or hybrid signal processing techniques, a new framework based on an optimization enabled weighted ensemble method is developed that combines essential ML algorithms. In the proposed method, the system will select and compound appropriate ML algorithms based on Particle Swarm Optimization (PSO) weights. For this purpose, power system failures are simulated by using the PSCAD-Python co-simulation. One of the salient features of this study is that the proposed solution works on real-time raw data without using any pre-computational techniques or pre-stored information. Therefore, the proposed technique will be able to work on different systems, topologies, or data collections. The proposed fault detection technique is validated by using PSCAD-Python co-simulation on a modified and standard IEEE-14 and standard IEEE-39 bus considering network faults which are difficult to detect.