The future smart grids (SGs) consist of considerable amount of renewable energy sources (RESs), electrical vehicles (EVs), and energy storage systems (ESSs). The uncertainties associated with EVs and uncontrollable nature of RESs have magnified voltage stability challenges and the importance of an effective energy management system (EMS) in SGs as a practical solution. This study presents a multi-agent transactive energy management system (TEMS) to control demand and supply in the presence of high levels of RESs and EVs, and maximises profit of each participant in addition to satisfying voltage regulation constraints. For this purpose, a real-time pricing is considered based on Cournot oligopoly competition model for demand and merit order effect for production to compensate RESs' fluctuations in real time by an indirect control method. Simulations are conducted in the modified IEEE 37-bus test system with 1141 customers, 670 EVs, two solar plants, four wind turbines, and one ESS. The results show that the proposed multi-agent TEMS can indirectly control EVs, elastic loads, and ESSs to balance the RESs oscillation, minimise customers cost, and regulate voltage in a real-time manner.