PineCodersTASC

TASC 2023.05 Cong Adaptive Moving Average

█ OVERVIEW

TASC's May 2023 edition of Traders' Tips features an article titled "An Adaptive Moving Average For Swing Trading" by Scott Cong. The article presents a new adaptive moving average (​AMA) that adjusts its parameters automatically based on market volatility. The ​AMA tracks price closely during trending movements and remains flat during congestion areas.

█ CONCEPTS

Conventional moving averages (MAs) use a fixed lookback period, which may lead to limited performance in constantly changing market conditions. Perry ​Kaufman's adaptive moving average, first described in his 1995 book Smarter Trading, is a great example of how an ​AMA can self-adjust to adapt to changing environments. Scott Cong draws inspiration from ​Kaufman's approach and proposes a new way to calculate the ​AMA smoothing factor.

█ CALCULATIONS

Following Perry Kaufman's approach, Scott Cong's ​AMA is calculated progressively as:
AMA = α * Close + (1 − α) * AMA(1),
where:
  • Close = Close of the current bar
  • AMA(1) = ​AMA value of the previous bar
  • α = Smoothing factor between 0 and 1, defined by the lookback period
The smoothing factor determines the performance of ​AMA. In Cong's approach, it is calculated as:
α = Result / Effort,
where:
  • Result = Highest price of the n period − Lowest price of the n period
  • Effort = Sum(​TR, n), where ​TR stands for Wilder’s true range values of individual bars of the n period
  • n = Lookback period
As the price range is always no greater than the total journey, α is ensured to be between 0 and 1.

Tools and ideas for all Pine coders: www.tradingview.com/u/PineCoders/
Pine news broadcasts: t.me/PineCodersSquawkBox or twitter.com/PineCoders
TASC: traders.com/
สคริปต์โอเพนซอร์ซ

ด้วยจิตวิญญาณของ TradingView อย่างแท้จริง ผู้เขียนสคริปต์นี้ได้เผยแพร่เป็นโอเพนซอร์ส เพื่อให้ผู้ค้าสามารถเข้าใจและตรวจสอบได้ ไชโยให้กับผู้เขียน! คุณสามารถใช้ได้ฟรี แต่การใช้รหัสนี้ซ้ำในสิ่งพิมพ์อยู่ภายใต้กฎระเบียบการใช้งาน คุณสามารถตั้งเป็นรายการโปรดเพื่อใช้บนชาร์ตได้

คำจำกัดสิทธิ์ความรับผิดชอบ

ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมที่ เงื่อนไขการใช้บริการ

ต้องการที่จะใช้สคริปต์นี้บนชาร์ตใช่ไหม?