If we change the chart to a different instrument, the label changes accordingly. Here the label shows the instrument’s label with GER30. We get that latter with the syminfo.ticker variable. The label’s text has the instrument’s exchange ( syminfo.prefix) and symbol. The drawing points to the upper left ( label.style_label_upper_left) and appears in transparent yellow. ![]() That label shows two bars to the right ( bar_index 2) and halfway the bar’s midpoint price ( hl2). On that bar we make a new text label with the label.new() function. This variable is true on the chart’s last historical bar. Then an if statement checks the barstate.islastconfirmedhistory variable. That names the script and overlays it on the chart’s instrument. This indicator first defines its settings with the indicator() function. Text = "This instrument trades at\n" syminfo.prefix " with this symbol:\n" syminfo.ticker) if barstate.islastconfirmedhistory label.new(x = bar_index 2, y = hl2, style = label.style_label_upper_left ,Ĭolor = color.new( color.yellow, 70), size = size.large , On the last historical bar, make a label that shows the // instrument's symbol and exchange. This quick indicator shows the instrument’s symbol ( syminfo.ticker) on the chart: indicator(title = "Show 'syminfo.ticker' on chart", overlay = true) So they won’t show if we display the variable in a label, for instance. But the quotes aren’t part of the variable’s value. Micro E-mini S
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |