One of the trends in electricity reform is the involvement of bilateral contracts that will participate in electricity business development. Bilateral agreements require fair transmission loss costs compared with the integrated power system. This paper proposes a new algorithm in determining the optimal allocation of transmission loss costs for bilateral contracts based on the direct method in economic load dispatch. The calculation for an optimal power flow applies fast decoupled methods. At the same time, the determination of a fair allocation of transmission losses uses the decomposition method. The simulation results of the optimal allocation of power flow provide comparable results with previous studies. This method produces a fair allocation of optimal transmission loss costs for both integrated and bilateral parties. The proportion allocation of the transmission lines loss incurred by the integrated system and bilateral contracts reflects a fair allocation of R. 852. 589 and R. 805.193, respectively.