We consider a two-way cognitive radio relay network where two secondary users (SUs) can simultaneously transfer energy and information to a relay. Then, a joint optimization algorithm for power allocation and energy cooperation is proposed. The algorithm proves that the formulated throughput maximization problem is a convex optimization problem. Next, we decompose the formulated problem into a power allocation problem and an energy transmission problem. Finally, the power allocation problem is solved by an iteration water-filling algorithm, and the energy transmission problem of each timeslot is solved by the derivative method. Simulation results show that energy cooperation can significantly improve system throughput.