> For the complete documentation index, see [llms.txt](https://docs.algomojo.com/algomojo/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.algomojo.com/algomojo/strategies/amibroker/alphatrend-trading-strategy.md).

# AlphaTrend Trading Strategy

**Sample AFL Code - AlphaTrend Trading Strategy**

**What is Alphatrend?**\
Alpha Trend tries to solve those problems such as:\
1-To minimize stop losses and overcome sideways market conditions.\
2-To have more accurate BUY/SELL signals during trending market conditions.\
3- To have significant support and resistance levels.\
4- To bring together indicators from different categories that are compatible with each other and make a meaningful combination regarding momentum, trend, volatility, volume and trailing stop loss.\
\
**Purposes of Alpha Trend:**\
1- Acts like a dead indicator like its ancestor Magic Trendin sideways market conditions and doesnâ€™t give many false signals.\
2- With another line with 2 bars offset off the original one Alpha Trend has BUY and SELL signals from their crossovers.\
\
**Trading Rules**\
BUY when AlphaTrend line crosses above its 2 bars offset line\
SELL when Alpha Trend line crosses below its 2 bars offset line<br>

&#x20;<mark style="color:blue;">Download Sample Code here</mark>

{% file src="/files/ysp0T3uHlRPAnL8rj93U" %}
