This paper presents a Robust Genetic Programming approach for discovering profitable trading rules which are used to manage a portfolio of stocks from the Spanish market. The investigated method is used to determine potential buy, sell conditions for stocks, aiming to yield robust solutions able to withstand extreme market conditions, while producing high returns at a minimal risk. One of the biggest challenges GP evolved solutions face is over-fitting. GP trading rules need to have similar performance when tested with new data in order to be deployed in a real situation. We explore a random sampling method (RSFGP) which instead of calculating the fitness over the whole dataset, calculates it on randomly selected segments of it. This method shows improved robustness and out-of-sample results compared to standard genetic programming and a volatility adjusted fitness. Trading strategies (TS) are evolved using financial metrics like the volatility, CAPM alpha and beta, and the Sharpe ratio alongside other Technical Indicators (TI) to find the best investment strategy. These strategies are evaluated in using 21 of the most liquid stocks of the Spanish market. The achieved results clearly outperform both the Buy&Hold. Additionally, the solutions obtained with the training data during the experiments clearly show during testing robustness to step market declines as seen in the European sovereign debt experienced recently in Spain. In this paper the solutions learned where able to operate for prolonged periods, which demonstrated the validity and robustness of the rules learned, which are able to operate continuously and with minimal human intervention. To sum up, the developed method is able to evolve TSs suitable for all market conditions with promising results, which suggests great potential in the method generalization capabilities. The use of the financial metrics alongside popular TI enables the system to increase the stock return while proving resilient through time. The GP system is able to cope with different types of markets achieving a portfolio return of slightly higher than 30% for the period of 20092013 in the Spanish market, in a period that includes the sovereign debt crisis.