# Halftrend Trading System

**Sample AFL Code - Halftrend Trading System**

The Halftrend trading system is a technical analysis strategy that uses the Halftrend indicator, which is a custom trend-following indicator. It is designed to identify the direction of a trend and generate buy and sell signals based on the price action of an asset. The Halftrend indicator is based on moving averages and adapts to changing market conditions by adjusting its sensitivity. The strategy is typically used by swing traders and can be applied to various markets and timeframes.

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

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


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.algomojo.com/algomojo/strategies/amibroker/halftrend-trading-system.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
