Blog : Mean Reversion vs. Trend Following: Understanding Strategies
What is Trend Following?
Trend following is an investment strategy that seeks to profit from market trends. Traders using this method buy assets when they believe a rising trend will continue and sell assets when they believe a declining trend will persist. This strategy is grounded in the belief that trends are more likely to continue than reverse.
What is Mean Reversion?
Mean reversion is a financial concept that suggests asset prices and returns will eventually move back toward the average over time. Investors using this strategy buy assets that are undervalued, anticipating their prices will increase back to the mean. Conversely, they might sell assets that are overvalued, expecting their prices to decrease.
How Type Selection Works?
In getpinescript service, users can choose between these two strategy types under the "Condition Type" section. Here's how it works:
- Condition Type Selection Users can select either "Mean Reversion" or "Trend Following" as their condition type. This is a crucial first step that guides the script generation process.
- Entry & Exit Condition Selection While you have the flexibility to choose which indicators you want to use as an entry or exit, the conditions for these indicators are automatically set by the getpinescript code engine based on the selected condition type. This means you do not need to manually configure the conditions, making it easier and more efficient to generate scripts.
Practical Example of Using Trigger and Confluence Conditions
To illustrate how this works, let's consider the example of the RSI (Relative Strength Index) indicator. When you pick the RSI indicator as an entry and exit trigger, here are the auto-assigned conditions based on the selected strategy type:
Trend Following
LONG ENTRY RSI value must cross over the middle level (50)
LONG EXIT RSI value must cross under the middle level (50)
SHORT ENTRY RSI value must cross under the middle level (50)
SHORT EXIT RSI value must cross over the middle level (50)
Mean Reversion
LONG ENTRY RSI value must cross under the oversold level (30)
LONG EXIT RSI value must cross over the overbought level (70)
SHORT ENTRY RSI value must cross over the overbought level (70)
SHORT EXIT RSI value must cross under the oversold level (30)
Differences Between Trend Following and Mean Reversion
- Mean reversion assumes prices will return to their average, while trend following assumes prices will continue moving in their current direction.
- Mean reversion looks for extreme price points, while trend following looks for established trends.
- Mean reversion works best in volatile markets with frequent price swings, while trend following works best in stable markets with clear trends.
Best Time Frame for Trend Following and Mean Reversion Strategies
- Mean Reversion often used in shorter time frames (intraday) because price corrections to the mean can occur quickly.
- Trend Following typically applied over longer time frames (days to weeks) to capture substantial price movements and trends.