In this paper, we examine a complex portfolio selection strategy with a dual emphasis on systemic risk. This strategy or only its elements are advisable for both portfolio managers as well as macroprudential regulators. In particular, first, we present the concept of an early warning system (alarm) employing selected entropy measures, which allow us to detect systemic risk in financial markets. Secondly, we apply the two-phase optimization framework to determine the optimal composition of the portfolio. Essentially, the first phase of this strategy includes the reward‒risk ratio maximization part and the following phase aims at systematic risk minimization. Furthermore, we approximate the returns using a dynamic set of components obtained from the principal component analysis and the classical ordinary least squares regression. In the empirical analysis using US market data, the wealth paths and statistics of different portfolio strategies are compared with each other. Ex-post results confirm higher profitability of the early warning system with double optimization, even if the transaction costs are taken into account. However, the main benefit lies in the significantly better risk properties of the proposed strategy.