StratCraft

赫爾移動平均線 (HMA)

HMA 低滯後移動平均線的 QuantNexus 指標頁面。

Route: /quantnexus/indicators/hma/

作用

HMA 旨在比標準移動平均線更平滑,同時對價格變化的反應更快。廣泛用於趨勢跟踪系統。

公式

HMA = WMA(2 * WMA(price, n/2) - WMA(price, n), sqrt(n))

參數

  • period - 默認 30
  • _movav - 默認 WMA

C++23 API

#include <nonabt/indicators/hma.hpp>
auto hma = std::make_unique<nonabt::HMA>(data().close(), 30, "WMA");

常見用法

  • 將 HMA 用作快速趨勢基準線。
  • 將其與價格交叉或第二個較慢的平均線結合使用。
  • 有助於在沒有太多滯後的情況下檢測趨勢逆轉。

實際模式

當價格收於 HMA 之上且 HMA 向上傾斜時買入;當價格跌破該基線時退出。