Trend following strategies are a type of trading strategy that aims to identify the direction of the trend in the market and enter trades in the same direction. The idea behind trend following strategies is that markets tend to trend in one direction for extended periods of time and by identifying and following these trends, traders can potentially profit. These strategies use indicators, such as moving averages, MACD, ADX, or trendlines, to identify the direction of the trend. Once a trend is identified, the strategy will enter trades in the treding direction and hold the position until the trend changes or the trade reaches its profit objective. These strategies are commonly used in forex, stocks, and other markets that have a tendency to trend.
An example of a trend following strategy using moving averages in Pine Script:
This strategy uses two moving averages, a fast moving average and a slow moving average, to identify the direction of the trend. The strategy starts by defining the strategy with thestrategy()
function and setting theoverlay
parameter totrue
, which means that the strategy will be plotted on top of the price chart.
Content by: Invostock.com
Get full access to all training courses.