Recently, numerous investors have shifted from active strategies to passive strategies because the passive strategy approach affords stable returns over the long term. Index tracking is a popular passive strategy. Over the preceding year, most researchers handled this problem via a two-step procedure. However, such a method is a suboptimal global-local optimization technique that frequently results in uncertainty and poor performance. This paper introduces a framework to address the comprehensive index tracking problem (IPT) with a joint approach based on metaheuristics. The purpose of this approach is to globally optimize this problem, where optimization is measured by the tracking error and excess return. Sparsity, weights, assets under management, transaction fees, the full share restriction, and investment risk diversification are considered in this problem. However, these restrictions increase the complexity of the problem and make it a nondeterministic polynomial-time-hard problem. Metaheuristics compose the principal process of the proposed framework, as they balance a desirable tradeoff between the computational resource utilization and the quality of the obtained solution. This framework enables the constructed model to fit future data and facilitates the application of various metaheuristics. Competitive results are achieved by the proposed metaheuristic-based framework in the presented simulation.