This academic source is a Final Degree Project from the Polytechnic University of Madrid detailing the creation and rigorous testing of an algorithmic trading bot. The author’s primary goal was to design an anti-trend strategy based on the mean reversion theory, modifying the common double Bollinger bands approach by utilizing an Exponential Moving Average (EMA). This financial algorithm was implemented using the C#-based NinjaScript framework available on the NinjaTrader platform, which facilitated comprehensive backtesting against historical data. After initial tests revealed weaknesses, the strategy was optimized through the successful integration of the Relative Strength Index (RSI) technical indicator to better predict trend shifts. The results of the optimized algorithm demonstrated consistency and favorable risk metrics based on Monte Carlo simulations; however, the author noted its specific vulnerability to unexpected market disruptions, citing significant losses during the 2020 global pandemic. Ultimately, the work concludes that further verification is necessary before the strategy can be confidently deployed in a real-market setting.