# Hull Moving Average (HMA)

> HMA (Hull Moving Average) is a fast-reacting trend indicator that reduces lag compared to SMA and EMA, used as a trend direction filter in Veles bots.

The Hull Moving Average (HMA) is a technical indicator that calculates the average price over a specified period, but does so faster and more accurately than traditional [SMAs](https://help.veles.finance/en/filters/sma/) or [EMAs](https://help.veles.finance/en/filters/ema/).

The main goal of the HMA is to reduce lag while maintaining a smooth line. This makes the indicator more sensitive to price changes and helps identify entry and exit points earlier.

## How HMA Works

Unlike Simple Moving Averages, HMA uses Weighted Moving Averages (WMA).
This allows it to place greater emphasis on recent price values and reduce response lag.

How it works:

1. The WMA (Weighted Moving Average) is calculated for half the period.
2. The WMA is calculated for the full period.
3. The difference between them is multiplied by a coefficient and smoothed with another WMA.

The result is a **smooth line** that barely lags the price.

## HMA Signals

The indicator can be used to understand the current trend:

- **Price above HMA** → the market is considered *bullish* → Buy-signal (open Long or close Short).
- **Price below HMA** → the market is considered *bearish* → Sell-signal (open Short or close Long).

## Advantages of HMA over SMA and EMA

- Reacts faster than SMA (Simple Moving Average).
- Maintains a smooth line, unlike EMA, which may get "jerky" over short intervals.
- Works well as a trend filter – helps filter out false signals from oscillators.

## Using in Veles Bots

In the Veles bot settings, you can set a condition based on the HMA value. This allows you to:

- filter entry points (for example, only enter trades in the direction of the trend),
- combine HMA with other indicators ([RSI](https://help.veles.finance/en/filters/rsi/), [MACD](https://help.veles.finance/en/filters/macd/)) to improve signal accuracy.

## Limitations

- HMA can react too quickly to price fluctuations on very short timeframes, increasing false signals.
- Like all trend-following indicators, HMA lags at the start of new trends and cannot predict reversals.
- Best used as a directional filter combined with an oscillator (RSI, CCI) rather than as a sole entry signal.

## Using in Veles Bots (Flexible Indicator)

Available settings:

- Period - the number of candles for calculation. Range: 4–500, default 9.
- Interval - the candle timeframe.
- Method - the calculation type. By bar close (only on the selected interval) or by minute (once per minute for any interval).
- Shift - shifts the requested indicator value back by the specified number of candles.

## Summary

The Hull Moving Average is an improved version of classic Moving Averages. It minimizes lag, stays smooth, and allows for faster response to price changes. When combined with other indicators, the Hull Moving Average becomes a reliable tool for algorithmic strategies in Veles.
