Abstract This article addresses a portfolio selection problem with trading costs on stock market. More precisely, we develop a simple generalized method of moments (GMM)-based test procedure to test the significance of trading costs effect in the economy with a flexible form of transaction costs. We also propose a two-step procedure to test overidentifying restrictions in our GMM estimation. In an empirical analysis, we apply our test procedures to the class of anomalies used in Novy-Marx and Velikov (2016). We show that transaction costs have a significant effect on investors’ behavior for many anomalies. In that case, investors significantly improve the out-of-sample performance of their portfolios by accounting for trading costs.