We introduce a stochastic price model where, together with a random component, a moving average of logarithmic prices contributes to the price formation. Our model is tested against financial datasets, showing an extremely good agreement with them. It suggests how to construct trading strategies which imply a capital growth rate larger than the growth rate of the underlying asset, with also the effect of reducing the fluctuations. These results are a clear evidence that some hidden information is not fully integrated in price dynamics, and therefore financial markets are partially inefficient. In simple terms, we give a recipe for speculators to make money as long as only few investors follow it.