OPEN-SOURCE SCRIPT

Multi-Timeframe EMA Distance & % Change Table

Description of Multi-Timeframe EMA Distance & % Change Table

The Multi-Timeframe EMA Distance & % Change Table indicator is designed to display the distance and percentage change between the current price and the Exponential Moving Averages (EMAs) on multiple timeframes. It creates a table to show these values, with customizable options for decimal precision.

Key Features:

  • Inputs:
    - Timeframes (tf1, tf2, tf3, tf4): User-defined timeframes for EMA calculations (e.g., 1 minute, 15 minutes, daily, etc.).
    - EMA Levels (emaLevel, emaLevel2, emaLevel3): User-defined periods for three different EMAs.

  • EMA Calculations:
    - Computes EMAs for the specified levels (50, 100, 200) on each of the user-selected timeframes.

  • Plotting:
    - Plots the EMAs on the chart with distinct colors: Orange, Teal, and Green for different EMAs.

  • Display Options:
    - Checkbox (displayAsPercentage): Allows the user to toggle between displaying distances or percentage changes.
    - Decimal Precision:
    - decimalPlacesDistance: Specifies the number of decimal places for rounded distance values.
    - decimalPlacesPercentage: Specifies the number of decimal places for rounded percentage values.

  • Table Creation:
    - Location: Table is placed in the top-right corner of the chart.
    - Headers: Includes columns for each timeframe and EMA distance/percentage.

  • Distance and Percentage Calculations:
    - Distances: Calculated as the difference between the current price and the EMA values for each timeframe.
    - Percentages: Calculated as the distance divided by the EMA value, converted to a percentage.

  • Decimal Rounding:
    - Custom Rounding Function: Ensures that distance and percentage values are displayed with the user-specified number of decimal places.

  • Color Coding:
    - Distance Values: Colored green if positive, red if negative.
    - Table Entries: Display either the rounded distance or percentage, based on user selection.

  • Table Update:
    - The table is dynamically updated with either distance or percentage values based on the user's choice and rounded to the specified number of decimal places.


This indicator provides a comprehensive overview of EMA distances and percentage changes across multiple timeframes, with detailed control over the precision of the displayed values.
distancetableExponential Moving Average (EMA)EMASmulti-timeframeprice-action-analysisTechnical AnalysisTriple Exponential Moving Average (TEMA)Trend Analysis

오픈 소스 스크립트

진정한 TradingView 정신에 따라, 이 스크립트의 저자는 트레이더들이 이해하고 검증할 수 있도록 오픈 소스로 공개했습니다. 저자에게 박수를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 출판물에서 이 코드를 재사용하는 것은 하우스 룰에 의해 관리됩니다. 님은 즐겨찾기로 이 스크립트를 차트에서 쓸 수 있습니다.

차트에 이 스크립트를 사용하시겠습니까?

면책사항