OPEN-SOURCE SCRIPT

Hybrid Adaptive Momentum Average (HAMA)

266
Hybrid Adaptive Momentum Average (HAMA)

Imagine you want a moving average line on your chart that's usually smooth but gets really quick to follow the price when the market suddenly makes a big, fast move. That's what HAMA tries to be.

Here's the simple breakdown:

Slightly Better Starting Price: Instead of just using the closing price, HAMA first creates a slightly "smarter" starting price by giving a bit more importance to the very latest prices (like a quick WMA).

Checks Market Speed (Momentum): It then looks at how fast this "smarter price" has been moving recently.

-If the price is shooting up or down quickly, HAMA knows there's strong momentum.
-If the price is just drifting sideways, momentum is low.

Adjusts Its Own Speed: Based on this momentum:

-Strong Momentum (Fast Market): HAMA makes itself "faster." This means its line will stick closer to the current price and react quickly to changes. (It uses a shorter "period" internally).
-Weak Momentum (Slow/Choppy Market): HAMA makes itself "slower." Its line will be smoother and less jumpy, ignoring minor wiggles. (It uses a longer "period" internally).
-Draws the Line: Finally, it calculates and draws the moving average line using this automatically adjusted speed.

Why "Hybrid"?

It's called "hybrid" because it takes bits and pieces of ideas from several standard moving averages:

-Like an EMA, it's built to be responsive.
-Like a WMA, it initially focuses on recent prices.
-Inspired by the HMA, it tries to be smart about detecting momentum to adjust itself.

In a Nutshell:

The HAMA is a custom moving average that tries to be the best of both worlds: smooth in calm markets and quick to react in fast-moving markets by automatically changing its own calculation speed based on price momentum.

Penafian

Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.