This work presents a new metaheuristic called treble opposite algorithm (TOA). It consists of three phases. There are two searches that are opposite to each other performed in each phase. In the first phase, the search toward and away from the best solution is carried out. In the second phase, the search toward and away from the middle between two randomly picked solutions is carried out. In the third phase, a neighborhood search around the narrow and large space is carried out. A candidate is selected among the two searches in every phase. TOA is challenged to solve theoretical and practical problems. The 23 functions represent theoretical problems, while the portfolio optimization of stocks in the banking sector listed in IDX30 represents the practical problem. TOA is compared with five metaheuristics: grey wolf optimization (GWO), golden search optimization (GSO), average subtraction-based optimization (ASBO), zebra optimization algorithm (ZOA), and coati optimization algorithm (COA). The result indicates that TOA is superior to its competitors as it is better than GWO, GSO, ZOA, ASBO, and COA in 22,23,19,20,and 19 functions respectively, in handling 23 functions and produces the highest total capital gain in handling portfolio optimization problem. In the future, TOA can be utilized to handle many other realworld optimization problems. Moreover, TOA can be hybridized with other metaheuristics to improve its performance.