PineCodersTASC

TASC 2022.09 LRAdj EMA

█ OVERVIEW

TASC's September 2022 edition of Traders' Tips includes an article by Vitali Apirine titled "The Linear Regression-Adjusted Exponential Moving Average". This script implements the titular indicator presented in this article.

█ CONCEPT

The Linear Regression-Adjusted ​Exponential Moving Average (LRAdj ​EMA) is a new tool that combines a ​linear regression indicator with exponential moving averages. First, the indicator accounts for the ​linear regression deviation, that is, the distance between the price and the ​linear regression indicator. Subsequently, an ​exponential moving average (​EMA) smooths the price data and and provides an indication of the current direction.

As part of a trading system, LRAdj ​EMA can be used in conjunction with an ​exponential moving average of the same length to identify the overall trend. Alternatively, using LRAdj EMAs of different lengths together can help identify turning points.

█ CALCULATION

The script uses the following input parameters:
  • ​EMA Length
  • ​LR Lookback Period
  • Multiplier

The calculation of LRAdj ​EMA is carried out as follows:

Current LRAdj ​EMA = Prior LRAdj ​EMA + MLTP × (1+LRAdj×Multiplier) × (Price − Prior LRAdj ​EMA),

where MLTP is a weighting multiplier defined as MLTP = 2 ⁄ (​EMA Length + 1), and LRAdj is the ​linear regression adjustment (LRAdj) multiplier:
LRAdj = (Abs(Current ​LR ​Dist)−Abs(Minimum ​LR ​Dist)) ⁄ (Abs(Maximum ​LR ​Dist)−Abs(Minimum ​LR ​Dist))

When calculating the LRAdj multiplier, the absolute values of the following quantities are used:
Current ​LR ​Dist is the distance between the current close and the ​linear regression indicator with a length determined by the ​LR Lookback Period parameter,
Minimum ​LR ​Dist is the minimum distance between the close and the ​linear regression indicator for the LR lookback period,
Maximum ​LR ​Dist is the maximum distance between the close and the ​linear regression indicator for the LR lookback period.

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 อ่านเพิ่มเติมที่ เงื่อนไขการใช้บริการ

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