The Firefly Algorithm (FA) is used as an optimization tool to construct a stock portfolio based on the IDX–MES BUMN 17 index by balancing risk and return under a cardinality constraint on the number of investable stocks. The data consist of daily closing prices for 14 sharia-compliant state-owned enterprise stocks included in the IDX–MES BUMN 17 index over the period September 2019–September 2024, downloaded from Yahoo Finance and transformed into daily log-returns. The expected returns and covariance matrix are embedded into a weighted objective function that combines the reciprocal of portfolio return and portfolio variance, with a weight placing stronger emphasis on risk. The results show that FA attains stable solutions on a non-convex optimization landscape and produces an optimal portfolio that is highly concentrated in a single dominant stock, while other stocks contribute only marginally. These findings suggest that FA is effective as a technical engine for portfolio optimization, but additional constraints such as an upper bound on individual stock weights and a minimum number of stocks in the portfolio are still required to obtain a more practically diversified sharia portfolio.
Copyrights © 2026