The evolution from passive to active distribution network, the ability to actively control distributed energy resources and to perform bilateral energy exchange has significantly complicated the market transactions in recent years due to activities among consumers and prosumers. Local electricity market (LEM) is challenged to optimize welfare as well as reduction of emissions by involving participants in energy transactions. In this paper, the trading strategy is modeled as a single-objective optimization problem to determine each agent's optimal energy trading. Modern heuristic optimization techniques have proven their efficiency and robustness in large optimization problems and thus, an enhanced artificial bee colony (EABC) incorporating a distribution estimation algorithm is proposed, which guides the search for optimum by building and sampling explicit probabilistic models of promising candidate solutions. With the help of a distribution estimation algorithm, the EABC eliminates many tuning parameters in the original ABC and increases its exploitation to obtain more robust and competitive performance. A comparative study is conducted with the basic ABC, differential evolution, and particle swarm optimization, and the EABC demonstrates its efficiency on the case study where nine agents are involved in trading energy in the day-ahead LEM.