Functions
box.set_xloc()
Sets whether a box's x-coordinates are bar indexes or times.
Syntax
box.set_xloc(series box id, series int left, series int right, series string xloc) → void
Arguments
id required series box Drawing object to modify or query. left required series int Left x-coordinate of the box. right required series int Right x-coordinate of the box. xloc required series string xloc.bar_index or xloc.bar_time. Return Type
void Example
//@lipi=2
indicator("box.set_xloc Example", overlay=true)
if barstate.islast {
b = box.new(bar_index[10], high, bar_index, low, bgcolor=color.new(color.blue, 0.8))
box.set_xloc(b, xloc.bar_index)
}