In this paper, we aim at presenting a mathematical model, based on networks, which allows us to formulate a new multi-period portfolio selection problem as a Markowitz mean-variance optimization problem with intermediaries and the addition of transaction costs and taxes (on the capital gain). Moreover, utilizing the proposed Integer Nonlinear Programming (INLP) Problem, it is possible to establish when it is suitable to buy and to sell financial securities, not only while maximizing the profits but also while minimizing the risk which is weighted by an aversion degree or risk inclination value. We find the related optimality conditions, which provide us with a variational inequality formulation. Some existence and uniqueness results, as well as the Lagrange formulation, are stated, and some numerical examples are studied.