In finance, the most efficient portfolio is the tangency portfolio, which is formed by the intersection point of the efficient frontier and the capital market line. This paper defines and explores a time-varying tangency portfolio under nonlinear constraints (TV-TPNC) problem as a nonlinear programming (NLP) problem. Because meta-heuristics are commonly used to solve NLP problems, a semi-integer beetle antennae search (SIBAS) algorithm is proposed for solving cardinality constrained NLP problems and, hence, to solve the TV-TPNC problem. The main results of numerical applications in real-world datasets demonstrate that our method is a splendid substitute for other evolutionary methods.