PurposeThis study examines the investment horizon influence, mediated by market optimism, on earnings management based on accruals and real activities. Based on short-termism, the authors argue that earnings management increases in optimistic periods to boost corporate profits.Design/methodology/approachThe authors analyzed non-financial Brazilian publicly traded firms from 2010 to 2020 by estimating industry-fixed effects of groups of short- and long-horizon firms to compare their behavior on earnings management practices during bullish moments. For robustness, the authors used alternate measures and trade-off analyses between earning management practices.FindingsThe findings indicate that, during bullish moments, companies prioritize managing their earnings through real activities management (RAM) rather than accruals earnings management (AEM), depending on their time horizon. The results demonstrate the trade-off between earnings management practices.Research limitations/implicationsThis study presents limitations when using proxies for earnings management and investor sentiment.Practical implicationsInvestors and regulators should closely monitor companies' operations, especially during bullish market conditions to prevent fraud.Originality/valueThe study addresses investor sentiment mediation in the earnings management discussion, introducing the short-termism approach.