OPEN-SOURCE SCRIPT

3 EMAs with Custom Lengths

This code plots three Exponential Moving Averages (EMAs) on a price chart. EMAs are used to smooth price data and highlight trends.

Inputs for EMA lengths: The user can specify the lengths (e.g., 10, 20, 50 periods) of the three EMAs through input fields. By default, the lengths are set to 10, 20, and 50.

EMA Calculation: For each of the specified lengths, the script calculates the EMA based on the closing prices of the asset.

Plotting the EMAs: The three EMAs are drawn on the price chart in different colors, so users can easily compare them. These moving averages help in spotting trend direction, crossovers, and potential trading signals.

The overall purpose of the code is to give the user a visual representation of three EMAs on their price chart, which can be customized based on their trading strategy.
Candlestick analysisExponential Moving Average (EMA)

Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in publication is governed by House rules. You can favorite it to use it on a chart.

Want to use this script on a chart?

Disclaimer