OPEN-SOURCE SCRIPT

Exponential Smoothing Filter

The digital exponential filter, in finance known as Exponential Moving Average (EMA), can be used as a technical indicator for chart analysis to visualize uptrends and downtrends in the market. Unlike the classic simple moving average, the EMA requires only two values ​​for its calculation: the last calculated exponential average price and the current price. This is a simple and fast calculation - even for wide smoothing windows. For further details and the math please refer to the "exponential smoothing" article on Wikipedia.

Here are some additional key points about the exponential moving average:
  1. The EMA can react more quickly to price changes because it can give more weight to current prices - depending on your parameter settings.
  2. Short-term, disruptive price fluctuations are smoothed out well, making prevailing trends more visible.
  3. Despite good smoothing properties, it delays the input values slightly, so it can follow sudden trend changes well.
  4. The EMA is well suited to dynamic markets and trading strategies.
  5. The filter is a good basis for further processing such as gradient analysis.



[u]How to use[/u]
When you add the script to your charts, you'll immediately see a thin [color=orange]orange line[/orange] across your time series, smoothing out price fluctuations.

There are only two parameters to set
  1. smoothing factor between 0.0000 = no smoothing and 0.9999 = strong smoothing
  2. input source: open, high, low, close hl2, etc.


[u]Chart output[/u]
In the example chart above, you can see that the orange line follows the highs and lows better than the [color=blue]blue line[/color], which is a simple moving average (SMA).

Additionally, the orange line has a shorter lag, or reacts faster when the trend of the original price data suddenly changes. These characteristics are critical for buying and selling decisions: quickly reacting and tracking highs and lows while providing a smooth line that filters out distracting noise.
charteducationalExponential Moving Average (EMA)mathematicsSimple Moving Average (SMA)

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

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

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

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