How to get a value of the variable for debugging purposes

To display the value of a numeric variable, you can plot it using the plot() function:

plot(variable_name)

This allows you to inspect the variable's value on each chart bar and follow its progression if it changes.
If you want to display the value of a string variable, use the label.new() function:

label.new(bar_index, high, text=syminfo.ticker)

You can also use label.new() to display the value of a numeric variable by first converting it to a string using the tostring() function:

label.new(bar_index, high, text=tostring(high))

The label.new() function will only display the last ~50 values of the variable.

Home Stock Screener Forex Screener Crypto Screener Economic Calendar How It Works Chart Features Pricing Refer a friend House Rules Help Center Website & Broker Solutions Widgets Charting Solutions Lightweight Charting Library Blog & News Twitter
Profile Profile Settings Account and Billing Referred friends Coins My Support Tickets Help Center Private Messages Chat Sign Out