NT30356

Multi Timeframe ATR Indicator

The Average True Range (ATR) indicator is a technical analysis tool used to measure market volatility. The ATR indicator is designed to capture the degree of price movement or price volatility over a specified period of time. It does this by calculating the true range for each bar or candlestick on a chart and then taking an average of these true range values over a set period.

In the provided Pine Script code, the ATR indicator is being calculated for two different timeframes, which allows traders to compare volatility across different periods. The script includes user-defined inputs for the length of the ATR calculation and the type of smoothing (RMA or SMA) to be applied to the true range values. The 'smoothingFunc' function within the script determines whether to use the RMA (Relative Moving Average) or SMA (Simple Moving Average) based on the user's selection.

The true range for each bar is calculated as the maximum of the following three values: the difference between the current high and low, the absolute value of the difference between the current high and the previous close, and the absolute value of the difference between the current low and the previous close. This calculation is designed to ensure that gaps and limit moves are properly accounted for in the volatility measurement.
The script then uses the 'smoothingFunc' to calculate the ATR values for the two timeframes, and these values are plotted on the chart as two separate lines, allowing traders to visually assess the volatility levels.

Overall, this custom ATR indicator is a versatile tool for traders who wish to analyse market volatility and compare it across different timeframes, potentially aiding in making more informed trading decisions based on the prevailing market conditions.

สคริปต์โอเพนซอร์ซ

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

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

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

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