SummaryThe demand for green energy sources has led to the exploration of photovoltaic (PV) systems as a sustainable and cost‐effective solution. However, PV systems have an uncertain nature that makes the tracking of global maximum power point a challenge. To get the optimal benefits from the PV source, the extraction of power is required in a precise manner, especially in the case of irregular complex partial shading conditions (CPSCs). In the case of CPSCs, the global maximum point tracking (GMPP) is a bit difficult to manage by the conventional algorithms presented so far. As the power peaks increase with CPSCs, the conventional algorithms are usually stuck in the local maxima. To avoid sticking at all the local maxima points and to find GMPP with better efficiency, stretching is used here along with the repulsion technique. Stretching and repulsion techniques are merged with the chimp optimization algorithm (SRCA). The tuning parameters of SRCA are so effective that remove all local points and lead to finding the GMPP accurately. The proposed algorithm is applied to the PV array to extract optimal power off‐grid and on‐grid as well. The average tracking time and output power efficiency in the case of off‐grid is observed as 0.4 s and 99.87% while in the case of on‐grid as 0.09 s and 98.88%, respectively.