In the present paper, a mathematical model for a portfolio is proposed. This model is valid for operations of buying and selling shares of an asset in constant periods of time, additionally, it has a states space form which can be used to design a control law using control theory. The control law designed can be interpreted as a trading signal to reach a portfolio value desired. The mathematical model and control law proposed are validated by means simulations using real daily prices of Mexican stock exchange.