1

I want to change somes plot (line) on histogram. I can do that, no problem.

plot(MC, color=color_bar, linewidth=1, style=plot.style_histogram, title='1')

And i want that this histogram is on the bottom of the charts with a small height. So the idea is to put in a table but, i have the idea but not the knowledge.

I have this code for the table but i don't find information on the web to put a plot in a table.cell

//@version=5
indicator("Table test",overlay=true)

var table_hma = table.new(position.bottom_center,10,6,border_width=2,border_color=color.gray, frame_color=color.gray, frame_width=2)
    
table.cell(table_hma, 0, 0, text = "SMA", bgcolor=color.black,text_color=color.white, text_size=size.small)

Thanks in advance for your help.

chprot
  • 29
  • 5

1 Answers1

0

The text parameter of the table.cell only accepts strings, so you'll have to convert your MC variable into a string

//Example
table.cell(table_hma, 0, 0, text = str.trostring(MC, "#"), bgcolor=color.black,text_color=color.white, text_size=size.small)
Dave
  • 847
  • 1
  • 2
  • 7
  • Thanks for your answer and your help. I made like this. var table_hma = table.new(position.bottom_center,10,6,border_width=2,border_color=color.gray, frame_color=color.gray, frame_width=2) table.cell(table_hma, 0, 0, str.tostring(MC_hma_tf, "#"), bgcolor=color.black) But the histogram is not in the table. It's as usual on the chart. Thanks. – chprot Oct 04 '22 at 18:20