βœ–

Home Forums Trading view How can I create a dashboard or table on the TradingView chart using Pine Script?

How can I create a dashboard or table on the TradingView chart using Pine Script?

  • Author
    Posts
    • I’m developing my own TradingView indicator and I’ve seen many indicators display a dashboard on the chart showing values like Trend, EMA, RSI, ATR, Buy/Sell signals, and other useful information.

      Instead of looking at multiple plots or opening the Data Window, I want to display all the important information in a clean table directly on the chart.

      Is there any built-in feature in Pine Script to create such dashboards? If yes, how can I use it properly?

    • Yes sir, you can definitely do that. Pine Script provides a built-in table object that allows you to create custom dashboards directly on the TradingView chart.

      A table can be used to display any information that your script calculates, such as:

      -Trend Direction

      -Current Signal (Buy/Sell)

      -EMA Values

      -RSI Value

      -Any custom calculation from your strategy or indicator

      For example, you can create a simple dashboard like this:

      //@version=6
      indicator("Dashboard Example", overlay = true)
      
      emaFast = ta.ema(close, 20)
      emaSlow = ta.ema(close, 50)
      rsiValue = ta.rsi(close, 14)
      
      trend = emaFast > emaSlow ? "Bullish" : "Bearish"
      
      var table dashboard = table.new(position.top_right, 2, 4, frame_color = color.green, frame_width = 2, bgcolor = color.white, border_color = color.teal, border_width = 2)
      
      if barstate.islast
          table.cell(dashboard, 0, 0, "Trend")
          table.cell(dashboard, 1, 0, trend)
      
          table.cell(dashboard, 0, 1, "EMA 20")
          table.cell(dashboard, 1, 1, str.tostring(emaFast))
      
          table.cell(dashboard, 0, 2, "EMA 50")
          table.cell(dashboard, 1, 2, str.tostring(emaSlow))
      
          table.cell(dashboard, 0, 3, "RSI")
          table.cell(dashboard, 1, 3, str.tostring(rsiValue))

      This creates a dashboard in the top-right corner of the chart that updates automatically on every new bar.

      You can also customize the table according to your requirements.

      -Change its position using position.top_left, position.top_right, position.bottom_left, position.bottom_right, or other available positions.

      -Add more rows and columns.

      -Display text, numbers, or calculated values.

      -Change the background color and text color.

      -Highlight Buy and Sell signals with different colors.

      -Show live values from multiple timeframes.

      -One important thing to remember is that the table should usually be updated only on the last bar by using barstate.islast. This improves performance and avoids unnecessary updates on historical bars.

      So that’s how you can create a professional dashboard on the TradingView chart using Pine Script.

      For more information, you can refer to the official Pine Script documentation:
      https://www.tradingview.com/pine-script-docs/concepts/tables/

Viewing 1 reply thread
×

Start a Discussion

Get help from the AlgoDelta community.

×

Welcome Back!

Enter your email to sign in or create an account. No passwords needed.

⚠️

Delete This?

Are you sure you want to delete this? This action is permanent and cannot be undone.

Scroll to Top