Mean reversion – A strategy betting that price will revert to its historical average. The core idea is that extreme moves in either direction will “mean-revert” over time. For example, an EA might measure the distance of current price from a moving average: if the EUR/USD is 2% above its 20-day average, the robot shorts expecting a drop back to the mean. Code-wise, an MQL5 bot could calculate double avg = iMA(_Symbol,_Period,20,0,MODE_SMA,PRICE_CLOSE,1); if(SymbolInfoDouble(_Symbol,SYMBOL_BID) > avg + threshold) Trade.Sell();
. On the flip side, if price is well below average, it buys. In Backtrader, one could implement mean reversion by waiting for price to exit Bollinger Bands and then crossing back. Wikipedia explains “deviations from the average price are expected to revert to the average”. Automated mean-reversion systems often include StopLoss
/TakeProfit
rules to manage trends that fail to reverse. In Forex, mean-reversion is common in range-bound markets; for example, a Zipline strategy might use order_target_percent()
to enter pairs trades when a linear regression channel signals a bounce. This approach contrasts with momentum: it sells high and buys low (returning to mean), whereas momentum strategies buy high hoping for further rises.