Reputation: 987
Instead of displaying static text labels, we may want to make them dynamic and context-dependent.
Upvotes: 0
Views: 1902
Reputation: 987
//@version=5
indicator("str.tostring() test")
int x = 5
int y = 6
add = x + y
subtract = y - x
if barstate.islast
Label = label.new(bar_index, high, text =
"X + Y = " + str.tostring(add) +
"\nY - X = " + str.tostring(subtract))
Upvotes: 2